Arduino is an open source electronics prototyping platform, and it’s one of the most popular in the world — with the possible exception of the Raspberry Pi. With over 3 million units sold (and more as third party clone devices): what makes it so good and what can be done with it?
What is Arduino?
Arduino is based on easy to use, flexible hardware and software. It is designed for artists, designers, engineers, hobbyists and anyone interested in programmable electronics.

The Arduino senses its environment by reading data from various buttons, components, and sensors. They can influence the environment by driving LEDs, motors, servos, relays, and more.
Arduino projects can be standalone or interact with software running on a computer (processing is the most popular for this). They can communicate with other Arduinos, Raspberry Pis, NodeMCUs. or almost everything else. Be sure to read our comparison of microcontrollers costing 5 for a detailed comparison of the differences between these microcontrollers.
Why choose Arduino, you may ask? Arduino really simplifies the process of creating a programmable electronics project, making it a great platform for beginners. You can easily start working on one with no previous experience with electronics. There are thousands of tutorials, and they come in varying levels of difficulty, so you can be sure you’ll get the job done once you’ve mastered the basics.
In addition to the simplicity of Arduino, it’s also inexpensive, cross-platform, and open source. Arduino Uno (the most popular model) is based on Atmel ATMEGA 16U2 microcontrollers. There are many different models available that vary in size, power and specifications, so take a look at our buying guide to purchase for all differences.
The plans for the boards are published under a Creative Commons license, so experienced hobbyists and other manufacturers are free to create their own version of the Arduino, potentially extending it and improving it (or simply copying it directly, resulting in a low cost distribution). Arduino boards we find today).
What can you do with Arduino?
Arduino can do a staggering amount of things. They are the perfect choice for most 3D printers. Their low cost and ease of use mean that thousands of manufacturers, designers, hackers and creators have made amazing designs. Here are just some of the Arduino projects we’ve done here at:
- Custom shortcut buttons
- Electronic Cup D20
- laser tower
- Midi Controller
- Retro games with OLED display
- traffic light controller
What’s inside the Arduino?
While there are many different types of Arduino boards, this guide focuses on the Arduino board. Arduino Uno . This is the most popular Arduino board. So what makes this thing tick? Here are the specifications:
- CPU: 16MHz ATmega16U2
- Flash memory: 32 KB
- Ram: 2 KB
- Operating voltage: 5 V
- Input voltage: 7-12V
- Number of analog inputs: 6
- Number of digital inputs / outputs: 14 (of which 6 with pulse-width modulation — PWM )
The specs may seem like garbage compared to your desktop computer, but remember that the Arduino is an embedded device and requires much less information to process than your desktop computer. It’s more than capable for most electronics projects.
Another great feature of Arduino is the ability to use so-called «shields» or add-ons. Although shields won’t be covered in this tutorial, they are a really neat way to extend the power and functionality of your Arduino. .
What you need for this guide
Below you will find a shopping list of the ingredients you will need for this beginner’s guide. All of these components should cost less than $50. This list should be enough to give you a good understanding of the basics of electronics and have enough components to create some pretty interesting projects using this or any other Arduino guide. If you don’t want to choose every component, you can consider purchasing a starter kit in a starter kit instead of this.
- 1 x Arduino Uno
- 1 x USB AB cable (same as your printer)
- 1 x breadboard
- 2 x LEDs
- 1 x photo resistor
- 1 x tactile switch
- 1 x piezo speaker
- 1 x 220 ohm resistor
- 1 x 10 kΩ resistor
- 1 x 1 kΩ resistor
- 1 x jumper wire set
If you can’t get a specific resistor value, something as close as possible will usually do.
Overview of electrical components
Let’s take a look at exactly what all these components are, what they do, and what they look like.
mock up
Used to prototype electronic circuits, they provide a temporary means of connecting components together. Breadboards are plastic blocks with holes into which wires can be inserted. The holes are arranged in rows of five. If you want to change the circuit diagram, pull the wire or part out of the hole and move it. Many breadboards have two or four sets of holes running the length of the board along the sides, all of which are connected — these are usually for power distribution and can be marked with a red and blue line.

Breadboards are great for quick circuit production. They can get very dirty for a big chain, and cheaper models can be unreliable, so a good one is worth spending a little more money on.
LEDs
LED stands for light emitting diode . They are a very cheap source of light and can be very bright, especially when grouped together. They can be purchased in a variety of colors, are not very hot and last a long time. You may have LEDs on your TV, car dashboard, or Philips Hue lights.

