Connecting an external LED

Luckily, the Arduino boards come with an internal LED connected to pin 13. It is simple to use and always there. But most times we want our own LEDs in different places of our system. We might connect something on top of the Arduino board and can no longer see the internal LED. Here, we will explore how to connect an external LED.

Getting ready

For this recipe, we need the following ingredients:

  • An Arduino board connected to the computer via USB
  • A breadboard and jumper wires
  • A regular LED (the typical LED size is 3 mm)
  • A resistor between 220–1,000 ohm

How to do it…

Follow these steps to connect an external LED to an Arduino board:

  1. Mount the resistor on the breadboard. Connect one end of the resistor to a digital pin on the Arduino ...

Get Arduino Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.