Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The quickest way to explore LEDs with Arduino is to upload the built-in Blink example and watch the board’s onboard LED turn on and off. Once that works, try an external LED with a series resistor, then explore fading, timing, multiple LEDs, or the UNO R4 WiFi’s optional LED matrix.

How do I blink an LED with Arduino?

Start with the LED already connected to your board. Arduino’s built-in examples include Blink under Basics, and the examples are available directly in Arduino IDE. Select the board you are using and open the Blink example for its compatible board package.

  1. Connect the Arduino board to your computer and select the matching board and port in Arduino IDE.
  2. Open the Blink example from the IDE’s built-in examples.
  3. Upload the sketch. The standard example turns the onboard LED on for one second and off for one second, repeating the cycle.

The sketch uses setup() to configure the LED pin as an output once, then loop() to set it HIGH and LOW with delays. This makes Blink a useful first check that a basic sketch can upload and control an output.

Use the board’s built-in LED symbol

Use LED_BUILTIN in code rather than assuming the LED is always on pin 13. Arduino’s Blink documentation notes that the built-in LED’s pin varies by board; the constant is defined in the board descriptor. A hard-coded pin number may therefore target the wrong pin on a different board.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
300 Pcs 3mm & 5mm LED Diode Assortment Kit
  • Dual-Size Versatility: Each color (White/Red/Blue/Green/Yellow) includes 20pcs 5mm LEDs and 40pcs 3mm LEDs, totaling 300pcs. Perfect for projects requiring flexibility in size and brightness.
  • Precise Technical Specs: Forward Voltage: Red/Yellow 2.0-2.2V; Blue/Green/White 3.0-3.2V.
  • Wide Application: Ideal for DIY electronics, Arduino/Raspberry Pi projects, PCB circuits, car decorations, science experiments and holiday lights.
  • Organized Storage: Color-coded and size-separated in a labeled plastic case for easy access and protection against damage.
  • Premium Quality: High-conductivity silver-plated pins and durable materials ensure long-lasting performance.

Do I need a resistor for an Arduino LED?

For an external LED, yes: put a suitable resistor in series with it to limit current. Arduino’s Blink example documentation calls the resistor essential for safe operation because it limits current through the LED and helps prevent damage to the LED and the Arduino output pin.

Wire an external LED

Use this series path: output pin → resistor → LED anode. Connect the LED’s cathode to GND. The anode is usually the longer leg; the shorter leg is the cathode.

Rank #2
ELEGOO Electronic Fun Kit Bundle with Breadboard, 235 Items for Arduino
  • BUILD BREADBOARD CIRCUITS AND MINI PROJECTS - Create LED indicators, button inputs, traffic-light sequences, light-activated circuits, RGB effects and buzzer alarms for electronics practice, classroom demonstrations and maker projects
  • 235 PARTS FOR REPEATABLE EXPERIMENTS - Includes a 400-tie-point solderless breadboard, power module, jumper wires, Dupont wires, potentiometer, buttons, LEDs, resistors, capacitors, diodes, transistors, buzzers and light-sensitive components
  • LEARN HOW CORE COMPONENTS WORK - Use the 74HC595 to expand outputs, the 4N35 optocoupler to explore signal isolation, PN2222 transistors to switch loads and 1N4007 diodes for polarity protection and rectification experiments
  • POWER AND REWIRE PROJECTS QUICKLY - Use the breadboard power module for selectable 3.3 V or 5 V rails, while rigid jumpers and female-to-male leads simplify connections; use a suitable 6.5–9 V DC input and do not exceed 9 V
  • COMPONENT KIT WITH CLEAR EXPECTATIONS - A controller board, programming cable and wall power adapter are not included; use a compatible microcontroller for coded projects and follow the current tutorial, datasheets and wiring guidance
  1. With the board disconnected from power, place the LED and resistor on a breadboard.
  2. Run a jumper from a suitable digital output pin through the resistor to the LED’s anode, the longer leg.
  3. Connect the LED’s cathode, the shorter leg, to GND.
  4. Upload a Blink-style sketch that controls the output pin you wired. If using an external pin rather than the onboard LED, set that pin as an output and use its pin number in the sketch.

Arduino’s example uses 220 ohms with a 5 V UNO R3. That is an example for that board and setup, not a universal resistor value: the appropriate resistance depends on the board’s voltage and the LED’s forward voltage. Arduino describes using the voltage across the resistor—the board voltage minus the LED forward voltage—to choose a value.

What should I try after Blink?

Arduino’s built-in examples provide several natural next steps. Open the examples in Arduino IDE and check each example’s pin and board requirements before wiring or uploading it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
California JOS 50 PCS Colorful 5mm LED Light Diodes, LED Circuit Assorted Kit for Science Project Experiment (10pieces/Color)
  • ✅LED polarity: the longer pin is the Anode (positive +), and the shorter pin is the Cathode (negative -).
  • ✅Multi-color: 5 Colors - White/Red/Green/Blue/Yellow, 5 mm LED Diodes Kit with water drop shape round.
  • ✅Forward voltage: B/W:3V-3.2V R/GY:1.8V-2.2V Max. Current: 20 mA
  • ✅Application - These LED lights are perfect for DIY LED Projects, Arduino Projects, STEM Science Experiments, Car Decorations, Signal Indicators, Electronic, and Electrical Experiments, etc.
  • ✅ All LEDs are been packed & QC in the USA. Our business policy:100% satisfaction. Please contact us with any problems anytime through Amazon message. We provide 7-24 service.
  • Fading a LED / Fading: explore changing brightness rather than switching fully on and off. Use a compatible output pin for the example and your board.
  • Blink Without Delay: practice timing changes without relying on the blocking delay pattern used by the basic Blink sketch.
  • Create a LED Dimmer: try a dimming-focused example and follow its stated hardware and pin requirements.
  • LED Bar Graph: move from one light to several LEDs and learn how to control multiple outputs. Follow the example’s wiring and verify pin suitability for your board.

