MakerLab
ArduinoArduino Primo

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.

Arduino Primo

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 / SoCMicrochip SAMD21G18A (ARM Cortex-M0+) and Espressif ESP32
Architecture32-bit ARM Cortex-M0+ (SAMD21) and Dual-core Tensilica Xtensa LX6 (ESP32)
Clock speed48MHz (SAMD21) and up to 240MHz (ESP32)
Flash / Storage256KB Flash (SAMD21) on-board, ESP32 has its own Flash
RAM / SRAM32KB SRAM (SAMD21), ESP32 has its own SRAM
Operating voltage3.3V
Digital I/O pins20 (SAMD21)
Analog / ADC6 Analog inputs (SAMD21) - 12-bit resolution
PWM16 channels (SAMD21)
ConnectivityWi-Fi 802.11 b/g/n, Bluetooth Classic & BLE (via ESP32)
USBMicro-USB connector for programming and power
Power input5V via Micro-USB or VIN pin (7-12V recommended)
Dimensions68.6mm x 53.3mm

Pinout & pin functions

PinFunction
3V33.3V Power Output
GNDGround
IOREFI/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)
D2Digital Pin 2
D3Digital Pin 3 (PWM capable)
D4Digital Pin 4
D5Digital Pin 5 (PWM capable)
D6Digital Pin 6 (PWM capable)
D7Digital Pin 7
D8Digital Pin 8
D9Digital Pin 9 (PWM capable)
D10Digital Pin 10 (PWM capable)
D11Digital Pin 11 (PWM capable)
D12Digital Pin 12
D13Digital Pin 13 (LED built-in)
A0Analog Input 0 (ADC)
A1Analog Input 1 (ADC)
A2Analog Input 2 (ADC)
A3Analog Input 3 (ADC)
A4Analog Input 4 (I2C SDA)
A5Analog Input 5 (I2C SCL)
A6Analog Input 6 (ADC)
A7Analog Input 7 (ADC)
VINVoltage Input (7-12V recommended)
RESETReset Button
ESP_TXESP32 UART TX
ESP_RXESP32 UART RX
ESP_ENESP32 Enable
ESP_BOOTESP32 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.

Project ideas

Wi-Fi Connected Weather StationBuild a weather station using sensors for temperature, humidity, and pressure. The SAMD21 reads the sensors, and the ESP32 sends the data wirelessly to a cloud service or a local web server, allowing you to monitor conditions remotely.
Bluetooth Low Energy (BLE) Heart Rate MonitorUse a compatible heart rate sensor and the SAMD21 to read pulse data. The ESP32 then broadcasts this data over BLE, enabling you to view your heart rate on a smartphone app without complex Wi-Fi setup.
Smart Home Automation HubDevelop a central hub that controls various smart devices. The SAMD21 manages local inputs (buttons, sensors), and the ESP32 communicates with devices over Wi-Fi or Bluetooth, acting as a bridge between your local setup and the internet.
Remote Controlled RobotCreate a robot with motors and sensors controlled by the SAMD21. The ESP32 provides wireless control via a web interface or a mobile app, allowing you to drive the robot from anywhere on your network.
Data Logger with Cloud UploadLog sensor data (e.g., light levels, soil moisture) to the SAMD21's flash memory. Periodically, the ESP32 connects to Wi-Fi to upload the collected data to a cloud platform for analysis and visualization.
IoT Security Camera InterfaceWhile the Primo doesn't have a camera itself, it can interface with external camera modules or sensors. The SAMD21 processes sensor data, and the ESP32 can trigger image capture or transmit alerts over Wi-Fi when specific events are detected.

Buying tips & gotchas

When purchasing an Arduino Primo, be aware that it was a more specialized board and might be harder to find new compared to mainstream Arduino models. Look for genuine boards as clones can vary in quality. Accessories like jumper wires, breadboards, and a variety of sensors (temperature, humidity, motion, light) are essential. Ensure you have a reliable 3.3V compatible sensor set or appropriate level shifters if using 5V components. A stable power supply, especially for Wi-Fi operations, is critical to avoid unexpected resets. Familiarize yourself with both the SAMD21 and ESP32 programming paradigms, as managing two processors requires a different approach than single-chip boards.