T ThinkEdge Learn

Relay Driver

Switching a 50 mA lamp from a 20 mA pin

Relay Transistor Current Isolation
Arduino relay project for beginners · Tier 1 · Basics · Beginner · 25 min · Arduino Uno

What you will learn

What you will need

Component
1× Arduino Uno
1× pushbutton (the "call the lift" button)
1× 10 kΩ resistor (pull-down, so the input never floats)
1× 1 kΩ resistor (base resistor — this is the part that protects the pin)
1× NPN transistor (2N2222)
1× 5 V relay (SPDT)
1× 1N4148 diode (flyback clamp across the coil)
1× 9 V battery (the load's own supply — deliberately not the Arduino)
1× LED (stands in for the lamp)
Breadboard
Jumper wires

Step by step

Take it further

Practise it before you build it

Wire this circuit in the ThinkEdge Learn simulator first. The simulator runs a real Arduino sketch against a modified-nodal-analysis solver, so the LED on screen actually lights when the current is right — no hardware, no burnt components, and a class can try it in a browser.

Open the interactive lab See plans for your class

Related projects

LED Light UpYour first circuit — light it up Button-Controlled LEDPress to light, release to turn off RGB Color Mixer — Three Switches, Seven ColorsMix any color with three separate LED channels Arduino — Blink Without DelayUse millis() instead of delay() — the right way to blink Arduino — Fade an LED with PWManalogWrite on D9 — the smoothest way to dim an LED Arduino — Button + Buzzer DoorbellPress the button, hear a tone. The classic Arduino starter.

Guides that use this project

4 guides on the site build this project as part of a longer explanation. The guide says why the circuit works; this page says how to wire it.

How to Build a RobotHow to build a robot from scratch: one motor and a switch, then sensors, then a line-follower that steers itself. Every stage runs in a browser simulator first. ESP32 IoT Projects: From a Single Sensor to a Live DashboardFive ESP32 IoT projects that teach sensors, MQTT publishing, deep sleep and reconnection, each staged so the logic runs in a browser simulator first. Mesh Networking: How Nodes Relay Data for Each OtherA mesh network lets nodes relay data for each other. How flooding and hop limits work, what mesh costs in latency, and when a simple star is better. GPU Repair: Why Graphics Cards Fail and Whether Fixing One PaysGraphics cards fail from solder fatigue, VRM breakdown, dead fans and ageing capacitors. How to diagnose the cause and whether a repair is worth the money.

Where this project sits

It is also part of these lists, which is how a class usually finds it.

Arduino LED projects for beginners36 projects in this list Arduino push button projects for beginners14 projects in this list Engineering projects for school students12 projects in this list

Try the full simulator with your class

103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.