Selecting a board ¶
What is a microcontroller?
A microcontroller (MCU for microcontroller unit) is a small computer on a single integrated circuit. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable input/output peripherals.
More details here
A microcontroller board is considered a small computer built on a metal oxide semiconductor circuit chip.
We sometimes refer to as an Arduino to any board with a microcontroller - it may be a board made by arduino, sparkfun, or someone else.
Shields are boards that can be plugged on top of the (Arduino) PCB extending its capabilities. The different shields follow the same philosophy as the original toolkit: they are easy to mount, and cheap to produce.
A shield is not always passive! It can have a microcontroller in it too, and sometimes it can be “stand alone” board if needed.
A computer with all of its essential components such as RAM, CPU, and GPU built-in. Usually, SBCs are small, about the size of a credit card, or a bit larger but still smaller than the average desktop PC.
Raspberry Pi is the SBC manufacturer we use the most. Not all SBCs are Raspberry Pis.
(Hardware Attached on Top). A HAT is an add-on board for (Raspberry Pi B+) that conforms to a specific set of rules that will make life easier for users.
In this class, we will talk about different brands/boards/types of boards. We will focus mostly on microcontroller boards.
Important aspects to keep in mind ¶
A feature only makes a board better if you actually use it!
Power - does your project run on batteries or wall power/mains? If it only uses batteries, consider a design that conserves power to run longer between battery changes. Or consider if solar or other power sources might be desirable.
- Does it need portability or is it stationary?
- Related to the above question, is it powered with AC or DC? What are the input voltage ranges?
- AC: 230V; or 110V? Depends on where you are in the world!
- DC common voltage levels: 5V, 3V3, 1V8 (not so common, yet)
- How can we power it?
- Do we use USB? → Good for stationary, sometimes usable with power packs. Remember USB is always 5V.
- Does it have a battery connector? JST-2Pin. Be careful with the polarity!!
- Can we power the board using the pins?
- What are voltage ranges we need for the peripherals we want to connect?
- If we have a peripheral that uses a digital protocol to communicate -> level shifters
- If we have a peripheral such as an analog sensor with higher range than our maximum voltage -> Voltage divider (one directional)
- Current output (type of circuit)
Peripherals are the ‘extras’ beyond plain number crunching - like digital i/o pins, capacitive touch, ADC, SPI, I2C, UART, I2S, etc…
- Pin amounts
- Pin types (ADC, PWM) - clock speed ref. (Not all the pins in a board are the same - always check the pinout!)
Some things to look at: + For analog sensors: ADC (analog to digital converter) - check resolution for the ADC + For making “fake” analog voltages we use PWM (pulse width modulation). For instance, servos are also driven with PWM signals
- Buses: what type of communication protocols does the board integrate?
- I2S: for digital audio transmision
- I2C: normally used for networs of peripherals, such as sensors
- SPI: high speed, like SD-cards
- UART: normally used for communication between microcontrollers
Communications - does your project need to communicate information to you or other devices? Consider how to do that. Radio-enabled projects are great but they will require a transmitter and receiver so the amount of hardware may be double what you thought. You can communicate via USB to a computer often easily. Or maybe infrared signals?
Network vs. protocol
A network is a group of computers connected with eachother with communication lines.
The protocols are the norms/agreements that format the messages and processes between the computers and programs in thos computers to understand eachother
- How far does it need to go?:
- long distance (lower frequency)
- RF: depending on the application, different frequencies
- short distance:
- WiFi: high bandwidth
- BLE: low consumption
- long distance (lower frequency)
- How much data?
- Not too much: RF
- A lot: WiFi or BLE
- Cabled comunication: Although not very common in the microntroller boards we do - ethernet? It can also power the board with PoE!
4. Data/Processing capabilities¶
Speed - does your project crunch a lot of numbers or gather huge amounts of data? Then speed may be good. Otherwise if the project is relatively simple, a smaller, slower board may be perfectly fine (and less expensive).
- RAM: ram size will determine how much you can do in your code: how many variables can be used at the same time, and because of that how many libraries, and other things your code can integrate. 2-4kb is kind of small, 32kb is good for many projects. This memory is volatile (i.e. it gets erased when the board is unplugged)
- Flash size / External flash: it will determine how big your code can be in general (the totality of the compiled code you flash into the board). 4kb is small, 256kb is very good for many projects. The ESP8266 has 4Mb (or even 16Mb)
- EEPROM: you might need this if you want to store small things permanently (i.e. when the board is unplugged it doesn’t get erased)
- Data streams: do yo need to handle video/audio at high speed/resolution? Better use a SMC.
- Data storage: do yo need to store data on the board? In other words, do you need memory? Maybe use one board that has SD-card compatibility!
- Size: some boards are larger only because they are used by non-experienced people, learning how to use them. Same functionality can be found in similar boards many times. Feather boards by adafruit are good options
- Power requirements: remember, cables, batteries… Sometimes high power requires heat dissipation - so be careful!
- User interface: do you need buttons, or screens?
- Documentation/Tutorial availability: very important - no documentation means more frustration!
Price - what is your budget? Keep this in mind when shopping but don’t consider buying anything that will not fulfill the design of your project.
7. Programming Interface¶
Programming - less of a consideration but very important. Your time is valuable, so something easier to program may save you time/money/frustration even if it’s a little more expensive
- External interface needed? (i.e. FTDI): if everytime you need to develop something for your board you need a lot of cables, and a lot of steps… it may not be the best option
- Arduino IDE compatible: for beginners, this IDE is the best
- Platformio compatible: for more advanced users, but much faster/confortable
- Other software/hardware tools needed?
Quoted info taken from the excellent Adafruit guide How to Choose a Microcontroller