Before starting Arduino and IoT, it is important to understand some basic electronics concepts. These concepts will help you understand how Arduino boards, sensors, LEDs, motors, relays, batteries, and other electronic components work.
In this tutorial, we will learn:
- Voltage
- Current
- Resistance
- Power
- DC and AC
- Ground (GND)
- 3.3V and 5V
- Ohm's Law
- Series and Parallel Circuits
- Short Circuit
- Polarity
1. What is Voltage?
Voltage is the electrical potential difference that provides the push needed for electric current to flow through a circuit.
Voltage is measured in Volts (V).
A simple way to understand voltage is to compare electricity with water.
Imagine a water pipe. Water pressure pushes water through the pipe. Similarly, voltage provides the electrical push that allows current to flow through a circuit.
Voltage = Electrical pressure
Examples of Voltage
- USB power → approximately 5V
- Arduino Uno → commonly uses 5V logic
- ESP32 → uses 3.3V logic
- AA battery → approximately 1.5V
For example, when we connect an LED to an Arduino through a suitable resistor, the voltage provides the electrical potential required for current to flow through the circuit.
Important Point
Voltage does not mean that a fixed amount of current is always flowing. The amount of current depends on the complete circuit and the components connected to the voltage source.
2. What is Current?
Current is the flow of electric charge through a circuit.
Current is measured in Amperes (A), commonly called Amps.
For smaller electronic circuits, we commonly use milliamperes (mA).
1000 mA = 1 A
Using the water analogy:
Voltage = Water pressure
Current = Flow of water
For example, if an LED circuit uses 20 mA of current, approximately 0.02 A of current is flowing through the circuit.
Current tells us how much electric charge is flowing through a circuit over time.
3. What is Resistance?
Resistance is the opposition to the flow of electric current.
Resistance is measured in Ohms (Ω).
Using the water analogy, imagine a water pipe. If the pipe becomes narrower, it becomes harder for water to flow. Similarly, electrical resistance makes it harder for current to flow.
Higher resistance → Less current
Lower resistance → More current
What is a Resistor?
A resistor is an electronic component that provides resistance in a circuit.
One of the most common uses of a resistor is to limit current.
Example: Arduino → Resistor → LED → GND
The resistor limits the current flowing through the LED and helps protect the LED from excessive current.
4. What is Power?
Electrical power tells us how quickly electrical energy is being used or delivered.
Power is measured in Watts (W).
For a simple DC circuit:
Power = Voltage × Current
P = V × I
Where:
- P = Power in Watts
- V = Voltage in Volts
- I = Current in Amperes
Example
Suppose:
Voltage = 5V
Current = 0.2A
Power = 5 × 0.2
Power = 1W
Therefore, the device is using approximately 1 Watt of electrical power.
Why is Power Important in IoT?
- Motors
- Water pumps
- Relays
- Batteries
- Solar panels
- Power supplies
- ESP32 projects
- Battery-powered sensors
5. DC vs AC
There are two major types of electrical current:
- DC — Direct Current
- AC — Alternating Current
DC — Direct Current
In DC, the current has a fixed polarity and, in a simple DC circuit, flows in one direction.
- Batteries
- Arduino
- ESP32
- USB power
- Power banks
- Solar panels
Most beginner Arduino and ESP32 projects use low-voltage DC electricity.
AC — Alternating Current
In AC, the direction and magnitude of current periodically change.
The electricity supplied to homes through wall outlets is AC.
Important Safety Note
Arduino and ESP32 projects generally use low-voltage DC. Do not experiment with household AC mains electricity as a beginner. Mains electricity can cause serious injury or death.
6. What is Ground (GND)?
GND stands for Ground.
In most beginner electronic circuits, GND acts as the common electrical reference point for the circuit.
For example:
ESP32 GND → Sensor GND
This gives both devices a common electrical reference.
Common GND Rule
When connecting multiple electronic modules together, you will often need to connect their grounds together.
GND ↔ GND
Is GND the Same as Earth?
Not always. In a small Arduino or ESP32 circuit, GND usually means the circuit's electrical reference or return point. It does not necessarily mean that the circuit is physically connected to the Earth.
7. 3.3V vs 5V
This is one of the most important concepts when working with Arduino and ESP32.
- 3.3V
- 5V
Arduino Uno
The Arduino Uno commonly operates using 5V logic.
ESP32
The ESP32 uses 3.3V logic.
Therefore, we need to be careful when connecting signals between a 5V device and an ESP32.
Why Does This Matter?
Suppose a sensor produces a 5V output signal. We should not assume that this signal can safely be connected directly to an ESP32 GPIO.
ESP32 GPIOs are designed for 3.3V logic and are generally not 5V tolerant.
- Voltage divider
- Logic-level shifter
- Sensor designed for 3.3V logic
- Another suitable interface circuit
Always check the specifications or datasheet of the exact component before connecting it.
8. What is Ohm's Law?
Ohm's Law describes the relationship between voltage, current, and resistance.
The basic formula is:
V = I × R
The formula can be rearranged:
I = V ÷ R
R = V ÷ I
Where:
- V = Voltage
- I = Current
- R = Resistance
Example
Voltage = 5V
Resistance = 1000Ω
I = V ÷ R
I = 5 ÷ 1000
I = 0.005A
Since 0.005A = 5mA, approximately 5mA of current flows through the resistor.
9. Series vs Parallel Circuits
Electronic components can mainly be connected in two ways:
- Series
- Parallel
Series Connection
In a series connection, components are connected one after another in a single path.
Example: Power → Resistor 1 → Resistor 2 → GND
In a simple series circuit, the same current flows through each component.
Rtotal = R1 + R2 + R3 + ...
Example
R1 = 100Ω
R2 = 200Ω
Rtotal = 100Ω + 200Ω
Rtotal = 300Ω
Parallel Connection
In a parallel connection, components are connected across the same two points.
- Components have the same voltage across them.
- Current divides between different branches.
1 ÷ Rtotal = 1 ÷ R1 + 1 ÷ R2 + 1 ÷ R3
10. What is a Short Circuit?
A short circuit occurs when electricity gets an unintended low-resistance path.
For example, directly connecting the positive and negative terminals of a power supply creates a very low-resistance path.
5V → GND
This can allow a very large current to flow.
A Short Circuit Can:
- Heat wires
- Damage electronic components
- Damage the power supply
- Cause sparks
- Reset or damage an Arduino
- Damage an ESP32
- In some situations, cause fire
11. What is Polarity?
Polarity means identifying the positive (+) and negative (−) sides of an electrical component or power source.
Polarity is especially important in DC circuits.
Battery Polarity
- Positive (+) terminal
- Negative (−) terminal
LED Polarity
- Anode (+)
- Cathode (−)
For a typical through-hole LED:
- Longer leg → Anode (+)
- Shorter leg → Cathode (−)
Typical LED Connection
Arduino → Resistor → LED Anode (+)
LED Cathode (−) → GND
If an LED is connected with incorrect polarity, it normally will not light. Some components, such as electrolytic capacitors, can be damaged if connected with incorrect polarity.
Quick Revision
- Voltage: Electrical potential difference. Unit: Volt (V).
- Current: Flow of electric charge. Unit: Ampere (A).
- Resistance: Opposition to current flow. Unit: Ohm (Ω).
- Power: Rate at which electrical energy is used or delivered. Unit: Watt (W).
- DC: Direct current with fixed polarity.
- AC: Alternating current whose direction and magnitude vary periodically.
- GND: Common electrical reference point in a circuit.
- 3.3V: Common logic voltage used by ESP32.
- 5V: Common logic voltage used by Arduino Uno.
- Ohm's Law: Relationship between voltage, current, and resistance.
- Series: Components connected one after another in a single path.
- Parallel: Components connected across common points.
- Short Circuit: An unintended low-resistance path that can cause excessive current.
- Polarity: Positive and negative orientation of a component or power source.
How These Concepts Connect to IoT
All these basic electronics concepts are directly connected to the IoT projects we will build.
For example, consider a Soil Moisture Monitoring System.
Soil → Soil Moisture Sensor → ESP32 → ADC Reading → Moisture Value → Decision → Water Pump
The soil moisture sensor detects the moisture level in the soil and produces an electrical signal.
The ESP32 reads this signal using an ADC (Analog-to-Digital Converter) and converts it into a numerical value.
The program can then use this value to decide whether the soil is dry or wet.
If soil is dry → Turn pump ON
If soil is wet → Turn pump OFF
Later, we can extend this project so that the ESP32 sends the sensor data through Wi-Fi to a server.
Soil Sensor → ESP32 → Wi-Fi → Internet → Laravel API → Database → Web Dashboard
This is where electronics, programming, networking, backend development, and IoT all come together.