The Arduino and Raspberry Pi are really useful platforms for creating DIY projects, but they are not the only ones out there. As there are so many different platforms we will focus on some of the most popular in this chapter. These platforms include
- PIC / AVR
An Overview of micro:bit
The micro:bit is a small single board microcontroller system that is aimed at the educational market. Although its creators originally designed the micro:bit to be used by beginners and students for elementary projects, it is packed full of peripherals and plenty of GPIO, making it ideal for a lot of projects. Some of the onboard peripherals and sensors include:
- Magnetic field sensor
- 5 x 5 LED array
- Light detector (via LED array)
- Temperature sensor
- 3 large GPIO clip points
- Two buttons
- USB connectivity
Instead of writing code, blocks are dragged into a workspace that can be joined together in a very similar fashion to jigsaw pieces. This prevents a lot of coding mistakes as well as providing a visual method for coding (i.e., programs are easier to read and understand their function).
The use of blocks also has another advantage: peripherals are easier to use. Setting up radio communication via Bluetooth can be a complex task but with just the use of a few blocks, a radio program that transmits and receives numbers can easily be created.
An Overview of MicroPython
Python is a fantastic language for creating cross-platform code quickly all the while making libraries easy to use. One clever engineer, Damien P. George, saw the many advantages of Python and decided to port Python to microcontrollers and created MicroPython as a result.
The PyBoard is a specialized board designed to run MicroPython and provides some useful peripherals including I2C, SPI, and an inbuilt accelerometer but MicroPython can be made to run on other ARM processors.
One device, in particular, that really takes advantage of MicroPython is the ESP8266 which has a special port of MicroPython which includes Wi-Fi and internet functionality. This means that you can very quickly create IoT projects using Python scripts and easily download them to microcontrollers all without needing a specialized programmer.
An Overview of PICs and AVRs
Unlike the Arduino and Raspberry Pi boards, PICs and AVRs require a dedicated programmer which is typically a USB device with 6 to 10 output pins that connect to the microcontroller.
While creating PIC and AVR circuits requires some experience, the resulting circuits are almost always cheaper than those built using prototyping tools like the Arduino. Since PIC- and AVR-based projects are often designed from scratch the designer is more likely to understand every aspect of the circuit (this is useful when trying to fix problems and debug software).
PIC and AVR microcontrollers are only two main types of many available on the market but which one is the best? Which one should you pick? As it turns out, no microcontroller is the best on the market for every single project, as they all have different properties that make them useful in certain applications. For example, PIC devices are generally slower than AVR devices but have a better range of onboard peripherals. PIC devices are often cheaper than AVR and are arguably better supported through the different XC compilers available but AVR programs can be compiled with WinAVR which supports limited object orientated programming.
There are development platforms available for both options. AVR microcontrollers can be programmed using AVR Studio, while PIC microcontrollers use MPLAB.
Options for Every Project
Every microcontroller and platform has its own perks and pitfalls depending on what you want to create. It's a challenging and exciting process to find the best platform for your project! The best way to get comfortable is to dive in and see what you create.