Arduino Primo: A Powerful Microcontroller for Advanced Projects
The Arduino Primo combines a powerful SAMD21 microcontroller with an ESP32 Wi-Fi module, offering a versatile platform for connected embedded projects.
The Arduino Primo, released around 2016, was an ambitious board designed to bridge the gap between powerful microcontrollers and integrated wireless connectivity. It features two distinct processing units: the Atmel (now Microchip) SAMD21 Cortex-M0+ microcontroller and the Espressif ESP32 dual-core Wi-Fi and Bluetooth SoC. This dual-chip architecture allows for complex processing on the SAMD21 while leveraging the ESP32 for robust wireless communication, making it suitable for IoT applications, advanced sensor networks, and projects requiring both local intelligence and remote access.
At its core, the SAMD21 is a 32-bit ARM Cortex-M0+ processor running at 48MHz. It boasts 256KB of Flash memory and 32KB of SRAM, providing ample resources for moderately complex embedded applications. The SAMD21 handles the primary control and logic of the board, interfacing with sensors, actuators, and other peripherals. Its low power consumption is also a key feature, making it suitable for battery-powered devices.
The integrated ESP32 module is a significant addition, offering Wi-Fi (802.11 b/g/n) and Bluetooth (Classic and BLE) capabilities. This allows the Arduino Primo to connect to networks, communicate with other devices, and be controlled remotely. The ESP32 can operate independently or in conjunction with the SAMD21, enabling sophisticated designs where the SAMD21 manages local tasks and the ESP32 handles all network-related operations. This dual-processor approach makes the Primo a powerful choice for makers and engineers looking to develop sophisticated, connected hardware.
The Arduino Primo was aimed at users who had outgrown the capabilities of simpler Arduino boards like the Uno and needed more processing power, memory, and integrated wireless connectivity. It's particularly well-suited for projects involving data logging, remote monitoring, smart home devices, wearable technology, and advanced robotics where both local processing and network communication are essential. Its dual-chip design offers flexibility but also introduces a steeper learning curve compared to single-microcontroller boards.
Watch
Related video, embedded from YouTube.
Specifications
| Microcontroller / SoC | Microchip SAMD21G18A (ARM Cortex-M0+) and Espressif ESP32 |
| Architecture | 32-bit ARM Cortex-M0+ (SAMD21) and Dual-core Tensilica Xtensa LX6 (ESP32) |
| Clock speed | 48MHz (SAMD21) and up to 240MHz (ESP32) |
| Flash / Storage | 256KB Flash (SAMD21) on-board, ESP32 has its own Flash |
| RAM / SRAM | 32KB SRAM (SAMD21), ESP32 has its own SRAM |
| Operating voltage | 3.3V |
| Digital I/O pins | 20 (SAMD21) |
| Analog / ADC | 6 Analog inputs (SAMD21) - 12-bit resolution |
| PWM | 16 channels (SAMD21) |
| Connectivity | Wi-Fi 802.11 b/g/n, Bluetooth Classic & BLE (via ESP32) |
| USB | Micro-USB connector for programming and power |
| Power input | 5V via Micro-USB or VIN pin (7-12V recommended) |
| Dimensions | 68.6mm x 53.3mm |
Pinout & pin functions
| Pin | Function |
|---|---|
| 3V3 | 3.3V Power Output |
| GND | Ground |
| IOREF | I/O Reference Voltage (3.3V for this board) |
| D0 (RX) | Digital Pin 0 (Serial RX for SAMD21) |
| D1 (TX) | Digital Pin 1 (Serial TX for SAMD21) |
| D2 | Digital Pin 2 |
| D3 | Digital Pin 3 (PWM capable) |
| D4 | Digital Pin 4 |
| D5 | Digital Pin 5 (PWM capable) |
| D6 | Digital Pin 6 (PWM capable) |
| D7 | Digital Pin 7 |
| D8 | Digital Pin 8 |
| D9 | Digital Pin 9 (PWM capable) |
| D10 | Digital Pin 10 (PWM capable) |
| D11 | Digital Pin 11 (PWM capable) |
| D12 | Digital Pin 12 |
| D13 | Digital Pin 13 (LED built-in) |
| A0 | Analog Input 0 (ADC) |
| A1 | Analog Input 1 (ADC) |
| A2 | Analog Input 2 (ADC) |
| A3 | Analog Input 3 (ADC) |
| A4 | Analog Input 4 (I2C SDA) |
| A5 | Analog Input 5 (I2C SCL) |
| A6 | Analog Input 6 (ADC) |
| A7 | Analog Input 7 (ADC) |
| VIN | Voltage Input (7-12V recommended) |
| RESET | Reset Button |
| ESP_TX | ESP32 UART TX |
| ESP_RX | ESP32 UART RX |
| ESP_EN | ESP32 Enable |
| ESP_BOOT | ESP32 Boot Mode Select |
Wiring & circuit basics
The Arduino Primo operates at a logic level of 3.3V. This is crucial when connecting external components. Connecting 5V devices directly to the 3.3V GPIO pins can damage the SAMD21 microcontroller. If you need to interface with 5V logic devices, use a logic level shifter. Powering the board can be done via the Micro-USB port, which typically supplies 5V. Alternatively, the VIN pin can accept a wider voltage range, usually 7-12V, which is then regulated down to 5V and then to 3.3V by onboard regulators. Ensure your power supply can provide sufficient current, especially when the ESP32 is actively transmitting, which can draw significant current spikes.
For a simple LED project, connect the longer leg (anode) of an LED to a digital pin (e.g., D13) through a current-limiting resistor (typically 220-330 ohms). Connect the shorter leg (cathode) of the LED to a GND pin. This setup allows the SAMD21 to control the LED by setting the digital pin HIGH (3.3V) or LOW (0V). For more complex sensors, such as an I2C sensor like a BME280, connect its VCC pin to the 3V3 pin on the Primo, its GND pin to a GND pin, its SDA pin to A4 (SDA), and its SCL pin to A5 (SCL).
When using the ESP32 for Wi-Fi or Bluetooth, be mindful of its power requirements. High current draw during transmission can cause voltage dips, potentially resetting the SAMD21 or disrupting communication. It's often recommended to provide a stable, dedicated power source to the VIN pin or ensure the USB power supply is robust (e.g., a powered USB hub or a quality wall adapter) if relying on USB power for both the SAMD21 and ESP32.
Programming & getting started
The Arduino Primo can be programmed using the Arduino IDE. For the SAMD21 microcontroller, you'll need to install the 'Arduino SAMD Boards' package via the Board Manager. The ESP32 module can be programmed separately using its own toolchain (e.g., ESP-IDF) or, more commonly for Arduino users, via libraries that allow the SAMD21 to communicate with and control the ESP32. Some setups might allow direct programming of the ESP32 via the IDE using specific board definitions. Uploading code to the SAMD21 is done via the Micro-USB port.
To upload your first sketch to the SAMD21: connect the Arduino Primo to your computer via Micro-USB, select 'Arduino Primo' (or a similar SAMD21-based board) from the Tools > Board menu in the Arduino IDE, select the correct COM port, and click the Upload button. For projects involving the ESP32, you might need to install specific libraries (e.g., for Wi-Fi or Bluetooth) and potentially configure the IDE to handle the dual-processor communication, often by sending AT commands to the ESP32 from the SAMD21 sketch.