Microcontrollers are ubiquitous these days, being hidden away in everything from your microwave oven to your car. These amazing little devices can control a myriad of tasks from handling your answering machine functions to controlling that fancy SLR digital camera you just purchased. Typically they are found in TVs, VCRs, digital cameras, cell phones, laser printers, dishwashers, GPS units, and on and on. The industrial uses are too numerous to count.
A microcontroller is basically a computer on a chip along with some other devices such as timers and counters, and analog to digital converters etc. By putting nearly everything you need on a single chip the cost can be reduced significantly
A typical low-end microcontroller chip might have , bytes of ROM and 2 bytes of RAM on the chip, with eight I/ pins. In large quantities, the cost of these chips can sometimes be just pennies. You certainly are never going to run Microsoft Word on such a chip, but you don’t need Microsoft Word to control a microwave oven, either.
With a microcontroller, you have one specific task you are trying to accomplish, and low-cost, low-power performance is what is important.
I’ve been working with a typical microcontroller chip lately, a PIC 2F675. This little chip has 8 pins and it’s about half the size of a dime. Inside is a programmable computer, RAM memory for temporary data storage and Eprom memory for permanent program storage. It also has several counters, timers, comparators, and analog to digital converters. You simply plug it into a socket on your programmer and program it to do what you want. Then plug it into a socket on your circuit board and you are off and running.
I recently built a controller for a pump with one of the PIC 2F675 chips. Two of the eight pins are for power, leaving 6 pins for getting data and control signals in and out of the chip. For this application I hooked a temperature sensor to one pin, a volume control to another pin, and a push button for a third pin. These are used as inputs. The volume control is used to set the temperature level for switching, the push button starts the pump, and the temperature sensor tells the pump when to shut off. I used a fourth pin to control the relay running the pump.
A complete temperature control system on a $2. chip. With a power supply and the controls and relays the total cost was about $2.. In high volume manufacturing the cost would probably be about $2. for the whole works. That is one of the beauties of microcontrollers…the extremely low cost.
These devices come in a variety of configurations with widely varying amounts of memory and peripheral devices on the chip. I’ve used microcontrollers with as few as 6 pins, and several times I’ve used chips with 4 pins. Those big 4 pin chips can run over $2. each in small quantities, but man do they have power!
The programmers are very simple costing less than $2., sometimes much less. You can program the chips in assembly code, or use a compiler and a higher level language such as BASIC. I use basic since it makes programming much easier and I don’t really want to learn assembly language.
There is a ton of online support and forums for users of these chips, and there is no shortage of application examples and information available from the manufacturers. If you are a hobbyist or are interested in controlling things you should try your hand at building some circuits with these fantastic little devices.