Source: https://mokxi.com/teachers/arduino-blink-lab
Updated: 2026-11-09

Ready-to-teach lab

# Arduino blink lab: a first program

This Arduino blink lab is a first lesson in code: an LED on pin 13 of a simulated Uno blinks once a second, and students change the sketch to make it do something else.

Ages 10 and up, a first coding lesson. About 35 minutes. Students read and change an Arduino sketch.

Open this lab Assign to my class

The lesson

## Objective and parts

### By the end, students can

- Say what setup() and loop() are for.
- Use pinMode, digitalWrite and delay, and say what LED_BUILTIN stands for.
- Change a program, run it again and describe what changed.

### Parts, already on the bench

- An Arduino Uno
- One LED
- One 220 ohm resistor, from pin 13 to the LED

Nothing to hand out or collect: the circuit opens built and wired.

Steps

## What students do

Each step is short enough to read out. Students work in the simulator beside this page.

Open this lab

- Open the lab and press Run. The LED blinks once a second.
- Open the code and read it out loud, one line at a time. Which line turns the LED on?
- Change both delay(500) lines to delay(100) and run it again. It blinks five times as fast.
- Make the LED stay on for two seconds and off for a tenth of a second.
- Write a pattern of your own: three short flashes, then a long pause.
- Move the resistor wire from pin 13 to pin 8. Run it, see that the LED stays dark, then fix the sketch.

Questions

## Questions for students

Hand these out as they are. The expected answers are under the list, for you.

- What is the number inside delay() measured in?
- How many times does setup() run, and how many times does loop()?
- After the wire moved to pin 8 the LED stopped. What has to change in the sketch?
- With both delays at 5 the LED seems to be on all the time, only dimmer. Why?

Answer key for the teacher

- Milliseconds. delay(500) waits half a second, so on plus off takes one second.
- setup() runs once when the board starts. loop() runs again and again until the power is removed.
- LED_BUILTIN is a name for pin 13. It has to become 8 in all three places: in pinMode and in both digitalWrite lines.
- It is still blinking, 100 times a second, which is faster than the eye can follow. It is off half the time, so it looks dimmer.

Go further

## For students who finish early

- Add a second LED on another pin and blink the two in turn.
- Send the letters SOS in Morse code.

Your class

## Give this lab to every student

Assign to my class puts this circuit on each student’s class page as a starter. They change their own copy and hand it in, and the work comes back to you in one list.

The class tools are free for 30 days for one class of up to 20 students, with no card. Opening and running the lab needs no account and stays free.

Assign to my class Start a free class

More labs

## The other labs in the set

Ohm's law Circuits. 40 min. Series and parallel Circuits. 45 min. Voltage divider Circuits. 40 min. LED and resistor Circuits. 30 min. RC circuit Electronics. 50 min. Transistor switch Electronics. 45 min. Logic gates Electronics. 40 min. Button and LED Arduino. 40 min. Traffic light Arduino. 45 min. Ultrasonic distance Arduino. 45 min. Servo sweep Arduino. 40 min. All labs The whole set on one page.
