Picking a Microcontroller

Originally written on August 9, 2016 by Tom Igoe
Last modified on August 25, 2016 by Tom Igoe

by Tom Igoe, August 2016

Introduction

With a wide variety of Arduino and Arduino-compatible options on the market, students often ask “which is the best controller for me to get?” What follows is a guide how to decide what to choose. This is by no means an exhaustive list, it only includes boards I use regularly enough to recommend.

The things you should consider in picking a controller, other than price:

  • Is this controller compatible with my other components?
    • Does it operate on the same voltage range?
    • Does it have the correct interface (e.g. asynchronous serial, I2C, SPI)?
    • Is it programmable with the tools I am using and any existing code I am using?
  • What  physical inputs and outputs do I need?
  • With what other devices does it need to communicate?
    • What protocols will they use (e.g. WiFi, Bluetooth, USB, etc)?
    • What aspects of the project can be handled by those other devices?
  • Is the form factor one I can work with?

All of the lab exercises for this class are based on the Arduino Uno, and can be done with it. The processor at the core of the Uno, Atmel’s ATMega328, is a solid 8-bit microcontroller with plenty of features to serve most physical computing projects’ needs. The ATMega328 is one of the few processors that still comes in a breadboard-friendly DIP package, so you can even build your own Uno-compatible circuit on a breadboard if you want to save money. In projects where you’re using multiple controllers, the DIY breadboard option is a smart choice. However, it’s not a task for you if you aren’t yet comfortable building circuits and reading schematics.

Nowadays, 32-bit microcontrollers are available for about the same price as 8-bit controllers. These newer controllers have more processing power and memory for your program than the Uno and other 8-bit controllers, and if you’re buying your first controller, your best choice is probably a 32-bit controller. The Arduino 101 and the MKR1000 are the ones I currently use the most.

For Beginners

The Arduino 101  has the same physical layout as the Uno, with I/O pins in most all the same places, so it can be swapped in whenever you find a tutorial based on the Uno. It has a built-in accelerometer and gyrometer, so you can sense motion of the board with no additional parts, and a built-in Bluetooth LE radio, so you can connect to laptops and mobile devices as well. It’s got a whole lot more memory and a faster processor than the Uno for not much more money ($25 for an Uno, $30 for a 101). It operates on a different voltage (3.3V vs 5V) so you have to pay attention to the voltage requirements of any external components you use, but it’s fairly tolerant of the difference.

The MKR1000 is based on the same processor as the 32-bit Arduino Zero, but less expensive and with more features. has a breadboard-friendly DIP package with plenty of I/O connections, and a built-in WiFi radio. Code you’ve written for the Uno will also run on this just like on the 101, but you’ll need to pay attention to which pins your external components are connected to, since the layout is not the same. It has a LiPo battery charger on board as well, so it’s easy to build into a mobile project. It’s also 3.3V board.

Caveat: be wary of cheap derivatives, clones, and counterfeits of these boards. There are a number of very good derivatives that offer extra features, or different layouts. There are also a number of derivatives and clones that try to look the same, but use lower quality components or spend less time on inspecting assembled boards. We see a few broken projects every year that are due to a clone board failing.  Many of the vendors linked from this page sell their own Arduino-compatible variants that are reputable, if you want to look for derivatives.

Adafruit’s Feather M0 boards are also good adaptations of the MKR1000 idea. They use the same processsor, Atmel’s CortexM0+, they also use the DIP package, and they come in a variety of special-purpose variations. The basic Feather M0 Proto board has just the processor, it’s like a MKR1000 without the Wifi. The Feather Adalogger M0 is the same thing with a built-in SD card. The Feathers also have a built-in LiPo battery charger.

With one of the boards above, you can do everything covered in the labs for this class, with a faster and more capable processor than the Uno. Everything that follows is for readers who are already comfortable with microcontrollers, and looking for more info for advanced projects. For more information, see the comparison chart and vendors at the bottom of this page.

3.3V? 5V? What’s the difference?

1.7V, of course (a little electrical humor).

