Tinkercad Simulation of LED Blinking

Objective

To simulate a simple LED Blinking circuit using Tinkercad, demonstrating the fundamental concept of digital output control with Arduino. The project will turn an LED ON and OFF at 1-second intervals using an Arduino Uno.

Circuit

Procedure

Step 1: Open Tinkercad and Create a New Circuit

  1. Go to Tinkercad.
  2. Sign in or create a new account.
  3. Click on “Circuits” and then “Create a new Circuit”.

Step 2: Add Components to the Workspace

  1. In the components panel, search for and drag the following items onto the workspace:
    1. Arduino Uno
    1. LED (Light Emitting Diode)
    1. Resistor (220Ω)
    1. Breadboard (optional but recommended)

Step 3: Connect the Circuit

  1. Connect the LED:

    1. Anode (+, longer leg) → Connect to pin 13 on the Arduino.
    1. Cathode (-, shorter leg) → Connect to one side of the 220Ω resistor.
    1. Other side of the resistor → Connect to GND (Ground) on Arduino.
  2. Your circuit is now complete!


Step 4: Write the LED Blinking Code

  1. Click on the “Code” button (or “Blocks + Text” and switch to “Text” mode).

Step 5: Simulate the LED Blinking

  1. Click the “Start Simulation” button.
  2. Observe the LED:
    1. It should turn ON for 1 second.
    1. Then turn OFF for 1 second.
    1. The cycle repeats indefinitely.


Code

void setup() {
  pinMode(13, OUTPUT); // Set pin 13 as an output
}

void loop() {
  digitalWrite(13, HIGH); // Turn LED ON
  delay(1000); // Wait for 1 second
  digitalWrite(13, LOW);  // Turn LED OFF
  delay(1000); // Wait for 1 second
}    

Program Logic And Explanation

This Arduino program controls an LED by making it blink ON and OFF every 1 second using digital output.


Program Logic:

  1. Setup the LED pin → Configure pin 13 as an output in setup().
  2. Turn LED ON → Set pin 13 to HIGH (5V) using digitalWrite(13, HIGH);.
  3. Wait for 1 second → Use delay(1000); to hold the LED in the ON state.
  4. Turn LED OFF → Set pin 13 to LOW (0V) using digitalWrite(13, LOW);.
  5. Wait for 1 second → Use delay(1000); to hold the LED in the OFF state.
  6. Repeat the cycle infinitely → Since loop() runs continuously, the LED blinks forever.

Code Explanation:

1. void setup() – Runs Once at the Start

void setup() {
  pinMode(13, OUTPUT); // Set pin 13 as an output
}
  • setup() is executed once when the Arduino starts.
  • pinMode(13, OUTPUT); sets pin 13 as an output pin, allowing it to control an LED.

2. void loop() – Runs Continuously

void loop() {
  digitalWrite(13, HIGH); // Turn LED ON
  delay(1000); // Wait for 1 second
  digitalWrite(13, LOW);  // Turn LED OFF
  delay(1000); // Wait for 1 second
}
  • loop() runs forever, executing the instructions inside it in sequence.
  • digitalWrite(13, HIGH); sets pin 13 to HIGH (5V) → LED turns ON.
  • delay(1000); makes the program pause for 1 second.
  • digitalWrite(13, LOW); sets pin 13 to LOW (0V) → LED turns OFF.
  • delay(1000); makes the program pause for another 1 second before restarting the cycle.

Output

  • The LED connected to pin 13 will turn ON for 1 second, then turn OFF for 1 second, repeating forever.

 

Leave a Comment

What is Self -Loathing and how we use it in sentense What does the name ‘Akaay’ signify, the chosen name for Virat and Anushka’s son? “Avert” : Meaning, Usage & Pro-Tips Know the Waffle Word Meaning and its Use 7 Einstein Quotes to Illuminate Your Life