Your Arduino microcontroller also has a built-in LED on pin 13, which is often used to indicate an action or event, or just for testing purposes.
photo resistor
photoresistor ( photocell or light dependent resistor ) allows your Arduino to measure light changes. You can use this to turn on your computer during the daytime, for example.

Tactile switch
A tactile switch is basically a button. Pressing it will complete the circuit and (usually) change from 0V to +5V. Arduinos can detect this change and respond accordingly. They often short-term — this means that they are «pressed» only when they are held by a finger. After you release, they will return to their default state (not pressed or off).

Piezo speaker
A piezo speaker is a tiny speaker that makes sound from electrical signals. They are often harsh and tinny, and sound nothing like a real speaker. However, they are very cheap and easy to program. Our Buzz Wire game uses one of these to play the theme of Monty Python’s «Flying Circus».

resistor
The resistor limits the flow of electricity. These are very cheap components and also one of the main components of amateur and professional electronic circuits. They are almost always needed to protect components from overload. They are also needed to prevent a short circuit if the Arduino +5V is connected directly to ground. In short: very convenient and absolutely necessary.

Wire jumpers
Jumpers are used to create temporary connections between components on a breadboard.

Setting up your Arduino
Before starting any project, you need your Arduino to talk to your computer. This allows you to write and compile code to run the Arduino, and allows your Arduino to work with your computer.
Installing the Arduino software package on Windows
Go to the Arduino website and download the Arduino software version suitable for your version of Windows. Once downloaded, follow the installation instructions integrated environment Arduino development (IDE).

The installation includes the drivers, so in theory, you should be good to go right away. If for some reason this doesn’t work, try the following steps to manually install the drivers:
- Connect your board and wait while Windows starts the driver installation process. After a few seconds, the process will fail despite best efforts.
- Click Start Menu > Control Panel .
- Switch to System and Security > System . When the system window opens, open device Manager .
- In chapter Ports (COM and LPT) you should see an open port named Arduino UNO (COMxx) .
- Right click Arduino UNO (COMxx) > Update driver software .
- Select » Browse my computer» for driver software .
- Find and select the Uno driver file named ArduinoUNO.inf located in the folder Drivers Arduino Software Downloads.

Windows will complete the driver installation from there.
Installing the Arduino software package on Mac OS
Download the Arduino software for Mac from the Arduino website. Extract the contents of the file .zip and run the application. You can copy it to your applications folder, but it will work just fine from your desktop or load folders. You do not need to install any additional drivers for the Arduino UNO.

Installing the Arduino software in an Ubuntu/Linux package
Install gcc-avr and avr-libc :
sudo apt-get install gcc-avr avr-libc
If you don’t already have openjdk-6-jre, install and configure it too:
sudo apt-get install openjdk-6-jre sudo update-alternatives --config java
Choose the right one jre, if you have more than one installed.
Go to the Arduino website and download the Arduino software for Linux. You can unpack and run it with the following command:
tar xzvf arduino-xxx-linux64.tgz
cd arduino-1.0.1
./arduino
Regardless of which operating system you are using, the instructions above assume you have an original branded Arduino Uno board. If you purchased a clone, you will almost certainly need 3rd party drivers before the board is recognized by USB.
Launching the Arduino Software
Now that the software is installed and your Arduino is set up, let’s check that everything works. The easiest way to do this is to use the «Blink» sample application.
Open the Arduino software by double-clicking the Arduino application ( ./arduino on Linux ). Make sure the board is connected to your computer and open the example sketch flicker LED : File > Examples > 1. Basics > flicker . You should see the code for the open application:

To upload this code to the Arduino, select the entry in the menu » Tools» > » Board» corresponding to your model — in this case Arduino Uno .

Select your board’s serial device from the menu Tools > Serial port . On Windows it might be COM3 or higher. On Mac or Linux it should be something with /dev/tty.usbmodem .

Finally click the button Download in the top left corner of your environment. Wait a few seconds and you will see that the LEDs RX and TX blinking on the Arduino. If the download was successful, the status bar will display «Done».
A few seconds after the download is complete, you will see the LED on contact 13 on the board will flash. Congratulations! You have an Arduino up and running.
Starting projects
Now that you know the basics, let’s take a look at some projects for beginners.
Flash LED
Previously, you used the Arduino sample code to blink the built-in LED. This project will flash an external LED using a breadboard. Here is the diagram:

Connect the long leg of the LED (positive leg, called anode ) to resistor 220 ohm, and then to digital conclusion 7 . Connect the short branch (negative, called cathode ) directly to earth (any of the Arduino ports with GND on it, your choice). This is a simple circuit. The Arduino can digitally control this pin. When the pin is turned on, the LED will light up, and when it is turned off, the LED will turn off. The resistor is needed to protect the LED from too much current — without it, it will burn out.
Here is the code you need:
void setup() { // put your setup code here, to run once: pinMode(7, OUTPUT); // configure the pin as an output } void loop() { // put your main code here, to run repeatedly: digitalWrite(7, HIGH); // turn LED on delay(1000); // wait 1 second digitalWrite(7, LOW); // turn LED off delay(1000); // wait one second }
This code does several things:
void setup(): The Arduino is started once every time it is started. Here you can set up variables and everything you need to run your Arduino.
pinMode(7, OUTPUT): tells the Arduino to use this pin as an output, without this line the Arduino won’t know what to do with each pin. This only needs to be set up once per contact, and you only need to set up the contacts you intend to use.
void loop(): any code inside this loop repeatedly runs over and over again until the Arduino is turned off. This can make larger projects more complex, but it works great for simple projects.
digitalWrite(7, HIGH): used to set output HIGH or LOW — ON or OFF . Just like a light switch, when the pin is HIGH, the LED will be on. When the pin is LOW, the LED is off. Inside the parentheses, additional information must be provided for proper operation. Additional information is called parameters or arguments.
The first (7) is the pin number. For example, if you connected your LED to a different pin, you would change it from seven to a different number. The second parameter should be HIGH or LOW which specifies whether the LED should be on or off.
delay(1000): The Arduino says to wait a certain amount of time in milliseconds. 1000 milliseconds equals one second, so the Arduino will wait one second.
As soon as the LED turns on for one second, the Arduino runs the same code, only it continues to turn off the LED and wait another second. After this process is completed, the cycle starts again and the LED turns on again.
A task: Try adjusting the delay between turning on and off the LED. What are you observing? What happens if you set the delay to a very small number, like one or two? Can you change the code and scheme to flash two LED?
Adding a button
Now that you have your LED working, let’s add a button to your circuit:

Connect the button so that it connects the channel in the center of the layout. Connect top right foot to contact 4 . Connect lower right leg to the resistor ten ohm and then to earth . Connect bottom left foot to 5V .
You may be wondering why a simple button needs a resistor. This serves two purposes. it lowering resistor — it connects the contact to the ground. This ensures that spurious values are not detected and prevents the Arduino from think that you pressed the button when you didn’t. The second purpose of this resistor is current limiting. Without it, 5V will go straight to the ground, magic smoke will be released and your Arduino will die. This is called a short circuit, so using a resistor prevents this.
When the button is not pressed, the Arduino detects ground ( pin 4 > resistor > Earth ). When you press the button, 5V is connected to ground. Pin 4 of the Arduino can detect this change, since pin 4 has now changed from ground to 5V;
Here is the code:
boolean buttonOn = false; // store the button state void setup() { // put your setup code here, to run once: pinMode(7, OUTPUT); // configure the LED as an output pinMode(4, INPUT); // configure the button as an input } void loop() { // put your main code here, to run repeatedly: if(digitalRead(4)) { delay(25); if(digitalRead(4)) { // if button was pressed (and was not a spurious signal) if(buttonOn) // toggle button state buttonOn = false; else buttonOn = true; delay(500); // wait 0.5s -- don't run the code multiple times } } if(buttonOn) digitalWrite(7, LOW); // turn LED off else digitalWrite(7, HIGH); // turn LED on }
This code is based on what you learned in the previous section. The hardware button you are using is instant action. This means that it will only work when you hold it down. Alternative — snap-on action. It’s just like your light switch or socket, press once to turn on, press again to turn off. Fortunately, the blocking behavior can be implemented in code. Here’s what the additional code does:
boolean buttonOn = false: this variable is used to store the state of the button — ON or OFF, HIGH or LOW. The default value is false.
pinMode(4, INPUT): same as as the code used for the LED, this line tells the Arduino that you have connected the input (your button) to pin 4.
if(digitalRead(4)): likewise digitalWrite() , digitalRead() used to read the state of the output. You need to provide him with a pin code (4, for your button).
After you have pressed the button, the Arduino waits 25ms and checks the button again. This is known as software failure . This ensures that what the Arduino thinks was a button press, really button press, not noise. You don’t have to do this, and in most cases you’ll be fine without it. It’s more of a best practice.
If the Arduino is sure that you actually pressed the button, it will change the value of the variable buttonOn . This toggles the state:
ButtonOn is true: set to false.
ButtonOn is false: set to true.
Finally, the LED turns off according to the state stored in buttonOn .
light sensor
Let’s move on to the advanced project. This project will use light dependent resistor (LDR) to measure the amount of available light. The Arduino will give your computer useful messages about the current light level.