"Arduino is an open-source electronics platform based on easy-to-use hardware and software"
The Arduino is a great platform for experimenting with computer based electronics. An Arduino is a low cost microcontroller based boards, that can be programmed in a C style language, using a free programming environment that runs on a PC, Mac or Linux system.
After downloading the program via a USB link, the Arduino can be disconnected from the PC and run as a stand alone system.
Arduino boards have a large number of I/O pins that can be used for digital or analogue input and output. These can be used to connect to a large variety of sensors, displays and actuators for building projects that interact with the real world.
There are a whole family of Arduino boards, with different capabilities. The Arduino UNO is the most commonly used.
Arduino boards are based on the ATmega series of microcontroller chips.
ATmega chips are low cost microprocessors with on chip memory and IO capabilities. Since everything is built in to the chip, very little additional hardware is required to create a working computer system. The Arduino UNO board holds a crystal oscillator to provide the system clock, a power regulator to provide the 5V the chip needs, and some serial interface circuitry to allow it to be programmed over a USB connector.
The chip contains three types of memory - flash memory that holds the program code, sram that provides the working memory to store program variables etc, and eeprom which is non-volatile and can be used to store values that need if the board is powered off.
The Arduino comes with a free, open source IDE that allows you to program the board. Arduino programs are called sketches, but the used language that is very similar to C.
The IDE compiles the sketch to machine code that can run on the Arduino.
The Arduino board comes pre-programmed with a bootloader, that has already been stored in the flash memory of the ATmega chip. After compiling a sketch you can download it to the Arduino. To do this, the IDE communicates with the bootloader to send the code to the Arduino over the USB cable. The program is stored in the flash memory, which is non-volatile (similar to a memory stick), so the program will still be there even if you switch the Arduino off than back on again.
Once you have downloaded your program, you can disconnect the Arduino from the PC and use it as a stand alone device.
There are several variants of the Arduino, the main ones being:
There are many other less commonly used variants, including a few with more powerful processors, or with built in features like Wifi or Bluetooth.
All Arduinos have a set of IO pins. There are 4 modes:
Most Arduino boards use 8 bit microcontrollers clocked at 16MHz.
The UNO has 32KB of flash memory, 2KB of RAM and 1KB of EEPROM, other variants have a little more. The amount of memory cannot be increased - unlike a typical CPU, a microcontroller chip can't access external memory.
Clearly an Arduino doesn't compare with, for example, a Raspberry Pi in terms of computing power. But that is because they are very different things. A Pi is a general purpose Linux computer that can be used as a desktop PC, that just happens to be built quite cheaply on a small board.
A microcontroller is very cheap (a clone UNO is a tenth of the price of a Pi), consumes very little power (a Nano can run for a long time on batteries), and is very easy to program down to the bare metal. For example, you can set up an interrupt on an Arduino that will happens immediately one of the input pins is set. You could do some processing (checking some other inputs, doing a simple calculation, and setting some outputs in response) and the whole thing would be done within a few microseconds of the interrupt pin being set. And it would only take a few lines of simple code.
The equivalent thing on a Pi might take many milliseconds, or even seconds, because Linux might be busy doing something else at the time. You could speed it up by writing a driver, but that really is quite specialised and difficult coding and even that would not be as fast as the Arduino.
A shield (similar to a Raspberry Pi hat) is an extra board that plugs in on top of an Arduino to give extra capabilties. Common hats are aviable to add USB, Wifi, SD card interface, relay or motor control, etc.
Most Arduinos can be powered via their USB port.
The UNO, Mega and Leonardo boards also have a power jack, and can be powered by a 7V to 12V (such as a mains adapter or battery). The smaller boards don't include a power jack but most can still be powered by a 7-12V source.
Copyright (c) Axlesoft Ltd 2020