Arduino Primo

The Arduino Primo combines the processing power from thenRF52 processor, an Espressif ESP8266 for WiFi, as well as several on-board sensors and a battery charger.

The Arduino Primo board
The Arduino Primo board

The Arduino Primo is the first board developed in cooperation with Nordic Semiconductor. It brings new benefits for the IoT world all on one platform: advanced 32-bit microcontroller architecture, Bluetooth® low energy, Wi-Fi, near-field communications (NFC), and infrared (IR) transmit and receive capability.

There are three onboard microcontrollers:

  • nRF52832, the main Arduino microcontroller with integrated Bluetooth® Low Energy and NFC
  • STM32f103, a service microcontroller used for advanced debugging and programming of the other microcontrollers
  • ESP8266, for Wi-Fi and related internet connectivity functions.

The board has:

  • 14 digital input/output pins (of which 12 can be used as PWM outputs)
  • 6 analog inputs
  • 64 MHz ceramic resonator
  • micro-USB connector
  • ICSP header
  • battery charger
  • Infrared receiver and transmitter
  • NFC antenna
  • Bluetooth® Low Energy interface
  • Buzzer
  • two service buttons
  • LEDs
  • reset buttons (to reset the various microcontrollers).

Arduino Primo can be connected to a computer using a micro-USB cable, or it can be powered using a battery, connected via a 2-pin JST-PH connector. Having both Bluetooth® and Wi-Fi connectivity on board makes it easy to get started in the IoT world

Documentation

OSH: Schematics

Arduino Primo is open-source hardware! You can build your own board using the following files:

SCHEMATICS IN .PDF

DSN FILES IN .ZIP

Programming

The Arduino Primo can be programmed with the Arduino IDE software, as well as 3rd party software. The Arduino is available from Arduino IDE 1.8.x version, downloading the corresponding platform (Arduino NRF52) from the Board Manager.

Power

The Arduino Primo can be powered three different ways:

  • using a micro-USB connector
  • connecting a power supply to the Vin pin
  • using an external battery connected via the 2-pin JST-PH connector. The Primo has integrated a charger and power management circuit that allows to run on battery or an external 5V and also to charge a Li-Ion and Li-Pol battery.
    When it runs an external 5V(4.75~5.25V ) then it cuts off the battery if the voltage is lower than 3.5V and the switching from a source at the other one is done automatically.

Charger

The charge current is 340mA as default setting but you can close the solder bridges, in the back of the board, when you need more current.
-MED :810mA
-HIGH: 910mA

The power pins are as follows:

  • VIN. The input voltage to the Arduino board can be supplied using an external power source or battery. It must supply between 2.7V and 5.5V.
  • 5V. This pin outputs a regulated 5V power supply voltage that is generated from the onboard regulator. Connecting an input power source to the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.
  • 3V3. This pin outputs a regulated 3.3V power supply voltage that is generated from the onboard regulator. Maximum current draw is 50 mA.
  • GND. Ground pins.
  • IOREF. This pin on the Arduino board provides the voltage reference at which the microcontroller operates. A properly configured shield can read the voltage on the IOREF pin to select the appropriate power source, or to enable voltage translators on the 5V or 3.3V outputs.

Memory

The nRF52832 has 512 KB of Flash memory and 64 KB of SRAM. There is no onboard EEPROM memory.

Input and Output