The Arduino Uno and the boards that came before it operated on 5 volts DC. However many newer controllers, including all the ones here,  and the embedded Linux boards like the BeagleBone and the Raspberry Pi, operate on 3.3 volts instead. Many older components, like the Sharp IR rangers that are popular in physical computing, operate on 5 volts, and many newer ones operate on 3.3 volts. Because of this change, you often need to adjust the voltage output of one component before it goes into another component. This is called level shifting. It’s a common technique you learn how to deal with when you work with many different components.

 

I Need A Lot of Input and Output…

Many physical computing projects need lots of input and output connections to read lots of sensors. There are lots of strategies for handling this. Many of the most common strategies are described in chapter 14 of Physical Computing: Sensing and Controlling the Physical World by Dan O’Sullivan and Tom Igoe. Although that book describes processors other than the Arduino, the circuits and techniques described work well with Arduino-compatible boards.

If you just want a single board with a lot of pins, consider the Arduino Mega2560.   It’s an 8-bit board, but with plenty of I/O and memory to do what you need for projects with lots of I/O. This, or the strategies in Physical Computing, are probably the best option for multiple I/O for beginners.

If you’re feeling more advanced and want another approach, consider building your project with multiple processors. You can build your own Uno variant on a breadboard, or you can use the even smaller ATTiny84 and ATTiny85 controllers. These controllers have only a few I/O pins, but they are a couple of dollars each, and David Mellis has an excellent guide to programming them. You can link several of them together in one circuit and have each one control a handful of your I/O pins, then use one of the other processors mentioned here as a main controller.

You could also consider the ESP8266 processors below, if you need lots of processors connected wirelessly. They’re not as inexpensive as the ATTiny processors, but they have built-in WiFi.

Different Flavors of Wireless

There are numerous Feather M0 variants with different radios on them as well.  The Feather M0 WiFi WINC1500 uses the same WiFi radio as the MKR1000. The Adafruit WINC1500 library for this board is based on the Arduino WiFi101 libraries, so code is relatively compatible with the MKR1000. See their tutorial for some important changes though. All of these variants have more or less the same I/O pins as the MKR1000, though they’re arranged differently on the different boards.

Espressif’s ESP8266 processor is a very inexpensive 32-bit processor with WiFi built in. It’s very popular when you’re building projects that need lots of WiFi devices. It has relatively little I/O, however,  and only one analog in that can only read a 1-volt range. So the lower cost is often lost in extra components to add I/O.  The Feather Huzzah ESP8266 is a good implementation of the ESP8266, as is Spark Fun’s ESP8266 Thing Dev board. Many other vendors sell their own version of the ESP8266 board, but these are the two that I’ve used which are simplest for relative beginners to use. The ESP8266 WiFi libraries are based on the Arduino WiFi101 libraries, so code is relatively compatible with the MKR1000.

The ESP8266 boards can also run other languages. There’s a port of JavaScript, a MicroPython version, and Lua version that are relatively mature, and others still in development. Watch the ESP8266 repository for updates.

The ESP8266 boards are not great for the absolute beginner, but they’re relatively easy for intermediate users, and handy when you need a lot of processors networked inexpensively.

If you’re working on a project that needs Bluetooth LE project, there are many boards that can do the job. The most popular Bluetooth LE radios for the Arduino IDE are Nordic’s radios. These are not microcontrollers themselves, but external components that you add to a microcontroller. They include the nRF8001, which you can add on to any microcontroller, and the nRF51822, which has its own built-in Cortex M0 processor. Sandeep Mistry’s Arduino BLEPeripheral library (known as CurieBLE for the 101 board) works with these radios.  The aforementioned Arduino 101 has an nRF51822 built in, as does RedBear Labs BLE Nano, which is one of the smallest programmable Bluetooth LE boards. It has very few I/O pins, however.

Another caveat: Bluetooth LE is not as simple as using the Bluetooth 2.0 Serial Port Profile. If you just need a Bluetooth serial connection, consider adding a BlueFruit EZ-Link or a Bluetooth Mate Silver to your board.

Here’s a comparison chart of Arduino processors. This doesn’t cover all the processors in this document, but it gives you an idea of the range of processors available.

Can I Program it in Python/JavaScript?

