Lighting an LED with an Arduino is a classic first electronics project because it connects code to something you can see right away. Students learn how a microcontroller sends electrical signals through a circuit. The project uses simple parts like a breadboard, resistor, LED, jumper wires, and USB cable.
It matters because the same ideas are used in robots, alarms, traffic lights, and many smart devices.
Key Facts
- An Arduino digital pin can be set HIGH to output about 5 V or LOW to output about 0 V.
- A typical starter LED circuit uses Arduino pin 13, a 220 ohm resistor, an LED, and GND.
- Ohm's law is V = IR, so current can be found with I = V/R.
- A resistor limits current so the LED and Arduino pin are not damaged.
- The long leg of an LED is usually the anode, and it should connect toward the positive side of the circuit.
- Arduino timing uses delay(milliseconds), so delay(1000) waits 1 second.
Vocabulary
- Arduino UNO
- A small programmable circuit board that can read inputs and control outputs like lights, motors, and buzzers.
- Breadboard
- A reusable board with connected holes that lets you build circuits without soldering.
- LED
- A light emitting diode that glows when current flows through it in the correct direction.
- Resistor
- A component that reduces and controls the amount of electric current in a circuit.
- Digital pin
- An Arduino connection that can be programmed to be HIGH or LOW to control a device.
Common Mistakes to Avoid
- Forgetting the resistor is wrong because too much current can flow through the LED and possibly damage the LED or Arduino pin.
- Reversing the LED legs is wrong because an LED only lights when current flows from anode to cathode in the correct direction.
- Putting both LED legs in the same breadboard row is wrong because the legs become connected to the same point and no useful circuit path is made.
- Using the wrong pin number in the code is wrong because the Arduino will turn on a different pin than the one connected to the LED.
Practice Questions
- 1 An LED circuit uses a 5 V Arduino output and a 220 ohm resistor. If you estimate the LED voltage as 2 V, what is the current through the resistor using I = V/R for the remaining voltage?
- 2 A blink program uses delay(500) after digitalWrite(13, HIGH) and delay(500) after digitalWrite(13, LOW). How many complete on-off blinks happen in 10 seconds?
- 3 Explain why the LED should be connected in series with a resistor instead of directly between a digital pin and GND.