LAB 002
External LED: Build the Circuit
Recreate blink with a breadboard LED, its resistor and a wire to digital pin 8.
01
What you will build
An LED on D8 that blinks one second on, one second off.
Why it matters
The output circuit you used in Lab 1 is now visible and physically editable.
What you will learn
- breadboard rows and common ground
- anode, cathode and current-limiting resistor
- GPIO pin mapping
02
Parts per station
- 1 each An independently programmable Uno R3 per simultaneous station.
- 1 each A small breadboard is a possible substitute after inspection.
- 1 each Ordinary discrete LEDs; colors are optional.
- 1 each One verified 220–330 Ω current-limiting resistor per LED; count and values before class.
- several assorted Count leads usable for the chosen circuit before class.
- 1 each Availability unconfirmed. One working USB-A to USB-B DATA cable for upload; cable length need not be 10 feet. This canonical item is procurement-only, so existing cable stock must be verified, not assumed.
Station planning and software
Three separately counted Uno R3 boards and four counted 830-point breadboards; fifth complete independent station is unconfirmed. Kit boards and small breadboards may add capacity only after identification and testing. Count usable USB data cables, LEDs, resistors, jumpers and any inputs before meeting.
- Arduino IDE or Arduino CLI with Arduino AVR Boards core; select Arduino Uno and the connected serial port.
Arduino IDE is the only required development environment. Arduino CLI is optional.
03
Assembly
Disconnect USB before changing breadboard wiring; check connections before reconnecting.
Use one 220–330 Ω resistor in series with each ordinary LED. Never connect 5V directly to GND.
- 01
Disconnect USB; put the LED legs in different unconnected breadboard rows.
- 02
Place one verified 220–330 Ω resistor in series from D8 to the LED anode; connect cathode to Uno GND.
- 03
Check the resistor, polarity, row connections and code pin before reconnecting USB.
- 04
Verify and upload the core sketch; observe two full cycles.
| From | To | Purpose / notes |
|---|---|---|
| Uno D8 | LED 1 series resistor 220–330 Ω | Drive output with current limitingPut the resistor in series, never across 5V and GND. |
| LED 1 series resistor | LED 1 anode (long leg) | Feed LED in forward directionResistor may instead go on the cathode side if it stays in series. |
| LED 1 cathode (short leg/flat side) | Uno GND | Complete the circuitLED must not be connected directly across 5V and GND. |
Predict before you run
- What happens if the LED is reversed while power is disconnected and restored only after inspection?
- If D8 becomes D9 in code alone, will this LED blink?
External LED on D8 alternates on and off; resistor stays in series.
- Observe two full blink cycles.
- Check that changing code timing changes this external LED.
04
Code
The number 8 must match the wire plugged into D8.
// D8 -> series resistor -> LED anode; cathode -> GND.
const int ledPin = 8;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
About this version
core · Arduino Uno R3 · beginner
Build and control the first external output.
Same core wiring.
Hardware and wiring for this sketch
- arduino uno r3 · 1 eachAn independently programmable Uno R3 per simultaneous station.
- 830 point solderless breadboard · 1 eachA small breadboard is a possible substitute after inspection.
- assorted leds · 1 eachOrdinary discrete LEDs; colors are optional.
- resistor assortment · 1 eachOne verified 220–330 Ω current-limiting resistor per LED; count and values before class.
- jumper wire assortment · several assortedCount leads usable for the chosen circuit before class.
- 10 foot usb a to usb b cable · 1 eachOne working USB-A to USB-B DATA cable for upload; cable length need not be 10 feet. This canonical item is procurement-only, so existing cable stock must be verified, not assumed.
| From | To | Purpose / notes |
|---|---|---|
| Uno D8 | LED 1 series resistor 220–330 Ω | Drive output with current limitingPut the resistor in series, never across 5V and GND. |
| LED 1 series resistor | LED 1 anode (long leg) | Feed LED in forward directionResistor may instead go on the cathode side if it stays in series. |
| LED 1 cathode (short leg/flat side) | Uno GND | Complete the circuitLED must not be connected directly across 5V and GND. |
How the code works
Lines 2–2
The number 8 must match the wire plugged into D8.
Build and control the first external output.
How it works
The output circuit you used in Lab 1 is now visible and physically editable.
A GPIO output can drive a properly current-limited external LED when the circuit returns to GND.
Experiments & challenges
- Change only the delay; restore it.
- Power off, move the signal wire from D8 to D9, then upload the matching pin-9 variant.
Scale it up
Optional two-LED alternating circuit adds a second LED and its own resistor; a function variant then packages one blink.
Challenge
Sketch your own safe circuit route and explain where current flows while D8 is HIGH.
Advanced implementation
Open an advanced sketch in the code selector above. Compare its structure, hardware, and annotated lines with the core sketch.
- Reusable LED function: Put the on/off pattern into a small function.
Check your understanding
Why is a resistor necessary in series?
Which breadboard holes share an electrical node?
Learning summary
A GPIO output can drive a properly current-limited external LED when the circuit returns to GND.
Lab 3 repeats this same circuit pattern for multiple independently timed outputs.
Troubleshooting
No upload or no power
Check USB data cable, selected Uno board and serial port; verify the power LED.
Unexpected external LED behavior
Disconnect USB, check the breadboard row, LED polarity, series resistor, GND, then compare the code pin with the wire.
LED stays dark but onboard L blinks
Verify code drives D8, not LED_BUILTIN; inspect the resistor path and LED orientation.