Summary of Introduction to Arduino Using TinkerCAD Simulator: No Hardware Required
This tutorial teaches Arduino basics using TinkerCAD (or optional hardware). It covers breadboard fundamentals, powering circuits, and five projects: single LED, blinking LED, pushbutton-controlled LED, servo control (with Serial monitoring), and temperature sensing (TMP36 in TinkerCAD, DHT11 for hardware). It explains Arduino IDE structure, common functions (pinMode, digitalWrite, analogRead/Write, delay, Serial.print), wiring conventions, and step-by-step build and code instructions.
Parts used in the Arduino Basics Workshop:
- Arduino Uno
- Breadboard
- LED
- Resistor (100 to 1k range)
- 10k resistor
- Push button
- Servo motor (micro servo)
- Jumper wires
- TMP36 temperature sensor (TinkerCAD)
- DHT11 temperature and humidity sensor (hardware)
You can learn the basics of Arduino without buying anything. Tinkercad Circuits is a free browser simulator with a virtual Arduino Uno, breadboard, LEDs, buttons, a servo and sensors. This guide builds five small circuits in order: an LED, a blinking LED, a push button, a servo and a temperature sensor. Each one adds a new idea. If you own an Uno, every step also works on real parts.
- No hardware is needed. Build in the Tinkercad Circuits simulator, or on a real Uno with the same wiring.
- Five circuits: LED, blink, push button, servo, temperature sensor.
- Every sketch has two functions:
setup()runs once,loop()repeats forever. - Six functions cover almost everything here:
pinMode,digitalWrite,digitalRead,analogRead,delayandSerial.print.
What you need
Pick one route. The simulator route needs only a computer and a free Tinkercad account. The hardware route needs the parts below. The Arduino IDE (free from arduino.cc) is used to write the code in both routes, so you learn the real tool.
Breadboard
LED
330 Ω resistor (100 Ω to 1 kΩ also works)
Push button
10 kΩ resistor (DHT11 only)
Micro servo
Jumper wires
DHT11 sensor (hardware route)
TMP36 (simulator route)
Breadboard basics in 60 seconds
- The long columns marked + and – along the edges are the power columns. All holes in one column are connected. The + column and the – column are not connected to each other.
- In the main area, the five holes of one short row on the same side of the middle gap (for example a to e) are connected.
- The gap in the middle breaks the connection, which lets a chip or push button sit across it with each side separate.
Circuit 1: Turn on an LED
Start in Tinkercad: open the dashboard, choose Circuits, then Create New Circuit. Drag an Arduino Uno and a breadboard onto the canvas. Wire the Uno’s 5V pin to the + column and one GND pin to the – column. On hardware, use jumper wires for the same two connections.
- Put the resistor so one leg is in the + column and the other leg is in a row of the main area.
- Put the LED so its anode (the longer leg) is in the same row as the resistor. Put the cathode (shorter leg, flat side of the LED body) in a different row.
- Connect the cathode’s row to the – column.
- Press Start Simulation (top right) in Tinkercad, or plug in the USB cable on hardware. The LED lights.
Circuit 2: Make it blink
Move the wire that was going to the 5V pin so it goes to digital pin 13. Now the Uno decides whether the LED gets 5 V (on) or 0 V (off). Write the code in the Arduino IDE (File, New) and test it. A sketch always has these two functions:
void setup()runs once when the sketch starts. Tell the board how each pin is used.void loop()runs again and again until power is removed.
// duino4projects.com
// Circuit 2: blink an LED on pin 13 once per second.
int LED = 13;
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH);
delay(500);
digitalWrite(LED, LOW);
delay(500);
}
In the IDE choose Tools, Board, Arduino Uno and, for real hardware, the correct port. Press Verify to compile, then Upload. In Tinkercad, click Code, switch from Blocks to Text, paste the sketch, and press Start Simulation. The compiled sketch is 936 bytes for the Uno.
The six functions you need
| Function | What it does | Example |
|---|---|---|
pinMode(pin, mode) |
Sets a pin as INPUT, OUTPUT or INPUT_PULLUP |
pinMode(13, OUTPUT); |
digitalWrite(pin, level) |
Sets an output pin to HIGH (5 V) or LOW (0 V) |
digitalWrite(13, LOW); |
digitalRead(pin) |
Reads HIGH or LOW from an input pin |
digitalRead(8) |
analogRead(pin) |
Reads a voltage from A0 to A5 as a number from 0 to 1023 | analogRead(A0) |
delay(ms) |
Waits that many milliseconds before the next line | delay(200); |
Serial.print(value) |
Sends text or a number to the serial monitor | Serial.print(78, HEX) shows 4E |
analogWrite(pin, value) (0 to 255) sets the duty cycle of a PWM signal on pins marked with a tilde, such as 3, 5, 6, 9, 10 and 11. It is how you dim an LED. Code tips: end each statement with a semicolon, keep capital letters exactly as written, and check you used the right pin number.
Numbers like 13 are easier to track when they have names. Put int LED = 13; above setup() and use LED everywhere, as the sketch above does. In Tinkercad, stop the simulation before you edit the code.
Circuit 3: A push button controls the LED
Keep the blink circuit. On hardware, unplug the USB cable first, because it is safer to change wiring with the power off. Place the push button across the middle gap of the breadboard. Connect one pin to digital pin 8 and a pin on the other side of the button to the – column (the two pins on the same side of a 4-pin button are already joined inside). Nothing else is needed, because the Uno has its own pull-up resistor.
INPUT_PULLUP holds the pin at HIGH until the button connects it to ground. That makes the button active low: pressed reads LOW, released reads HIGH.
// duino4projects.com
// Circuit 3: the LED on pin 13 lights while the push button on pin 8 is held down.
int LED = 13;
int Button = 8;
void setup() {
pinMode(LED, OUTPUT);
pinMode(Button, INPUT_PULLUP); // pressed = LOW, released = HIGH
}
void loop() {
if (digitalRead(Button) == LOW) {
digitalWrite(LED, HIGH);
} else {
digitalWrite(LED, LOW);
}
}
The if and else choose which path runs on each pass of loop(). This kind of statement is a control structure. Others you will use soon are for loops, while loops and else if. The sketch compiles to 900 bytes. In Tinkercad, hold the mouse button down on the push button to keep it pressed.
Circuit 4: Move a servo
A hobby servo turns to an angle you choose between 0 and 180 degrees. It has three wires. Use the micro servo in Tinkercad, or a small hobby servo on hardware.
| Servo wire | Colour | Connect to |
|---|---|---|
| Ground | Brown | GND |
| Power | Red | 5V |
| Signal | Orange (some servos use white) | Digital pin 11, a PWM pin marked with a tilde |
The Servo library does the timing for you. The sketch declares a Servo object, attaches it to pin 11 in setup(), then steps the angle in a for loop. A 500 ms delay lets you see each step, and Serial.println() shows each angle on the serial monitor (open it at 9600 baud). We compiled the blink, button and temperature sketches on this page for the Uno, but not this servo sketch, so run it in Tinkercad first and check it works before you rely on it.
// duino4projects.com
// Circuit 4: sweep a micro servo from 0 to 180 degrees in 5 degree steps and print each angle.
#include <Servo.h>
Servo myservo;
int servo_position;
void setup() {
myservo.attach(11);
Serial.begin(9600);
}
void loop() {
myservo.write(0);
for (int i = 0; i <= 180; i += 5) {
myservo.write(i);
delay(500);
servo_position = myservo.read();
Serial.println(servo_position);
}
}
Circuit 5: Read a temperature
Tinkercad has few environmental sensors, so the simulator route uses the TMP36, which gives an analog voltage that rises with temperature. On hardware you can use the TMP36 too, or a DHT11 that reports temperature and humidity.
TMP36 (simulator or hardware)
With the flat side of the TMP36 facing you, the legs from left to right are power, output and ground. Connect power to 5V, ground to GND and the output to A0. The sketch converts the 0 to 1023 reading to volts, then volts to degrees Celsius: the TMP36 outputs 0.5 V at 0 °C and adds 10 mV for each degree, so temperature is (voltage minus 0.5) times 100.
// duino4projects.com
// Circuit 5 (TinkerCAD): read a TMP36 on A0 and print the temperature in degrees Celsius.
int sensorPin = A0;
int reading;
float voltage;
float tempC;
void setup() {
Serial.begin(9600);
}
void loop() {
reading = analogRead(sensorPin);
voltage = (reading * 5.0) / 1024.0;
tempC = (voltage - 0.5) * 100.0;
Serial.print(tempC);
Serial.println(" C");
delay(500);
}
Open the serial monitor at 9600 baud. In Tinkercad, click the TMP36 during the simulation to change its temperature and watch the numbers follow. The sketch compiles to 3,186 bytes.
DHT11 (hardware)
The DHT11 comes either as a 4-pin part or as a 3-pin module on a small board. The module already has a 10 kΩ pull-up resistor. With the 4-pin part, add one 10 kΩ resistor between the power pin and the signal pin.
| DHT11 pin | Connect to |
|---|---|
| VCC | 5V |
| Signal (data) | Digital pin 7 (with the 10 kΩ resistor to VCC on the 4-pin part) |
| Ground | GND |
- In the Arduino IDE open Tools, Manage Libraries, search for DHT sensor library by Adafruit, and install it (accept the extra library it asks for).
- Open File, Examples, DHT sensor library, DHTtester.
- Set
DHTPINto 7 andDHTTYPEtoDHT11. - Upload and open the serial monitor. Breathe gently on the sensor: humidity and temperature should rise.
When something does not work
| Symptom | Likely cause | Fix |
|---|---|---|
| LED never lights | LED turned the wrong way, or wire in the wrong row | Swap the LED legs. Check that the resistor and LED share a row. |
| Compile error “expected ‘;'” | A semicolon is missing on the line above | Add it. Every statement ends with a semicolon. |
| Upload fails on hardware | Wrong board or port | Select Arduino Uno under Tools, Board and the right port under Tools, Port. |
| Button seems backwards | Pull-up logic: pressed is LOW | Test for == LOW, as in the sketch. |
| Serial monitor shows rubbish | Baud rate does not match | Set the monitor to 9600 to match Serial.begin(9600). |
| Servo twitches or the Uno resets | Servo draws more current than the USB port can give | Power the servo from a separate 5 V supply with a common ground. |
Project variants: more Tinkercad circuits
- Blink an LED With Arduino in Tinkercad: blink an LED in Tinkercad
- Digital Input With a Pushbutton With Arduino in Tinkercad: a pushbutton input in Tinkercad
- Fading LED With Arduino Analog Output in Tinkercad: a fading LED with analog output
- TMP36 Temperature Sensor With Arduino in Tinkercad: the TMP36 temperature sensor in Tinkercad
- Arduino Serial Monitor in Tinkercad: the serial monitor in Tinkercad
Related projects: next steps
- Create a Choice-based Text Adventure Game With Tinkercad Circuits: a choice-based text adventure game in Tinkercad
- Simon & Whack-a-Mole Game Using Arduino (also in Tinkercad): a Simon and Whack-a-Mole game
Quick answers
Check your own build
After each circuit, test one change on purpose: a different delay, a different pin, the opposite button logic. If the result matches what you predicted, you have understood the step. If not, check the wiring row by row against the breadboard rules above.
Project resources and downloads
- 🌐 Tinkercad Circuits
Web app. The free simulator used for the circuits on this page. - 📚 Arduino language reference
Web page. Every function used here, with examples. - 📚 Arduino IDE
Web page. The free editor and uploader. - 📚 Adafruit DHT sensor library
GitHub. The library and DHTtester example for the DHT11.
Quick Solutions to Questions related to Arduino Basics Workshop:
- Can I do this tutorial without physical hardware?
Yes; the tutorial uses the TinkerCAD simulator so no physical hardware is required. - What pin mode should be used for a button so it stays HIGH by default?
Use INPUT_PULLUP for the button pin so it is HIGH by default. - How do I wire an LED to be controlled by a digital pin?
Connect a resistor between the 5V (or pin) and the LED anode, place the cathode to ground, and connect the control pin (e.g., D13) to the LED circuit as instructed. - How do I make an LED blink in code?
Set the LED pin as OUTPUT in setup(), then use digitalWrite(pin, HIGH), delay(milliseconds), digitalWrite(pin, LOW), delay(milliseconds) inside loop(). - Which Arduino function reads an analog sensor value?
Use analogRead(pin) to read an analog sensor value. - How do I control a servo angle in Arduino?
Include the Servo library, create a Servo object, attach it to a PWM pin with attach(pin), and use myservo.write(angle). - What sensor is suggested for temperature in TinkerCAD and in hardware?
Use TMP36 in TinkerCAD and DHT11 for hardware testing. - How do I display servo position on the Serial Monitor?
Begin Serial at 9600 in setup(), read position with myservo.read(), and print it using Serial.print. - What is the formula to convert TMP36 reading to Celsius?
Compute voltage = (reading * 5.0) / 1024.0, then TempC = (voltage - 0.5) * 100.0.
