Learning about Arduino – The hardware
Arduino provides various microcontroller unit (MCU) development boards. When Arduino is mentioned, a lot of users think of the Arduino Uno, which is arguably the most popular board from Arduino, as well as the most popular one manufactured by other companies based on the reference designs available from Arduino. These clones aren’t called Arduino, but something similar, such as the SparkFun RedBoard manufactured by SparkFun Electronics. The following photo shows various Arduino MCUs.
Figure 1.1 – Various Arduino MCUs
We will be using official Arduino boards in this book. By using an official Arduino board, you will be helping to support the company and its open source efforts.
You might start a conversation about boards with the question, “What is the best board for…?”. The answer, as to most questions, is, “It depends!”
In the world of microcontrollers, the best board is the one that gets the job done while consuming the least amount of resources (power, memory, etc.). Power consumption ties right back to the chip. The greater the capability of a chip, the more complex it is, and the greater the power consumption, normally.
During development, it is normal to pick a board at random, complete the setup, ensure it is working, and then try to downsize the board. What this means is that, at first, you might not know how large your firmware will be, or what code will need to run on it. As a result, you could pick any medium-range board.
After you are done with development, you will know the exact size of your firmware, as well as the number of pins you have utilized and the communication protocols. Then, you can pick a smaller board that supports everything you need and deploy it for production. Or, even better, you could pick the chip and sensors that you need and design a new PCB!
The first place to find Arduino hardware is on the website: https://www.arduino.cc/en/hardware. You can find the complete list of boards, and, as of this writing, attempts to classify them into three categories:
- Nano Family: Boards with a small footprint, some embedded sensors, and support for machine learning (ML).
- MKR Family: Boards equipped with a low-power chip, a communication chip, a cryptographic chip, and support for various shields that make it possible to prototype without additional circuit work. These boards feature a 32-bit SAMD21 (ARM Cortex-M0+) chip from Microchip Technologies (https://ww1.microchip.com/downloads/en/DeviceDoc/SAM_D21_DA1_Family_DataSheet_DS40001882F.pdf).
- Classic Family: The older, more popular boards and their shields.
The second place to find Arduino hardware is on the Pro website: https://www.arduino.cc/pro. This website exists because Arduino wants to be reclassified from just something that is meant for learning to something that can be put to industrial use. Prior to this time, people would learn on an Arduino board but use a board from a competitor for the final product. The Pro website lists hardware in six categories (https://www.arduino.cc/pro/hardware):
- Portenta Family: Boards with the highest-rated chips for their generation, with carriers and shields that make edge deployments possible. Connectivity is provided via shields. The chip on these is a 32-bit dual-core STM32H747 (ARM Cortex-M7 and ARM Cortex-M4) from STMicroelectronics (https://www.st.com/en/microcontrollers-microprocessors/stm32h747-757.html).
- Edge Control: Remote monitoring and control carrier boards, optimized for outdoor environments. These boards feature a 32-bit nRF52840 (ARM Cortex-M4) chip from Nordic Semiconductors (https://www.nordicsemi.com/Products/nRF52840). Edge control boards come with two additional slots for MKR boards that let you extend functionality.
- Nicla Family: Thumb-sized boards with industrial-grade sensors and battery connectors. These are the smallest boards available from Arduino.
- MKR Family: The same as the MKR family from the main website.
- Nano Family: The same as the Nano family from the main website.
- Gateways: Devices for LoRaWAN connectivity. We will discuss these in more detail in Chapter 7, Communicating with LoRaWAN.
Let’s proceed to consider how to pick a board for the projects you will be tackling in this book.
Choosing your board – The Arduino MKR family
The board of choice for this book will be the Arduino MKR family, an example of which is the Arduino MKR WiFi 1010 (https://docs.arduino.cc/hardware/mkr-wifi-1010). The MKR family of boards is targeted at makers or tinkerers, has a popular form factor that is forward compatible with the newer and more powerful Arduino Portenta family of Pro boards, and has a number of shields that minimize the need for solderless breadboards and soldering.
Rather than picking up this board alone, I would recommend purchasing a kit that comes with other components that you can utilize for projects in this book. This kit is the Arduino Oplà IoT Kit, which you can find at this URL: https://store.arduino.cc/products/arduino-opla-iot-kit.
You will get to work with other boards as the need for different communication methods arises. All MKR family boards utilize the same chip: the SAMD21 chip from Microchip Technologies running a 32-bit ARM Cortex-M0+.
The MKR family is made up of various boards with different capabilities, some of which are listed here:
- Arduino MKR WiFi 1010: This board provides WiFi and Bluetooth connectivity
- Arduino MKR FOX 1200: This board provides SigFox connectivity
- Arduino MKR WAN 1310: This board provides LoRaWAN connectivity
- Arduino MKR GSM 1400: This board provides GSM connectivity
Don’t worry if one or more of the communication options aren’t familiar right now, as we will cover them in a later chapter.
The boards have the following general features:
- 8 digital I/O pins
- 13 PWM pins
- 7 analog input pins
- 1 analog output pin
- 1 each of UART, SPI, and I2C
- 256 KB of CPU internal memory
- 32 KB of SRAM
- Onboard WiFi and Bluetooth connectivity
- Onboard RGB LED
Make sure you refer to the documentation for any board that you are working with, from the manufacturer’s website. This will save you a lot of stress and time.
Every board has a pinout diagram. This document provides information on what capabilities each pin on the board has. You can find the pinout diagram for the MKR WiFi 1010 here: https://content.arduino.cc/assets/Pinout-MKRwifi1010_latest.pdf.
Next, let’s discuss the IDE, which provides assistance when you write your code.