ROBOTICS · LEVEL 1 · ARDUINO FOUNDATIONS · LESSON 01

Build Your First Arduino Blinking Beacon

Make a real Arduino obey your code, change its timing, and create a custom light pattern—without adding wires yet.

Today you will make a tiny light on a real Arduino blink in a pattern that you choose. This first win proves that your computer can send instructions to the board, then lets you change those instructions and watch the board obey.

We are not using a breadboard yet on purpose. A first project should have only one new challenge—telling the board what to do—not a cable problem, loose wire, and new code all at once.

At a glance

Age range10–13
Time25–35 minutes
Parent involvementMedium for setup; light during the build
ConceptsCode upload, digital output, variables, setup(), loop(), timing

What you will learn

  • Connect an Arduino Uno and upload a program.
  • Use a program to turn a physical light on and off.
  • Explain what setup() and loop() do.
  • Change a number in code and observe the physical result.
  • Make a prediction, test it, and use the result as evidence.

Before you begin

Ask a parent to complete the course introduction and setup. You need a genuine Arduino Uno, its supplied USB-A-to-USB-B data cable, Arduino IDE 2, and optionally a notebook. The breadboard stays empty today.

  • Use only USB power; do not connect batteries or wall power.
  • Keep drinks away and hold the board by its edges.
  • An adult may help with software, permissions, or selecting the port. The student should upload, predict, change, and explain.

Build the beacon

1. Find the built-in light

  1. Put the Uno on a dry table.
  2. Find the small LED labeled L, near the number 13.
  3. Connect the supplied USB cable directly to the computer.

Checkpoint: the green power LED lights. If not, check power and cable first.

2. Choose the board and port

  1. Open Arduino IDE 2.
  2. Choose Arduino Uno in the board selector.
  3. Choose the port. It often begins /dev/cu.usbmodem on Mac or resembles COM3 (Arduino Uno) on Windows.
  4. Install Arduino AVR Boards if prompted.

Checkpoint: the IDE names both Arduino Uno and a port. If no port appears, unplug and reconnect and observe which entry appears.

3. Upload the program

  1. Choose File → New Sketch and replace the starter text with the code below.
  2. Click the checkmark to verify, then the right-arrow Upload button.
  3. Wait for Done uploading.

Checkpoint: the L LED turns on for half a second, off for half a second, and repeats.

Code

const int STATUS_LED = LED_BUILTIN;

void setup() {
  pinMode(STATUS_LED, OUTPUT);
}

void loop() {
  digitalWrite(STATUS_LED, HIGH);
  delay(500);

  digitalWrite(STATUS_LED, LOW);
  delay(500);
}

STATUS_LED names the built-in LED pin. setup() runs once and prepares it as an output. loop() repeats forever. digitalWrite() sends HIGH (on) or LOW (off), and delay() pauses in milliseconds.

Predict and change

Before editing, predict what happens when both 500 values become 100. Upload and watch. Then try 1000. One thousand milliseconds is one second.

Required challenge: three-flash distress beacon

Make three quick flashes, then a long pause, and repeat. Keep using STATUS_LED, HIGH, LOW, and delay(). Draw a timeline—on, off, on, off, on, off, long wait—and upload after each small edit.

Parent guidance: let the student attempt the first two flashes before offering a hint. If stuck, point to the last delay() and ask, “Which wait happens after the third flash?”

Understand it

  1. Why does pinMode() come before digitalWrite()?
  2. What happens if the first delay becomes 2000 but the second stays 500?
  3. Why does the beacon repeat with only one HIGH line?
  4. What happens if the LOW line is removed?
  5. Why begin with the built-in LED?

Optional: make a heartbeat pattern, invent Morse-like initials, or design patterns for a robot that is ready, worried, or celebrating.

Debugging guide

What you noticeSmallest next test
No green LEDReseat both cable ends and connect directly.
No portUse the supplied cable; unplug/replug and note what appears.
Missing FQBNSelect Arduino Uno and install Arduino AVR Boards.
Cannot open portClose Serial Monitor, reconnect, and select the reappearing port.
Upload succeeds; no blinkUpload this exact code with both delays at 1000.
LED stays onConfirm a LOW line follows HIGH and inspect both delays.
Red error textRead the first error and compare that line and the one above.

Show what you learned

You used setup() to prepare a job, loop() to repeat it, digitalWrite() to change an output, and delay() to control timing. Record what you changed, what failed, how you diagnosed it, and explain either loop() or STATUS_LED in your own words.

NEXT · LESSON 02

Build a Push-to-Shine Arduino Light

Parent guide

  • Prepare only the Uno, cable, notebook, and a dry work surface.
  • Let the child choose timing, press Upload, design the pattern, and explain it.
  • Resist taking over for a typo, a misplaced delay, or an imperfect safe pattern.
  • Step in for detection, permission, cable, or sustained-frustration problems.

Ask: “Point to the line that turns the LED on. Point to the line that makes it repeat. How would you make it wait longer after the third flash?” Award points for a tested build, correct explanation, deliberate change, and useful notebook note.