Getting started with Arduino – L1


In my previous post – getting started with arduino L0 we have set up the arduino board to communicate with our PC and we also uploaded a very simple sketch on the board.
Today I’ll go through the first project of the Arduino projects book. We’ll start understanding the basics of electricity, how to build a simple circuit with some basic components, and the difference between series and parallel circuit.

1.Introduction to Electricity

Electricity is a type of energy, much like heat, gravity, or light. Electrical energy flows through conductors, like wires. You can convert electrical energy into other forms of energy to do something interesting, such as turning on a light or making some noise out of a speaker.

Transducers are components that transform other forms of energy into electricity and vice versa.

Sensor – transducer that transforms other form of energy in electricity;
Actuators – transducer that transforms electricity in other forms of energy;
Circuits – closed loop of wires with a power source and a load.

2.How a circuit works

In a closed loop of wires (a circuit), the electricity given by a power supply (e.g. a battery) flows from a point of higher potential energy to a point of lower potential energy. The electricity can flow in one direction or can change. If it flows only in one direction we call it Direct Current (DC). On the contrary, if the direction of the current changes it is called Alternating Current (AC). AC current is the type of electricity that comes from a wall socket.

Current (A) – amount of electrical charge flowing past a specific point in your circuit;

Voltage (V) – difference in energy between one point and another;

Resistance (Ω)how much a component resists the flow of electrical energy.

Remember that to make a circuit working you need a complete path from the energy source to the point of least energy, otherwise it won’t work.

3.The breadboard

The breadboard is a fundamental tool to prototype electrical circuits. It is used, together with wires, to create connections and circuits without soldering. The horizontal and vertical rows of the breadboard carry electricity through thin metal connectors under the plastic with holes.
Schematic design of a breadboard

Breadboard scheme

4.How a circuit looks like

From now on, we are going to see how to assemble different circuits to create our projects. I am going to show you pictures of the assembled circuits and next to them how the schematic draw is.
Design of a simple circuit connected to the Arduino board

What a simple circuit looks like


Schematic drawing of the same simple circuit

Schematic drawing of the same circuit

5.First components

There are countless components you can use in a circuit. Here I am going to introduce you three very simple components that you will use to create your first circuit.
Led – Light Emitting Diode, this component converts electrical energy into light. These are polarized component, which means that energy can flow through them only in one direction. A led has two legs of different lenght: the long one (anode) will connect to the power and the short one (cathode) will connect to the ground.
Resistor – this component converts part of the electrical energy into heat. So if you put it in series with another component, the resistor will use some of the electrical energy and the other component will receive less energy as a result. This way you can supply your component with the amount of energy they need.
Switch – this component interrupts the flow of electricity , by breaking the circuit when it is open. When it is closed the circuit is completed.

6.Building your first circuit

In this project we are going to use Arduino board only as a power source: when plugged into a USB port, Arduino will provide 5 volts between its 5V pin and its ground pin.

a) First of all check that your Arduino board is not connected to a power source before starting building the circuit.

b) Then connect a red wire to the 5V pin and put the other end in one of the long bus lines in your breadboard. Then connect a black wire to the ground on Arduino and to the adjacent bus line.

c) The board have power now. Next step is to place the switch across the center of the breadboard.
d)Use a 220-ohm resistor to connect power to one side of the switch. On the other side of the switch connect the anode (long leg) of the LED. With a wire, connect the cathode (short leg) to the ground.


The circuit is ready! Now you can plug the USB cable into your Arduino board and turn the LED on and off by pressing the switch.

photo of the circuit   

By pressing the switch and closing the circuit you will see the led turning on.

You can assemble two main types of circuits:

Series circuit
– where the components come one after another;
Parallel circuit – where components run side by side.

7.Series circuit

Components in series come one after another
Since the components are in series, you need to close both the switches in order to complete the circuit.

8.Parallel circuit

Components in parallel run side by side
Now the components are in parallel, when you press either button the light turns on.

These were the basics of electricity, in the next lesson we are going to run the first program to let our Arduino control things!!!