Each of the 14 digital pins on the Primo can be used as an input or output, using pinMode(), digitalWrite() , and digitalRead() functions. They operate at 3.3V. Each pin can provide or receive a maximum current of 14 mA. In addition, some pins have specialized functions:

  • Serial: 0 (RX) and 1 (TX): Pins 0 and 1 are used to receive (RX) and transmit (TX) TTL serial data. On Primo TX and RX LEDs are missing but the ON LED blinks every time you send data over the Serial port of the nRF52
  • External Interrupts: all pins (digital and analog) can be used as external interrupts except pins 0 and 1. Keep in mind that you can’t use more than eight interrupt pins at the same time. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
  • PWM: pulse width modulation is available on all digital pins except pins 0 and 1. The 12-bit PWM output resolution can be adjusted using the analogWriteResolution() function.
  • SPI: A serial peripheral interface (SPI) bus is available using pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK) as well as using the onboard ICSP header. SPI communication is available using the SPI library.
  • LED: There is a built-in LED connected to digital pin 9. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off. The Primo has 6 analog inputs, labeled A0 through A5, each of which provide up to 14 bits of resolution (i.e., 16384 different values). By default they measure from ground to 3.3 volts, though it is possible to change the upper end of their range using the analogReference() function. A few additional pins are on the headers and those pins have specialized functions:
  • TWI: Two-wire interface (TWI) communication is available from the serial data line (SDA) and serial clock line (SCL) pins (located near AREF). TWI communication is supported using the Wire library.
  • AREF. Unlike some other Arduino boards, the analog reference (AREF) pin cannot be used to connect an external reference voltage for the analogRead() command.
  • RESET. Bringing the reset line LOW will reset the microcontroller. RESET pin will reset only nRF52832 microcontroller. In order to reset all the three microcontrollers on board use reset button instead

Communication

The Arduino Primo has a number of facilities available for communicating with a computer, tablet, or smartphone; another Arduino; or other microcontrollers and devices.

The easiest method to communicate is to use a USB cable between the micro-USB port on a Primo, and a standard USB port on a PC. This is the same method used to communicate between the classic Arduino UNO and a PC, in order to upload sketches. Also like the UNO, the Primo supports a serial monitor function, which enables checking the communication between the board and a PC, and sending text messages and sensor data to help debug or analyze the operation of a sketch.

A SoftwareSerial library allows for serial communication over any of the digital pins.

The nRF52832 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify use of the I2C bus and the SPI library for the SPI communication.

The board allows wireless communication with other devices via Bluetooth, NFC, WiFi and IR, using specific libraries for each protocol.

The Bluetooth® Low Energy interface allows Primo to communicate with other Bluetooth® Low Energy devices. It can also be used by PCs, tablets, and smartphones. The library used is Bluetooth® Low Energy that allows peripheral and central capabilities.

The NFC peripheral supports type A communication signals at a106 kbps rate. The NFC library is contained in the NRF52 platform for Arduino software (Arduino IDE 1.8.x or later).

The Primo Wi-Fi communication is supported by the ESP8266 module, which includes a self-contained SoC with integrated TCP/IP protocol stack. This module allows connecting the Primo to a Wi-Fi network. The Primo Wi-Fi configuration supports access point (AP) mode, station (STA) mode, and the combination of the two: AP + STA by the WiFi Link library

The CIR library allows the Primo board to interact with a large number of IR sensors. The board has both receiver and transmitter capability, to give full flexibility to your sketches.

Physical Characteristics

The length and width of the Primo printed circuit board (PCB) is 2.7 x 2.1 inches respectively. It includes a micro-USB connector and a 2-pin adapter for power via a battery or external supply. Four screw holes allow the board to be attached to a surface or case.

Note that like the Arduino Uno and several other boards, the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the other pins.

Tech Specs

WiFi MicrocontrollerArduino MicrocontrollerService Microcontroller
ProcessorESP8266Nordic nRF52832STM32F103RBT6
ArchitectureTensilica Xtensa LX106ARM Cortex-M4FARM Cortex-M3
Operating Voltage3.3 V3.3 V2.0 to 3.6 V
Flash Memory4 MB512 KB64 KB
SRAM / RAM8 MB instruction12 MB data64 KB20 KB
Clock Speed80 MHz64 MHzup to 72 MHz
WiFi802.11 b/g/n 2.4 GHz--
Wake up time< 2ms--
Analog I/O Pins-6 + 1 DAC-
DC Current per I/O Pins-15 mA-
Bluetooth® Smart-BLE4.0: TX power up to +4dBm -96dBm sensitivity in Bluetooth® Low Energy mode-
  • Other features: PDM interface, AES HW enc, NFC tag, USB/Uart converter, CMSIS-DAP, GPIO expander, Board power management, IrDA

