- Set some basic ideas on electronics.
- Assemble a prototype with a LED and a resistor and understand the circuit schematic diagram.
- Learn how to work with the solderless breadboard.
- Upload the blinking LED program to the Arduino
BILL OF MATERIALS
Arduino Uno or equivalent. We can use any other Arduino board in this chapter.
We will also need a PC computer with the Arduino IDE properly installed and set up.
A LED diode
A 330 Ohm resistor
Some jumper wires.
SOME BASIC IDEAS ON ELECTRONICS
If we let water flow from a high place to a lower one, it runs freely, always from top to bottom, unless we prevent it. This difference in height creates a difference in potential between these two points that can be transformed into useful work.
When there is a difference in voltage (or difference in potential) between two connected points, electricity flows from the most positive (which has more electrical charge) to the less positive or negative, being able to get some useful work.
Although the physics behind this two examples is different, they are quite similar in meaning so we can draw the following analogy:
- Water stream / Electric stream
- Water flow / electric current
- Resistance to flow / electric resistance
- Capacity of a water reservoir/ Capacity of a capacitor
The main idea is that electric current flows from positive to negative because there is a difference in voltage. Volt is the unit we use to measure voltage and its electrical symbol is V. Voltage is not an absolute measure but the difference in potential between the points.
- In the same way, the difference in height between two points does only mean that, just a difference, and does not show at which height are located with respect to a more or less arbitrary reference.
There are electronic components that oppose the passage of an electric current. We call them resistors. Ohm is the unit we use to measure electrical resistance and its symbol is the Greek letter omega, Ω.
The Ohm’s law, binds it all together in an accurate way:
V = IR
V is the voltage in volts, I the current intensity and R is the resistance.
- In the world of Arduino, voltage is almost always 5 V, which is its operation voltage and the value that Arduino is able to set as a digital output.
This is another way to write Ohm’s law:
I = V / R
This formula means that if the resistance across the circuit is null (or almost, as in the case of a copper wire) the current intensity grows enormously and can even melt the wire or device it come across.
- This is known as short circuit and must be firmly avoided otherwise it all will end with a burning smell and a shock, at best.
OUR FIRST ELECTRONIC CIRCUIT
In the previous chapter we programmed the on-board status LED connected to the pin 13 of our Arduino. Today we will duplicate this circuit in the breadboard using discrete devices from the beginning. This is the simplified circuit schematic diagram:
On the left we can see the schematic symbol of a LED diode, which is an electronic component that emits light, hence these outgoing arrows that represent the emitted light (LED stands for Light Emitting Diode).
The resistor is represented by the second schematic symbol. Below we can see its name labelled as R1, Resistor 1, and its value, 330Ω.
On the left we can see the word GND to indicate that this is the negative end. It has many names: mass, the symbol -, earth (although it is not the same), ground, negative, cathode.
Finally, on the right, the + 5V symbol indicates the positive end or positive and it is sometimes represented as Vcc. The straight black lines indicate electrical connection using lead wires.
- A diode, is an electronic device that let the electric current flow only in one way, from positive or anode (the wider part of the triangle) to negative or cathode (the tip of the triangle that sets the direction of the electric current)..
- The biggest lead of a LED diode is the positive lead or anode.
- The smallest lead of a LED diode is the negative lead or cathode
- If the diode is connected the other way round will cut the electric current very efficiently and won’t light at all.
- Resistors, however, don’t differentiate between both ends. We say that they don’t have polarity.
It is important to understand circuit schematic diagrams because they allow us understand quickly any circuit. It does worth the while devoting them a little effort because they are the language of electronics.
Once the circuit schematic diagram has been understood let’s see how to assemble it on the breadboard:
In the wiring diagram we have followed the standard norm of using red wires for positive voltages and black wires for negative voltages.
We strongly recommend you to follow this norm in practice because it helps to identify potential problems and avoid mistakes.
The picture above shows a solderless breadboard. Let’s stop for a while and explain how does it work.
The layout of a typical solderless breadboard consists of two types of areas: the bus strip and the terminal strip. These strips are just a set of interconnected electrical terminals. These terminals are called tie points or contact points. Let’s see these strips in depth.
- The bus strip = is a horizontal strip that runs along the breadboard and it is used to provide power to the electronic components. A bus strip usually contains two rows of electrical terminals: one for ground and one for a supply voltage. Typically the row intended for a supply voltage is marked in red, while the row for ground is marked in blue or black. Normally all the electric terminals in the row are interconnected, but each row is isolated from the other, otherwise we would have a short circuit.
- The terminal strip = consist of two areas of multiple columns divided by a notch. The electric terminals of each column are interconnected, but the columns are isolated between them. This is the main area of the breadboard and it is used to hold the electronic components. The five rows on the left of the notch are often marked as A, B, C, D, and E, while the ones on the right are marked F, G, H, I and J.
These are the keys to successfully assemble the prototype:
- Wire the pin 13 of Arduino to the red bus strip of the breadboard: the positive row.
- Wire the pin GND of Arduino to the blue bus strip of the breadboard: the ground row.
- We use the positive bus strip (the tie points or contact points of the red bus strip) to wire the resistor.
- The other end of the resistor is wired to the positive terminal of the LED diode because both are connected to the same row of the terminal strip (so they are electrically connected).
- Note that we can differentiate the positive terminal of the LED diode because it is clearly marked by a small angle near the base..
- A LED diode oppose almost no resistance to current intensity, so we must ever use an additional resistor to limit the current intensity and prevent it from burning. Normally we use a resistor between 220 Ω and 330 Ω.
- We close the circuit by connecting a wire from the negative terminal of the LED diode to the negative bus strip, GND.
- When our program sets pin 13 to a HIGH value (+5V) it will allow the current intensity flow across the circuit turning on the LED diode. If the pin 13 is set to a LOW value, the circuit will be open, without voltage.
We can now upload the program we did in the second chapter (or just upload the blinking LED sample), following the same steps, but this time we will see how, besides the own Arduino on-board status LED, our external LED blinks at the same on and off rate.
In this chapter we have learnt some important things:
- We have seen some basic concepts on electronics: Ohm’s law, that binds together voltage, current intensity and resistance.
- We have identified two basic electronic components: resistors and diodes.
- We have learnt to decipher the first circuit schematic diagram.
- We have assembled our first prototype using these electronic components