Demystifying How To Choose a Microcontroller

Here at Gizmodo, a number of do-it-yourself projects are featured that incorporate microcontrollers. If you've never worked with one before, don't feel daunted, here's an overview to help you select the model that's right for you.

If you're not familiar, a microcontroller (mcu for short) is basically a mini-computer for embedded applications. They are programmable, with features like input and output pins, serial communication interfaces, memory for data storage (RAM), memory for program storage (ROM, EPROM, EEPROM, or Flash memory), and analog-to-digital converters. The number and availability of these and other features vary from model to model, as does the programming language and interface.

So, how do you choose which to use for your project if you don't have experience with a specific mcu, or want to try something new? I'm going to stick with three majors—the Arduino, PIC, and BASIC Stamp—and a new kid on the block, the Netduino, to help guide you.

Demystifying How To Choose a Microcontroller

Firstly, and most importantly—what kind of programming experience do you have, and with what language? Although I'm sure some of you could tackle a project head on with no previous coding under your belt, having an understanding of basic programming principles (debugging, in particular), will greatly ease your microcontroller experience. If you've never programmed before, BASIC is purported to have a low learning curve, so that could be a good way to go. Programming for the Netduino, a new product by Secret Labs LLC, is done in C# (unless you want to hack it to program in C++); Arduino programming is very similar to C/C++, but abstracts some of the more difficult concepts through built-in functions; BASIC, like the name suggests, is based on the BASIC language; and PIC microcontrollers can be programmed in C, Assembly, or BASIC.

For the Netduino and BASIC Stamp, you need a Windows system or Windows virtual machine, but for Arduino and PIC, MAC OSX and Linux platforms are equally compatible with their programming interface.

Next, what sort of project are you planning to undertake? Just a couple of basic, blinking LEDs, or a full blown motorized vehicle complete with motors, servos, and a hundred other parts? To decide which model to get, you'll need to figure out how many I/O pins and how much memory you will require (which boils down to how complicated your project is), and your budget. If you're looking to control the amount of power delivered to a pin (for instance, to control the speed of a motor) you'll want to look into an mcu with pulse-width modulation (PWM) enabled pins, which all of these models support to varying degrees.

The Arduino Duemilanove, BASIC Stamp, Netduino, and PIC32 are comparable in features and pricing, in the range of $25 to $40, and should be able to handle most any project you throw at them. All but the BASIC Stamp are open source, but each have extensive documentation available online (the Netduino is getting there).

Basically: If you want a popular, do-it-all microcontroller and you have some C or C++ experience, go with an Arduino (I've personally worked with an Arduino Mega in the past and can attest to its ease of use and suitability for a wide range of tasks). If you have previous Arduino or C++/C# programming chops and want to be a trailblazer with your projects, try a Netduino. And if you're new to programming, try a PIC or a BASIC Stamp.

But for more information, check out their company websites. [Netduino and Arduino and Parallax and Microchip]