CHAPTER 27 ■ ENCORE
Microcontroller Costs
Microcontrollers are relatively inexpensive, most cost between $1 and $15 each in single quantity. However,
the programming boards are expensive, costing between $99 and $400. But, that’s a one-time expense for a
particular chip. To further reduce costs, some hobbyists sell simplified programming boards, often built into
a cable, for as little as $20.
Another expense is the programming language. If you come from a computer science background,
you’ll be pleased to discover C, C++, and some Java compilers are generally available for most
microcontrollers for an additional price. Fortunately, the free GNU Compiler Collection (GCC) supports a
variety of microcontrollers, so you may not need to pay for a compiler.
Choosing a Microcontroller
The microcontroller market is very competitive, so most manufacturers provide equally capable products.
Usually, the reason someone supports a particular microcontroller is because that’s the chip family the
person learned first. Once invested, it’s very difficult to get a designer to discard their tools and knowledge
for a different manufacturer’s product line, especially for one that only proves equivalent.
I prefer Atmel 8-bit AVR microcontrollers (see Figure 27-2). My newest robots are based on them.
Almost all of the ATmega and ATtiny series are available in hobbyist-friendly DIP packages.
Figure 27-2. Atmel microcontrollers: ATmega328 (top), ATtiny84 (bottom left), and ATtiny85V (bottom right)
Other designers prefer Parallax Propeller (multi-core) and Microchip PIC. Another choice is Arduino,
which is an open-source platform based on Atmel microcontrollers that is compatible with a wide variety of
ready-made and enthusiast-created boards.
Voltage Regulators
The major issue that complicates establishing the brightness of an LED, and other calculations of current, is
that the battery voltage declines with use. That factor also makes it difficult to document test point voltages
for comparison with acceptable values. Is 6 V okay at test point 1? I don’t know, maybe. It depends on the
voltage of the battery.
Steady voltage makes for consistent brightness, consistent motor speed, and a single set of calculations.
More significantly, steady voltage provides an environment suitable, if not strictly required, for fussier chips
or sensitive components.