Configure a Linux machine for Arduino Primo usage

Execute this script to configure a Linux machine for Arduino Primo usage

1\# arduino-linux-setup.sh : A simple Arduino setup script for Linux systems
2\# Copyright (C) 2015 Arduino Srl
3#
4\# Author : Arturo Rinaldi
5\# E-mail : arturo@arduino.org
6\# Project URL : https://github.com/artynet/arduino-linux-setup
7#
8\# This program is free software: you can redistribute it and/or modify
9\# it under the terms of the GNU General Public License as published by
10\# the Free Software Foundation, either version 3 of the License, or
11\# (at your option) any later version.
12#
13\# This program is distributed in the hope that it will be useful,
14\# but WITHOUT ANY WARRANTY; without even the implied warranty of
15\# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16\# GNU General Public License for more details.
17#
18\# You should have received a copy of the GNU General Public License
19\# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21\# Release v8 changelog :
22#
23\# + rules are now created in /tmp folder
24#
25\# Release v7 changelog :
26#
27\# + Adding project URL
28\# + minor bugfixing
29#
30\# Release v6 changelog :
31#
32\# + removing sudocheck function and control
33#
34\# Release v5 changelog :
35#
36\# + adding UDEV rule for stm32 DFU mode
37#
38\# Release v4 changelog :
39#
40\# + The rules are generated in a temporary folder
41#
42\# + the user should run it without sudo while having its permissions
43#
44\# Release v3 changelog :
45#
46\# + The most common linux distros are now fully supported
47#
48\# + now the script checks for SUDO permissions
49#
50
51#! /bin/bash
52
53\# if \[\[ $EUID != 0 \]\] ; then
54\# echo This must be run as root!
55\# exit 1
56\# fi
57
58refreshudev () {
59
60 echo ""
61 echo "Restarting udev"
62 echo ""
63
64 sudo service udev restart
65 sudo udevadm control --reload-rules
66 sudo udevadm trigger
67
68}
69
70groupsfunc () {
71
72 echo ""
73 echo "\*\*\*\*\*\*\* Add User to dialout,tty, uucp, plugdev groups \*\*\*\*\*\*\*"
74 echo ""
75
76 sudo usermod -a -G tty $1
77 sudo usermod -a -G dialout $1
78 sudo usermod -a -G uucp $1
79 sudo groupadd plugdev
80 sudo usermod -a -G plugdev $1
81
82}
83
84acmrules () {
85
86 echo ""
87 echo "# Setting serial port rules"
88 echo ""
89
90cat <<EOF
91"KERNEL="ttyUSB\[0-9\]\*", TAG+="udev-acl", TAG+="uaccess", OWNER="$1"
92"KERNEL="ttyACM\[0-9\]\*", TAG+="udev-acl", TAG+="uaccess", OWNER="$1"
93EOF
94
95}
96
97openocdrules () {
98
99 echo ""
100 echo "# Adding Arduino M0/M0 Pro, Primo UDEV Rules for CMSIS-DAP port"
101 echo ""
102
103cat <<EOF
104ACTION!="add|change", GOTO="openocd\_rules\_end"
105SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd\_rules\_end"
106
107#Please keep this list sorted by VID:PID
108
109#CMSIS-DAP compatible adapters
110ATTRS{product}=="\*CMSIS-DAP\*", MODE="664", GROUP="plugdev"
111
112LABEL="openocd\_rules\_end"
113EOF
114
115}
116
117avrisprules () {
118
119 echo ""
120 echo "# Adding AVRisp UDEV rules"
121 echo ""
122
123cat <<EOF
124SUBSYSTEM!="usb\_device", ACTION!="add", GOTO="avrisp\_end"
125\# Atmel Corp. JTAG ICE mkII
126ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2103", MODE="660", GROUP="dialout"
127\# Atmel Corp. AVRISP mkII
128ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2104", MODE="660", GROUP="dialout"
129\# Atmel Corp. Dragon
130ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE="660", GROUP="dialout"
131
132LABEL="avrisp\_end"
133EOF
134
135}
136
137dfustm32rules () {
138
139 echo ""
140 echo "# Adding STM32 bootloader mode UDEV rules"
141 echo ""
142
143cat <<EOF
144\# Example udev rules (usually placed in /etc/udev/rules.d)
145\# Makes STM32 DfuSe device writeable for the "plugdev" group
146
147ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="664", GROUP="plugdev", TAG+="uaccess"
148EOF
149
150}
151
152dfuarduino101rules (){
153
154 echo ""
155 echo "# Arduino 101 in DFU Mode"
156 echo ""
157
158cat <<EOF
159SUBSYSTEM=="tty", ENV{ID\_REVISION}=="8087", ENV{ID\_MODEL\_ID}=="0ab6", MODE="0666", ENV{ID\_MM\_DEVICE\_IGNORE}="1", ENV{ID\_MM\_CANDIDATE}="0"
160SUBSYSTEM=="usb", ATTR{idVendor}=="8087", ATTR{idProduct}=="0aba", MODE="0666", ENV{ID\_MM\_DEVICE\_IGNORE}="1"
161EOF
162
163}
164
165removemm () {
166
167 echo ""
168 echo "\*\*\*\*\*\*\* Removing modem manager \*\*\*\*\*\*\*"
169 echo ""
170
171 if \[ -f /etc/lsb-release -a ! -f /etc/SuSE-release \] || \[ -f /etc/debian\_version \] || \[ -f /etc/linuxmint/info \]
172 then
173 #Only for Ubuntu/Mint/Debian
174 sudo apt-get -y remove modemmanager
175 elif \[ -f /etc/SuSE-release \]
176 then
177 #Only for Suse
178 sudo zypper remove modemmanager
179 elif \[ -f /etc/fedora-release \] || \[ -f /etc/redhat-release \]
180 then
181 #Only for Red Hat/Fedora/CentOS
182 sudo yum remove modemmanager
183 else
184 echo ""
185 echo "Your system is not supported, please take care of it with your package manager"
186 echo ""
187 fi
188
189}
190
191
192if \[ "$1" = "" \]
193then
194 echo ""
195 echo "Run the script with command ./arduino-linux-setup.sh \\$USER"
196 echo ""
197else
198
199 \[ \`whoami\` != $1 \] && echo "" && echo "The user name is not the right one, please double-check it !" && echo "" && exit 1
200
201 groupsfunc $1
202
203 removemm
204
205 acmrules $1 > /tmp/90-extraacl.rules
206
207 openocdrules > /tmp/98-openocd.rules
208
209 avrisprules > /tmp/avrisp.rules
210
211 dfustm32rules > /tmp/40-dfuse.rules
212
213 dfuarduino101rules > /tmp/99-arduino-101.rules
214
215 sudo mv /tmp/\*.rules /etc/udev/rules.d/
216
217 refreshudev
218
219 echo ""
220 echo "\*\*\*\*\*\*\*\*\*\*\* Please Reboot your system \*\*\*\*\*\*\*\*\*\*\*\*"
221 echo ""
222fi

Contribute to Arduino

Join the community and suggest improvements to this article via GitHub. Make sure to read out contribution policy before making your pull request.

Missing something?

Check out our store and get what you need to follow this tutorial.

Suggest Changes

The content on docs.arduino.cc is facilitated through a public GitHub repository. You can read more on how to contribute in the contribution policy.