Lesson 2
18 min
Voltage, current, resistance and Ohm's law: the basics to understand a circuit.
Definition
An electric current is an orderly movement of electric charges (electrons) through a conducting material. It is described by three related quantities: voltage (in volts),current (in amperes) and resistance(in ohms). The relationship that links them, Ohm's law, lets you calculate any one of them from the other two and size a circuit correctly.
Before connecting an LED or a sensor, you need to understand what happens inside a circuit. Without these basics, you wire things at random, you risk damaging components and, above all, you can't tell why a circuit doesn't work. Don't worry: the notions you need come down to a few simple ideas, which you will use in every lesson that follows.
An electric current is a movement of charges (electrons) through a conducting material, such as a copper wire. For it to flow, you need aclosed circuit: a continuous path that starts at the power source, passes through the components, then returns to the source. If the circuit is open (a disconnected wire, an open switch), nothing flows.
A switch is nothing more than a way to open or close the circuit at will. When you press a push button, you briefly close the circuit: current flows, and your Arduino board can detect that event.

Not all materials let current through in the same way. They fall into two main families:
That is why electrical wires are made of copper on the inside (to conduct) and plastic on the outside (to insulate and prevent accidental contact).
To understand electronics, you can compare a circuit to a water system: voltage is the pressure, current is the flow rate, and resistance is a narrowing of the pipe.
In the water analogy, a tank placed up high creates strong pressure (high voltage). If the pipe is wide, a lot of water flows out (high current). If you pinch it (high resistance), the flow decreases, even though the pressure stays the same. This is exactly what happens in an electrical wire.

In electronics, values are often very small or very large. We therefore use prefixes to avoid writing too many zeros:
So the 10-kilohm resistor in your kit is worth 10,000 ohms, and a current of 20 mA is 0.02 A. Remember to convert before doing a calculation.
These three quantities are linked by Ohm's law, the most important formula in basic electronics:
U = R × I
U: voltage in volts (V)
R: resistance in ohms (Ω)
I: current in amperes (A)
So: I = U / R and R = U / IExample: a 220-ohm resistor subjected to a voltage of 5 V carries a current I = 5 / 220, which is approximately 0.023 A, or 23 mA.
Just identify what you are looking for and what you already know. If you know two quantities, you can always calculate the third:
I = U / R.R = U / I.U = R × I.An LED can only withstand a limited current, on the order of 20 mA. Without a resistor, it would receive too much current and burn out. A red LED "uses up" about 2 V across its terminals, so 5 − 2 = 3 V remain to be absorbed by the resistor. With a 220-ohm resistor, Ohm's law givesI = 3 / 220, or about 0.014 A, i.e. 14 mA: the LED shines brightly, with no risk. That is why you will use 220-ohm resistors in the upcoming circuits.
By convention, current flows from the positive (+) terminal to the negative (−) terminal. On an Arduino board, the positive terminal is called 5V and the negative oneGND ("ground"). Every circuit will need a component connected to GND to close the circuit.
On your board, you will find the 5V andGND pins in the power header. Some components, such as LEDs, only work in one orientation: an LED connected backwards won't light up. Such components are called polarized.
Two worked examples. In series, a 220-ohm resistor followed by a 330-ohm one is equivalent to a single resistor of 220 + 330 = 550 ohms. In parallel, two identical 220-ohm resistors share the current and are equivalent to a 110-ohm resistor: the more paths there are, the more easily current flows.

The short circuit
Connecting + directly to − with no component in between is ashort circuit: the resistance is almost zero, the current becomes huge, and you risk damaging your board. A component must always limit the current.
GND, no current flows and nothing lights up.U = R × I.5V) to− (GND).Exercise