March 17, 2007
In my last post, I talked briefly about the Arduino Project and how you only need to know about 5 Volt logic driven electronics. Most likely any Professor or Engineer would shoot me down in flames for saying this but in practice – there is a lot of truth in this statement! To explain myself, the roll of a micro-controller is to act as the brains for a given piece of hardware. Software determines the state of pins on the controller (the inputs and outputs on the chip). These pins can be connected to all sorts of devices to test temperature or light levels etc They can also be connected to devices such as motors, LED’s and LCD screens. In other words they can “Listen” to a sensor to determine a course of action and then output a result. The way they do this is by converting analog signals into digital. They sample a moment in time, record a value which is then sent on for further processing by the software you design. After a course of action is determined, the software will enable or disable an output pin on the micro-controller. Essentially, the role of the micro-controller is really simply a “Switching” controller. It turns the light off with a switch or turns the motor on with a switch etc. Obviously, the input pins can also be other switches as well and not just analog signals. So for instance, a switch connected to the micro-controller, when pressed might trigger a new result by the chip.
So for anyone starting in electronics – and I guess I’m really talking about myself, this basic concept of “off” and “on” or HIGH and LOW or “1″ and “0″ is easier to understand. It reduces what you immediately need to learn – to get started. Most of the circuits I have built so far have required only a minimal understanding of “Passive” and “Linear” components – things like Capacitors and Resistors, Regulators and Diodes for example. Really it’s about how to use them so they won’t burn up on you as some are polarised and can’t be connected the wrong way around! The nice thing about learning this way, you find yourself acquiring the knowledge about these “analog” devices and there associated mathematics anyway!
For us as micro-controller based designers, the most important thing we need to concentrate on is how to acquire a digital value. If this means we need to interface with a circuit built from Passive/Linear devices, feeding the input pin of our controller with an analog signal then our job will be to determine how best to turn that signal into something Digital. I won’t confuse the issue here, but many micro-controllers (including the AVR) have the ability to do this conversion for you but this statement is mostly true.
Finally, 5 Volts you say. It doesn’t have to be 5 Volts it could be 3 Volts but the controllers I am using at the moment have two states that represent “On” and “Off”. 5 Volts for “On” and 0 Volts for “Off”. In practice, it’s more like 2 volts for “Off” and 4.7 Volts for “ON” but this is the general idea. In a later post I will explain the two “Families” of digital logic that are most common – TTL and CMOS
Leave a Comment » |
mac osx arduino avr atmega8 atmega168 |
Permalink
Posted by captainkarl
March 11, 2007
Welcome to Electromac. This blog is my attempt to organise what I have learnt about both the Mac platform and Electronics and how they can be used together to develop full blown applications and hardware.
To set the record straight, I am not an electronics engineer nor am I a computer programmer. I certainly have no qualifications in either field but I have a burning desire to learn! Officially I work in the film industry. In my day to day job, I often come across situations where it would be great to have a custom designed piece of hardware interacting with my Mac OSX laptop. A typical situation for example would be a small light weight motion control rig that could be packed up into a small suitcase and transported on a commercial carrier, setup with a small crew and operated in a remote part of the world – all running off batteries. Often I am frustrated that these devices are not yet commercially available at a reasonable price AND available for the MAC OSX platform. So I started to investigate how difficult it would be to learn a computer language that would compile and run on a Mac and could talk to some hardware device attached to my Mac through ethernet, USB or Firewire. Then further to this, I discovered that there are “others” doing the same thing, I just didn’t know it.
On the hardware front, I was shocked to find that working with micro-controllers was not that difficult – at least so it seemed. Investigating further, I tried all sorts of hardware programmers and tried to get them to work using the Terminal and command lines from the Mac. Most of these failed, mostly because of my poor Unix skills. But then, a revelation happened! I discovered an open sourced project called Arduino. It’s a project that provides a free development environment for Windows, Linux and Mac OSX! It works with a very cheap In/Out board which is either attached via USB or Bluetooth to your computer, allowing you to upload programs to run on ATMEL’s AVR Atmega8 chip. This may sound wildly geeky (and it probably is) but for simplicity – it could not be easier!

Micro-controllers have distinct advantages over traditional electronics for a couple of reasons. With a single chip, you can replace a whole raft of other electronic components and keep your design small and flexible. Generally, you only need to know about digital logic and the resulting 5 Volt circuitry (in a future post I will explain what this actually means). For me the final benefit of working with micro-controllers is the ability to “software” upgrade the design later down the track with no or minimal hardware change.

Lastly, for people wanting to learn something as complex as electronics, without the backing of a University, the Arduino project also provides another important element. A very comprehensive website, complete with many step by step tutorials laid out for people like you and me. Many of the tutorials have accompanying photographs and illustrations. Example code is well documented and explained in simple language. However, what is most impressive is the forum’s. They are moderated by Professor’s and Electronics/Software engineers who are prepared to talk to Nubies like myself and answer questions. Through this project, I took my first steps into Electronics and software design! Overcoming that fear of actually connected parts and passing electricity through them and then connecting them to my precious Mac laptop via USB, has given me the confidence to continue on and maybe in the future, venture further.
If you think it’s hard – it’s not! Yes many hours have been spent on the internet but who gets anything for free.
Leave a Comment » |
mac osx arduino avr atmega8 atmega168 |
Permalink
Posted by captainkarl