0Pricing
Arduino & IoT Academy · Lesson

Wire an External LED Safely

Add a resistor and blink an LED off the board.

Wire an External LED Safely is a free Arduino & IoT Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Arduino & IoT Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Beyond the Onboard LED

The onboard light is handy, but real projects need their own LEDs. Wiring one up takes just a few parts and a little care. 🔧

LEDs Have a Direction

An LED only lets current flow one way. Its long leg is the positive anode, and the short leg is the negative cathode. Orientation matters.

Long Leg to the Pin

Connect the long leg toward your Arduino pin, the source of voltage. The short leg heads toward ground, completing the path for current.

Why You Need a Resistor

A raw pin can shove too much current through an LED and burn it out. A resistor limits that flow so the LED stays bright but safe.

Pick the Right Value

For a 5V pin, a resistor around 220 ohms is a safe, common choice. It gives a clear glow without stressing the LED or the pin.

It Goes In Series

Place the resistor in line with the LED, not beside it. Pin to resistor to LED to ground means every electron passes through the resistor.

Either Side Works

A resistor has no direction, so it can sit before or after the LED. What matters is that it stays in the same series path with it.

Find the Ground Pin

Your Arduino has a pin marked GND. The LED circuit must return there, because current needs a complete loop back to ground to flow.

Reuse Your Blink Code

The wiring changed, not the code. Point pinMode and digitalWrite at the pin you wired, and your familiar blink sketch lights the new LED.

const int ledPin = 9;
pinMode(ledPin, OUTPUT);

When It Stays Dark

No light usually means a backwards LED or a loose wire. Flip the LED and recheck each connection to ground before blaming the code.

Never Skip the Resistor

Tempted to wire an LED straight to a pin? Do not. Without a resistor you risk frying the LED and even damaging the Arduino pin.

Quick Check

Why does an external LED need a resistor in series?

Recap

You wired an external LED with the long leg to a pin and a resistor guarding the path to ground. You can now build LEDs into any project. 🎉

Frequently asked questions

Is the “Wire an External LED Safely” lesson free?

Yes — the full text of “Wire an External LED Safely” is free to read here on the web, and the Arduino & IoT Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Arduino & IoT Academy course, upgrade to CoddyKit PRO.

What will I learn in “Wire an External LED Safely”?

Add a resistor and blink an LED off the board. You practise Arduino & IoT Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Arduino & IoT Academy?

No prior experience is required. Arduino & IoT Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Wire an External LED Safely” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Arduino & IoT Academy lesson?

Yes. Every Arduino & IoT Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. pinMode and OUTPUT
  2. digitalWrite HIGH & LOW
  3. delay() and Blink Timing
  4. Wire an External LED Safely
← Back to Arduino & IoT Academy