Getting started with Arduino Zero
Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language and the Arduino Software (IDE).
Over the years Arduino has been the brain of thousands of projects, from everyday objects to complex scientific instruments. A worldwide community of makers - students, hobbyists, artists, programmers, and professionals - has gathered around this open-source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike.
The Zero is a simple and powerful 32-bit extension of the platform established by the UNO. The Zero board expands the family by providing increased performance, enabling a variety of project opportunities for devices, and acts as a great educational tool for learning about 32-bit application development. The Zero applications span from smart IoT devices, wearable technology, high-tech automation, to crazy robotics.
Components
1x Arduino Zero (or compatible Arduino module)
| |
Arduino IDE |
Arduino Zero specification
Microcontroller | ATSAMD21G18, 32-Bit ARM® Cortex® M0+ |
---|---|
Operating Voltage | 3.3V |
Flash Memory | 256 KB |
SRAM | 32 KB |
Clock Speed | 48 MHz |
Analog IN Pins | 6, 12-bit ADC channels |
Analog OUT Pins | 1, 10-bit DAC |
DC Current | 7 mA |
Digital I/O Pins | 20 (of which 11 provide PWM output) |
PCB Size | 68x53mm |
Weight | 12g |
Arduino Zero pinout
The board contains everything needed to support the microcontroller; simply connect it to a computer with a micro-USB cable or power it with a AC-to-DC adapter or battery to get started. The Zero is compatible with all the shields that work at 3.3V and are compliant with the 1.0 Arduino pinout.
Warning: Unlike most Arduino boards, the Zero runs at 3.3V. The maximum voltage that the I/O pins can tolerate is 3.3V. Applying voltages higher than 3.3V to any I/O pin could damage the board.
Each of the 20 general purpose I/O pins on the Zero can be used for digital input or digital output using pinMode(), digitalWrite(), and digitalRead() functions. Pins that can be used for PWM output are: 3, 4, 5, 6, 8, 9, 10, 11, 12, 13 using analogWrite() function. All pins operate at 3.3 volts. Each pin can source or sink a maximum of 7 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the Serial1 class. The native usb port instead responds to the SerialUSB class
External Interrupts: available on all the pins except pin 4.
DAC: A0. Provide a 10bit voltage output with the analogWrite() function.
PWM: 3, 4, 5, 6, 8, 9, 10, 11, 12, 13. Provide 8-bit PWM output with the analogWrite() function.
SPI: SS, MOSI, MISO, SCK. Located on the ICSP header only support SPI communication using the SPI library.
TWI: SDA pin and SCL pin. Support TWI communication using the Wire library.
LED: 13. There is a built-in LED driven by digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
Six of the 20 general purpose I/O pins on the Zero board provide analog input. These are labeled A0 through A5, and each provide up to 12bits of resolution (i.e. 4096 different values). By default they measure from ground to 3.3 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller.
Arduino IDE
The open-source Arduino Software (IDE) allows you to write programs and upload them to your board. This software can be used with any Arduino board and it's compatible with most operating systems. It is available for downloading on the official Arduino website.
As you can see, the interface is very simple and easy to use. The most used buttons are available on the top (from left to right):
Verify: verify your sketch for errors and try to compile it
Upload: verify, compile and upload the sketch to the Arduino board
New: create a new sketch
Open: open already existing sketch
Save: save open sketch
Serial Monitor: I/O interface to communicate with the board
Arduino sketch
A sketch is a program written with the Arduino IDE. Sketches are saved on the development computer as text files with the file extension .ino.
A minimal Arduino C/C++ program consists of only two functions:
setup(): This function is called once when a sketch starts after power-up or reset. It is used to initialize variables, input and output pin modes, and other libraries needed in the sketch.
loop(): After setup() function exits/ends, the loop() function is executed repeatedly in the main program. It controls the board until the board is powered off or is reset.
Conclusion
Thanks to its simple and accessible user experience, Arduino has been used in thousands of different projects and applications. The Arduino software is easy-to-use for beginners, yet flexible enough for advanced users. It runs on Mac, Windows and Linux. Feel free to choose the board that better fits your project needs.
0 Comments