After learning the basic concepts of voltage, current, resistance, power, and circuits, the next step is to understand the common electronic components that we will use in Arduino and IoT projects.
These components are the building blocks of many electronic circuits.
In this tutorial, we will learn about:
- Resistor
- LED
- Push Button
- Potentiometer
- Capacitor
- Diode
- Transistor
- Relay
- Buzzer
- Breadboard
1. Resistor
A resistor is an electronic component that limits or controls the flow of electric current in a circuit.
Resistance is measured in Ohms (Ω).
Why Do We Use Resistors?
Resistors are commonly used to:
- Limit current
- Protect LEDs
- Divide voltage
- Set input values
- Control signals
- Pull a signal HIGH or LOW
Example
When connecting an LED to an Arduino, we normally use a resistor:
Arduino → Resistor → LED → GND
The resistor limits the current flowing through the LED.
Common Resistor Values
Some commonly used resistor values are:
- 220Ω
- 330Ω
- 1kΩ
- 4.7kΩ
- 10kΩ
- 100kΩ
For beginners, 220Ω, 330Ω, 1kΩ, and 10kΩ are particularly useful values to keep available.
Important Point
Resistors are not directional. This means they normally can be connected in either direction.
2. LED
LED stands for Light Emitting Diode.
An LED is a semiconductor component that produces light when current flows through it in the correct direction.
LEDs are commonly used as indicators in Arduino projects.
For example:
- LED ON → Sensor is active
- LED OFF → Sensor is inactive
- Blinking LED → System is working
- Red LED → Warning
- Green LED → Normal condition
LED Polarity
An LED has two terminals:
- Anode (+)
- Cathode (−)
For a typical through-hole LED:
- Longer leg → Anode
- Shorter leg → Cathode
Many LEDs also have a flat edge on the body that indicates the cathode side.
LED with Arduino
A typical connection is:
Arduino Digital Pin → Resistor → LED → GND
The resistor is important because it limits the current through the LED.
Important Point
An LED is a polarized component. It normally needs to be connected in the correct direction.
3. Push Button
A push button is an input component that allows a user to send a signal to a microcontroller.
When the button is pressed, the electrical connection changes.
Common Uses
Push buttons can be used for:
- Turning an LED ON or OFF
- Starting a program
- Stopping a motor
- Selecting a mode
- Sending commands
- Resetting a system
Example
We can create a simple circuit:
Push Button → Arduino Digital Pin
The Arduino can detect whether the button is pressed.
For example:
Button pressed → LED ON
Button released → LED OFF
Pull-Up and Pull-Down Resistors
A digital input should not be left floating.
We commonly use:
- Pull-up resistor
- Pull-down resistor
Arduino also provides an internal pull-up resistor that can be enabled in software.
This makes push-button projects easier to build.
4. Potentiometer
A potentiometer is a variable resistor.
Unlike a normal resistor, its resistance can be changed by turning a knob or shaft.
A typical potentiometer has three terminals.
Potentiometer Terminals
The two outer terminals are connected to the ends of the resistive element.
The middle terminal is connected to the wiper.
The wiper position changes as the knob is rotated.
Common Uses
Potentiometers are used for:
- Volume control
- Brightness control
- Speed control
- Setting thresholds
- Reading user input
- Adjusting sensor values
Arduino Example
A potentiometer can be connected like this:
5V → Potentiometer → GND
The middle pin goes to an Arduino analog input.
The Arduino reads the changing voltage and converts it into a numerical value.
For example:
Turn knob → Voltage changes → Analog reading changes
This is one of the easiest ways to learn about analog input.
5. Capacitor
A capacitor is an electronic component that stores electrical energy temporarily.
Capacitance is measured in Farads (F).
Common capacitor units include:
- µF (microfarad)
- nF (nanofarad)
- pF (picofarad)
What is a Capacitor Used For?
Capacitors are commonly used for:
- Smoothing voltage
- Reducing electrical noise
- Filtering signals
- Temporary energy storage
- Stabilizing power supplies
- Timing circuits
Example
When a microcontroller circuit is powered, electrical noise can sometimes appear on the power supply.
A capacitor placed near the power pins can help reduce this noise.
Common Capacitor Values
Some common values include:
- 100nF
- 1µF
- 10µF
- 100µF
Important Point
Some capacitors are polarized.
Electrolytic capacitors commonly have a positive and negative side, so they must be connected correctly.
6. Diode
A diode is a semiconductor component that mainly allows current to flow in one direction.
It can be thought of as an electrical one-way valve.
Diode Terminals
A diode has two terminals:
- Anode
- Cathode
Current can normally flow from the anode toward the cathode when the diode is forward biased.
Common Uses
Diodes are used for:
- Protecting circuits
- Rectification
- Preventing reverse current
- Signal processing
- Protecting microcontrollers from inductive voltage
Flyback Diode
A diode is especially important when controlling components such as:
- Relays
- Motors
- Solenoids
These components are inductive and can generate a voltage spike when switched off.
A flyback diode can help protect the switching component from this spike.
7. Transistor
A transistor is a semiconductor device that can be used for switching or amplifying electrical signals.
In Arduino and IoT projects, one of the most common uses is switching a load that the microcontroller cannot drive directly.
Why Do We Need a Transistor?
An Arduino or ESP32 GPIO can provide only a limited amount of current.
Suppose we want to control:
- A motor
- A pump
- A buzzer
- A strip of LEDs
The microcontroller may not be able to power the load directly.
A transistor can act as an electronic switch.
Basic Concept
Arduino GPIO → Transistor → Load
The Arduino controls the transistor, and the transistor controls the larger load current.
Common Types
Two common transistor families are:
- BJT
- MOSFET
For many modern IoT projects, MOSFETs are particularly useful for efficiently switching DC loads.
Important Point
The exact transistor circuit depends on the type of transistor and the load being controlled.
8. Relay
A relay is an electrically controlled switch.
It allows a low-voltage control circuit to switch another electrical circuit.
Why Do We Use a Relay?
Relays can be used to control:
- Water pumps
- Motors
- Lights
- Fans
- Solenoid valves
- Other electrical loads
For example:
ESP32 → Relay → Water Pump
The ESP32 controls the relay, and the relay switches the pump circuit.
Relay Module
For Arduino projects, we commonly use a relay module instead of connecting a bare relay directly.
A relay module often includes supporting components such as a transistor driver and protection diode.
Relay Terminals
A typical relay has:
- COM → Common
- NO → Normally Open
- NC → Normally Closed
Understanding NO and NC
Normally Open (NO) means the connection is open when the relay is not activated.
Normally Closed (NC) means the connection is closed when the relay is not activated.
Important Safety Note
Relays are sometimes used to switch high-voltage AC loads.
Never connect household mains voltage to a relay circuit as a beginner. High-voltage wiring requires appropriate training, isolation, protection, and supervision.
9. Buzzer
A buzzer is an output component that produces sound.
Buzzers are commonly used to provide audio indications.
Common Uses
A buzzer can be used for:
- Alarm systems
- Warning notifications
- Button feedback
- Sensor alerts
- Security systems
- Timer notifications
Example
In a soil monitoring project:
Soil is very dry → Buzzer ON
Soil has enough moisture → Buzzer OFF
Types of Buzzers
There are two common types:
- Active buzzer
- Passive buzzer
An active buzzer generally produces a tone when suitable DC power is applied.
A passive buzzer can be driven with a changing signal to produce different tones.
This makes passive buzzers useful for generating melodies or different sound frequencies.
10. Breadboard
A breadboard is a tool that allows us to build electronic circuits without soldering.
It is extremely useful when learning Arduino and electronics.
Why Do We Use a Breadboard?
A breadboard allows us to:
- Connect components quickly
- Test circuits
- Change wiring easily
- Experiment with different components
- Build temporary prototypes
Breadboard Structure
A typical breadboard contains groups of connected holes.
The holes in the central area are internally connected in small groups.
The side power rails are commonly used for:
- VCC / positive supply
- GND / negative supply
However, the exact internal layout can vary between breadboard models, so it is important to understand the particular breadboard you are using.
Important Point
The holes in a breadboard are not all connected together.
Understanding which holes are electrically connected is very important when building a circuit.