Yes, but there are limitations. There are microcontrollers on the market that you can program with scripting languages like Python and JavaScript. The Espruino is a good version of JavaScript for microcontrollers, and the MicroPython board does the same for Python. The BBC Micro:Bit runs both. The Espruino JavaScript engine is available for the ESP8266 as well, as is MicroPython for 8266.

Although these scripting engines seem enticing for microcontroller use, they come at a cost. Scripting engines can never run your code as fast as compiled code, and sometimes the timing can be inconsistent, because the engine’s cleaning up memory and not listening to your I/O pins. Any good programming tool needs a good framework for building libraries as well. When you’re looking at new tools like this, check what libraries are available, and what the framework for building libraries looks like, and how many programmers are using it.

The ones mentioned here are the most promising ones I’ve tried myself. Though I’m still not ready to use them in this class, I am watching closely, ever hopeful.

What About Embedded Linux?

There are a number of different embedded Linux processors on the market now that are in the same price range as microcontroller boards. The Raspberry Pi and the BeagleBone Green Wireless are excellent examples of this, and good products. These boards are getting more capable all the time. Many of the Processing and P5.js/node.js examples for this class run on the Raspberry Pi 2 and 3, for example, or the BeagleBone Green Wireless.

For this intro to physical computing class, they are overkill, however, because they require you to learn how an embedded operating system works in addition to the electronics, programming, and physical interaction design we’re already covering. It’s not uncommon to combine a microcontroller with an embedded linux processor, with the former handling physical I/O and the latter handling media control or network communication. The two communicate via asynchronous serial, just like your laptop and your microcontroller will do in the serial labs in this class.

For the purposes of this class, you’re welcome to explore the embedded Linux boards independently once you’ve shown mastery of the material covered in class. Your projects will be evaluated mostly on how well they demonstrate good physical interaction design, however.

Microcontrollers Compared

Name Manufacturer Processor Operating Voltage Analog Input Pins Digital I/O pins/PWM Pins (1) Features Connectivity Complexity
Uno Arduino Atmega328 5V 6 14/6 x SPI/1 UART/I2C Beginner
101 Arduino Intel Curie 3.3V 6 14/4 Bluetooth LE & Accelerometer/gyrometer & Real-time Clock SPI/USB UART/I2C Beginner
MKR1000 Arduino Cortex M0+ 3.3V 7 8/4 WiFi& LiPo charger & Real-time Clock SPI/1 UART/I2C Beginner
Mega 2560 Arduino ATMega2560 5V 16 54/15 x SPI/4 UART/I2C Beginner
DIY Uno-compatible You Atmega328 5V 6 14/6 x SPI/1 UART/I2C Intermediate
DIY Tiny You ATtiny84 or Attiny85 5V 3 or 6 5 or 11 x Software UART Intermediate
Feather M0 Proto Adafruit Cortex M0+ 3.3V 6 7/7 WiFi & LiPo charger & Real-time Clock SPI/1 UART/I2C Beginner
Feather M0 Adalogger Adafruit Cortex M0+ 3.3V 6 7/7 LiPo charger & Real-time Clock SPI/1 UART/I2C Beginner
Feather M0 WiFi WINC1500 Adafruit Cortex M0+ 3.3V 6 7/7 Wifi & LiPo charger & Real-time Clock SPI/1 UART/I2C Intermediate
Feather M0 ESP8266 Huzzah Adafruit ESP8266 3.3V 1 (1V range) 4 WiFi & LiPo charger SPI/1 UART/I2C Intermediate
Spark Fun Thing Dev Spark Fun ESP8266 3.3V 1 (1V range) 4 WiFi SPI/1 UART/I2C Intermediate
BLE Nano Red Bear Labs nRF51822 & Cortex M0 3.3V 3 9 Bluetooth LE SPI/1 UART/I2C Advanced

(1) not counting those designated for UART, SPI, Analog, or I2C

Where To Get Boards

The Arduino boards mentioned here are carried by the Arduino online store as well as many of the vendors mentioned here: Adafruit, Spark Fun, Seeed Studio, and Digikey are the vendors I use most frequently. For Seeed Studio products in the US, Digikey is a useful reseller. It’s worth comparing them all for pricing, though the differences are not usually large.  For RedBear Labs‘ boards, Spark Fun and Digikey are good US resellers.