The RELAY: 5 V switches 230 V
A 5 V coil becomes a magnet and pulls the arm (COM: NC → NO) to switch a separate 230 V circuit; a transistor drives the 71 mA coil from an Arduino pin, and a flyback diode across the coil eats the turn-off spike.
5 volts from an Arduino switching a 230 V lamp? That's a RELAY ⚡ (the lesson we promised!)
1️⃣ INSIDE: a coil wound on an iron core. Power the coil and it becomes a MAGNET. It pulls a metal arm down → CLICK. The arm (COM) leaves NC and touches NO, and the 230 V circuit closes. Cut the power and a spring pulls it back.
2️⃣ THE CIRCUIT: a 5 V relay coil needs about 71 mA (≈ 70 Ω), but an Uno pin gives only 20 mA. So D7 → 1 kΩ → a 2N2222 transistor (4.3 mA into the base) switches the coil.
3️⃣ TWO WORLDS: the 230 V lamp only touches the relay's contacts. No wire goes from the mains side to your Arduino.
4️⃣ ALWAYS ADD A DIODE: when the coil turns off it kicks back a big voltage spike that can kill the transistor. A diode (1N4007) across the coil, band to +5 V, eats it (clamped to about 5.7 V).
⚠️ 230 V can kill. Use a ready, insulated relay module (most have the transistor + diode built in) and let an adult/electrician do the mains wiring. AC and the spike are shown slowed down.
Read the voiceover (transcript)
- Five volts... switching two-thirty volts?!
- Inside a relay? A coil! Power it, it becomes a magnet, and pulls the arm. Click!
- A pin can't power the coil, so a transistor does! And the two-thirty volt side never touches your Arduino.
- Always add this diode! It eats the turn-off spike.
- Small signal. big switch!
- Next: the MOSFET! Follow for lesson ten!
Related lessons
Get new lessons + early access to the full course
One email when new lessons drop. No spam, unsubscribe any time.
✓ You're on the list. Check your inbox to confirm.
By joining you agree to the privacy policy.




