Lab 1: Your First Blinking LED with Tinkercad

Your First Electronics Project!

Learn to make a blinking LED using a virtual Arduino in Tinkercad

Introduction

Welcome to the world of electronics! In this lab, you will learn the basics of building and programming a simple circuit without needing any physical parts. We will use a fantastic free tool called Autodesk Tinkercad.

What you will learn:

Part 1: Getting Started with Tinkercad

First, we need to set up your workspace.

  1. Open your web browser and go to www.tinkercad.com.
  2. If you have an account, click "Sign in". If you don't, ask your teacher for the class code or create a free personal account.
  3. Once you are logged in, you will be on your main dashboard. On the left-hand menu, click on "Circuits".
  4. Click the big green button that says "+ New" (or "Create new Circuit").

You should now see the Tinkercad Circuits editor. This is your virtual workbench!

Tinkercad Circuits workspace with the component panel on the right and the empty workplane in the center.
Quick Tour: The big empty space in the middle is your Workplane. The panel on the right is where you find all your Components.

Part 2: Building the Circuit

Now for the fun part! We will build a circuit to light up an LED. We need three components from the panel on the right:

  1. Add the Arduino: Find the "Arduino Uno R3" in the components list and drag it onto your workplane.
  2. Add the LED: Find the "LED" and drag it onto the workplane. Notice it has two legs. If you hover over them, one is named Anode (+) (the bent leg) and the other is Cathode (-) (the straight leg).
  3. Add the Resistor: Find the "Resistor" and drag it onto the workplane. We need to change its value. Click on the resistor, and a small window will pop up. Change the Resistance to 220 and make sure the unit is set to Ω (Ohms).
    Why a resistor? An LED can't handle the full power from the Arduino. The resistor limits the current, acting like a gatekeeper to protect the LED from burning out.
  4. Wire it all up! We will now connect everything with virtual wires. To create a wire, simply click on a connection point (it will highlight in red) and then click on another connection point.
    • Step A: Connect the resistor to the LED. Click on one end of the resistor and drag a wire to the Anode (+) leg of the LED.
    • Step B: Connect the resistor to the Arduino's power. Click on the other end of the resistor and drag a wire to the digital pin labeled 13 on the Arduino.
    • Step C: Connect the LED to the Arduino's ground. Click on the Cathode (-) leg of the LED and drag a wire to one of the pins labeled GND (which stands for Ground) on the Arduino.

Your final circuit should look something like this:

A complete circuit showing the Arduino Uno, with a wire from pin 13 to a resistor. The resistor is connected to the anode of an LED. The cathode of the LED is connected to the GND pin on the Arduino.

Part 3: Writing the Code

Now we need to tell the Arduino what to do. We'll write a simple program to turn the LED on and off.

  1. At the top right of the screen, click the "Code" button. The code editor will slide out.
  2. By default, Tinkercad uses a "Blocks" editor. This is perfect for beginners. If it says "Text" at the top, click the dropdown and change it to "Blocks".
  3. There might be some default blocks already there. You can drag them to the trash can icon to start fresh.
  4. The Logic: We want to create a program that does the following, forever:
    • Turn the LED ON.
    • WAIT for 1 second.
    • Turn the LED OFF.
    • WAIT for 1 second.
  5. Build the Block Code:
    • From the Output category (blue), drag the `set pin [0] to HIGH` block into the `forever` loop. Change the `0` to `13`, since that's the pin we connected our LED to. `HIGH` means ON.
    • From the Control category (orange), drag the `wait [1] seconds` block and place it right under the first block.
    • From the Output category again, drag another `set pin [0] to HIGH` block underneath the wait block. Change the `0` to `13` and change `HIGH` to `LOW`. `LOW` means OFF.
    • Finally, from the Control category, drag one more `wait [1] seconds` block and place it at the very bottom.

Your final block code should look like this:

Tinkercad block code. A 'forever' loop contains four blocks: set pin 13 to HIGH, wait 1 seconds, set pin 13 to LOW, wait 1 seconds.

Bonus: See the Real Code!

Click the "Blocks" dropdown menu at the top of the code panel and select "Blocks + Text". You will now see the text-based code (written in C++/Arduino) that your blocks created. This is what real-world Arduino programming looks like!

// C++ code
//
void setup()
{
  pinMode(13, OUTPUT);
}

void loop()
{
  digitalWrite(13, HIGH); // Turn the LED on
  delay(1000); // Wait for 1000 milliseconds (1 second)
  digitalWrite(13, LOW);  // Turn the LED off
  delay(1000); // Wait for 1000 milliseconds (1 second)
}

Part 4: Run Your Project!

This is the moment of truth. Let's run our simulation to see if it works.

  1. If the code panel is open, you can click the "Code" button again to hide it and see your full circuit.
  2. Click the "Start Simulation" button in the top right corner.

If everything is connected correctly, the small LED on your virtual circuit should start blinking on and off, once every second!

Congratulations!

You have successfully built and programmed your first electronic circuit. You are now officially a maker!

Troubleshooting

If it doesn't work, don't worry! This is a normal part of engineering. Click "Stop Simulation" and check these common issues:

Challenges & Next Steps

Now that you know the basics, try experimenting!