RRADIUS TUTOR
Robotics Lab / Experiment 01

Arduino LED Blink Simulator

Change the parameters, run the simulation and watch how an Arduino controls an LED. Switch between a virtual breadboard and a simplified circuit diagram.

● Beginner friendly

01   Experiment parameters

Yellow values in the code update automatically

02   Live circuit view

Arduino UNO breadboard circuit
Stopped · LED OFF
Cycle: 1.0 s · Frequency: 1.00 Hz

03   Arduino code

C++ / Arduino IDE
Highlighted values are linked to the parameters above. The code is generated for a real Arduino board.
// Experiment 01: Blink an LED
const int ledPin = 13;
const int onTime = 500;
const int offTime = 500;

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

void loop() {
  // Turn LED on
  digitalWrite(ledPin, HIGH);
  delay(onTime);

  // Turn LED off
  digitalWrite(ledPin, LOW);
  delay(offTime);
}
Yellow = user-controlled program value.
Understand the logic

04   How does the LED blink?

The Arduino repeats a simple ON → wait → OFF → wait sequence. Adjust the timings above and observe how the blink frequency changes.

1

Configure the pin

pinMode(ledPin, OUTPUT) sets digital pin 13 as an output.

2

Switch the LED ON

digitalWrite(HIGH) drives the pin high. The LED stays on for 500 ms.

3

Switch the LED OFF

digitalWrite(LOW) drives the pin low. The LED stays off for 500 ms.

4

Repeat continuously

The loop() function repeats. One cycle takes 1.0 s, giving 1.00 Hz.

Physics connection: The series resistor limits LED current. Assuming a 5 V output and approximately 2 V across a red LED, 220 Ω gives about 13.6 mA by Ohm's law, I ≈ (5 − 2) / R. This is an illustrative estimate; real current depends on the LED and board.