ohmio

Circuits / Microcontrollers

Arduino UNO blinking an LED

A pin as an output at 5 V: digitalWrite(13, HIGH) lights D1, delay() sets the rhythm

Arduino UNO blinking an LED, simulated on a breadboard

Tap a part to see its voltages and currents. It is a model, not a measurement.

What do you need?

How does an Arduino UNO blink an LED?

Blink is the first program for almost every Arduino. pinMode(13, OUTPUT) makes pin 13 an output, and digitalWrite(13, HIGH) puts 5 V on it. Current flows through R1 (220 Ω) and the LED back to GND: about 12 mA, with 2.7 V across the resistor and 1.8 V across the LED. digitalWrite(13, LOW) brings the pin to 0 V and the LED goes off. The two delay(500) calls hold each state for half a second, so the LED blinks once per second. The ATmega328P on the UNO allows 40 mA per pin as an absolute maximum, and about 20 mA is the safe working figure, so 12 mA leaves margin. Pin 13 also drives the small LED marked L on the board itself, which is why it blinks along with yours.

Values from the Protoboard ISO simulation: a model, not a bench measurement.