These examples are listed in Arduino’s built-in examples index. Pin behavior and example requirements can differ across boards, so do not assume a sketch written for one setup will behave identically on every Arduino.

Which Arduino pin controls the built-in LED?

There is no single pin number that applies to every Arduino. The built-in LED’s pin varies by board, so use LED_BUILTIN in a sketch and consult the documentation for your exact board. Arduino’s maintained Blink example uses the built-in LED by default and documents this board-specific behavior at Blink.

Rank #4
DiCUNO 450pcs 5mm LED Diode, LED Light Kit Box 5 Colors, for DIY Project
  • Overview: 5mm LED light assortment kit includes 5 colors x 90pcs diodes-handy kit box ready for DIY lighting project. Head Diameter: 5mm Round; Pin Length: 18 mm ( Longer Part: Anode) / 17 mm ( Shorter Part: Cathode).
  • Electrical Parameters: Forward Voltage: Red/Yellow 2.0-2.2V; Blue/Green/White 3.0-3.2V; Max. Current: 20mA; Viewing Angle: 30 degree. Note: Due to varying voltages across different LED colors, please calculate in advance to achieve optimal lighting performance.
  • Wide Application: DiCUNO super bright 5mm LED diodes are widely used in DIY LED Projects, School Science Experiments, Signal Indicators, Car Decorations, Electronic and Electrical Experiments, Breadboard, etc.
  • Luminous Intensity: Red, 2000-3000mcd; Yellow, 3000-4000mcd; Green, 15000-20000mcd; Blue, 3000-4000mcd; White, 12000-14000mcd. Mini LED lights, yet deliver impressive brightness.
  • Wavelength Range: Red, 620-625nm; Yellow, 590-595nm; Green, 520-525nm; Blue, 460-465nm; White, 8000K. 5mm LED 5 Colors-one box offers you multiple and accurate lighting effects.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Should I use individual LEDs or an LED matrix?

Choose individual LEDs when you want to learn circuit wiring, polarity, resistors, or multi-output logic. A matrix is more convenient when your goal is graphics or animations rather than wiring a discrete array. Arduino’s examples include an LED Bar Graph activity for multiple LEDs; for an integrated matrix, the UNO R4 WiFi has a built-in 12×8 LED matrix documented for visual prototyping.

The UNO R4 WiFi matrix is an optional expansion, not a requirement for a first blink. The board also has Wi-Fi and Bluetooth capabilities, but those are separate features from the basic LED lesson. See Arduino’s UNO R4 WiFi hardware documentation for board-specific information.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Smraza 298 Pieces Electronics Starter Kit with Breadboard for Arduino
  • Smraza Electronics Fun Kit - It has all consumable component are often used. Compatible with Arduino and Raspberry Pi, it can almost meet all your needs. Not included controller board.
  • A Breadboard and Power Supply Module -Include a good range of LEDs, resistors, buttons, capacitors, a few transistors and diodes.
  • With jumper wire and Male-female dupont wire to meet your project expetation.
  • All parts components are in a sturdy and nice storage box which can help you keep the components neat after using.
  • With Datasheet and Tutorial - We provide detailed instruction for you to begin your electronic projects, any questions, please contact our customer service.

What do I need to get started?

Path Materials or setup Best for Caveat
Built-in LED Arduino board and compatible IDE/core; no external circuit First code upload and output test Built-in LED pin varies; use LED_BUILTIN and board documentation.
External single LED LED, suitable series resistor, GND connection; breadboard and jumpers help Learning polarity, wiring, and digital output 220 ohms is documented as an UNO R3 5 V example, not a universal prescription.
LED bar graph or multiple LEDs More LED components and the relevant example wiring Patterns and multi-output logic Follow the official example and verify pin suitability.
UNO R4 WiFi matrix UNO R4 WiFi with its onboard 12×8 matrix Graphics and animations without wiring a discrete LED array Optional hardware; unnecessary for the first LED lesson.

If you want guided projects and components together, Arduino’s Starter Kit R4 product page describes a package with a UNO R4 WiFi, electronic components, and a project book. The page describes 13+ beginner projects in one passage and 14 hands-on projects in another for the printed-book projects; these are product-page project counts, not a claim that every project is about LEDs. Buying a kit is optional: the built-in Blink route needs no extra LED circuit.

Quick Recap

Bestseller No. 1
300 Pcs 3mm & 5mm LED Diode Assortment Kit
300 Pcs 3mm & 5mm LED Diode Assortment Kit
Precise Technical Specs: Forward Voltage: Red/Yellow 2.0-2.2V; Blue/Green/White 3.0-3.2V.
$7.99
Bestseller No. 3
Bestseller No. 5
Smraza 298 Pieces Electronics Starter Kit with Breadboard for Arduino
Smraza 298 Pieces Electronics Starter Kit with Breadboard for Arduino
With jumper wire and Male-female dupont wire to meet your project expetation.
$11.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.