Arduino UNO Sensor & Output Starter Kit · kit manual Back to the kit
DIYKITKit manual
Learn · Build · Make

Arduino UNO Sensor & Output Starter Kit

LEDs, Buzzer, Servo, Ultrasonic & LCD
7 lessons · Beginner · 30-45 min setup, then 7 lessons of 25-60 min (about 5-6 hours in all)
Scan for code, photos & updates
diykit.ae/kits/arduino-uno-sensor-output-starter-kit-leds-buzzer-servo-ultrasonic-lcd

A beginner's Arduino UNO kit with a step-by-step path: Start here, then 7 lessons - LEDs, traffic light, buzzer, distance sensor, servo and LCD - ending in a Parking Assistant that uses every part. Each lesson has a wiring diagram, code and troubleshooting. Wiring design-reviewed and code compiler-checked; the complete physical assembly is not bench-tested. A separate 5V servo supply is recommended for the last lesson.

Read before you build. Wiring design-reviewed and firmware compiler-checked for Arduino UNO/ATmega328P. The complete physical assembly has not been bench-tested. Component revisions may differ. Disconnect power before rewiring; confirm all labels, polarity, pin order, and supply voltage before use. For reliable operation of the combined project, a separate regulated 5V supply for the SG90 is recommended; connect its GND to Arduino GND and do not join the positive 5V rails. Confirm the LCD header and backlight arrangement. Adult supervision is recommended.
What's in the box Tick each part as you unpack
1×UNO R3 Development Board ATmega328P Microcontroller with USB Cable
Board marked UNO with a square USB socket. The cable has a square plug at one end.
1×400 Tie Point Solderless Breadboard
White board with 400 holes and red and blue lines along the edges.
1×Jumper Wire Assorted Pack 120 Pieces
Rainbow ribbon of wires: male-male, male-female and female-female (10 cm).
1×RESISTOR ASSORTED 220-1K-10K
Small beige parts with coloured bands: 220 Ω red-red-brown, 1 kΩ brown-black-red, 10 kΩ brown-black-orange.
5×5MM LED R-Y-G
Red, yellow and green 5 mm LEDs. The longer leg is +.
1×Active Buzzer Module 5V DC
Small board with a round black buzzer and 3 pins.
1×HC-SR04 Ultrasonic Distance Sensor Module for Arduino
Board with two round "eyes" and 4 pins: VCC, TRIG, ECHO, GND.
1×SG90 9g Micro Servo Motor
Small motor with a 3-wire plug (brown, red, orange) and plastic arms.
1×10K Ohm Rotary Potentiometer PCB Type
Knob with 3 pins.
1×LCD 1602A Character Display Module
Display with 16 pins or holes along one edge.
DIYKITArduino UNO Sensor & Output Starter Kit · how to build this kit
How to build this kit Do these in order
1Check the box10 items. Tick each one off.Front page · What's in the box
2Get what is not in the box7 things to have ready, like a computer.This page · You also need
3Start here7 steps: set up the computer and upload Blink.Section 0 · Start here
4Do the lessons in order7, each with a diagram, steps, code and a fix-it table.Sections 1-7
5Stuck?Find what you see in the fault finder, then message us.Back pages · Fault finder, Stuck?
You also need not in the box
ItemForNote
A computer (Windows, macOS or Linux) where you can install the free Arduino IDE 2 - or a Chromebook with the Arduino Cloud EditorAll lessons
A free USB-A port, or an adapter, for the kit's USB cableAll lessons
An internet connection, to download the IDE and copy the codeStart here
A book or flat box, and a rulerLessons 4 and 7
A separate regulated 5V supply for the servo, with wiresLesson 7 - recommendedAdult help. Without it, do Lesson 7 without the servo.
A 16-pin header and solderingLesson 6 - only if your LCD has no pins fittedAdult only
A multimeterOptionalNo lesson needs one. Useful for an adult checking 5V and GND.
Your learning path
00Start here - set up and upload Blink
01Lesson 1: LED Basics & Brightness · 30 min
02Lesson 2: Traffic Light · 25 min
03Lesson 3: Buzzer Patterns · 25 min
04Lesson 4: Ultrasonic Distance · 30 min
05Lesson 5: Servo & Knob · 30 min
06Lesson 6: LCD Display · 45-60 min
07Lesson 7: Parking Assistant & Sensor Dashboard · 45-60 min
DIYKITArduino UNO Sensor & Output Starter Kit · your progress
Your progress Tick each step when it works
#Step and what you should seeDoneDate
1Start here: install the Arduino IDE, select Arduino Uno and your port, and upload Blink - the L light blinks.
2Lesson 1 - LED Basics & Brightness (30 min): the yellow LED blinks 3 times, then the knob fades it.
3Lesson 2 - Traffic Light (25 min): red, red + yellow, green and yellow on pins 2, 3 and 4.
4Lesson 3 - Buzzer Patterns (25 min): slow beep, fast alarm and SOS; type 0-3 to choose.
5Lesson 4 - Ultrasonic Distance (30 min): the distance as a live graph in the Serial Plotter.
6Lesson 5 - Servo & Knob (30 min): the servo arm follows the knob, then sweeps by itself.
7Lesson 6 - LCD Display (45-60 min): your name and a seconds counter on the LCD. Check the LCD has its pins fitted first.
8Lesson 7 - Parking Assistant (45-60 min): LEDs and buzzer by distance, LCD readout and servo gauge. Separate 5V servo supply recommended (adult help).
Online, for this kit Scan with a phone camera
Kit pageCode to copy or download, full-size diagrams, photos and updates.diykit.ae/kits/arduino-uno-sensor-output-starter-kit-leds-buzzer-servo-ultrasonic-lcd
SimulatorRun each lesson's code on screen before you wire it. No hardware needed.diykit.ae/kits/arduino-uno-sensor-output-starter-kit-leds-buzzer-servo-ultrasonic-lcd/simulator
Help on WhatsAppOpens WhatsApp with the help message ready to fill in.+971 50 125 3600
What the simulator does not show. It is a good first check of your code, but the real parts behave a little differently:
DIYKITArduino UNO Sensor & Output Starter Kit · before you build
Before you build Read once, come back any time

How the breadboard connects

These 5 holesare joinedA separate group:not joined across the gap+ rail (red line):joined along its lengthmiddle gap+−
  • Each short row of 5 holes is joined inside the board. Two legs in the same row are connected; legs in different rows are not.
  • The gap down the middle splits every row in two: the 5 holes on the left are not joined to the 5 on the right.
  • The long lines of holes along the edges are the rails. The one by the red line is + (5V) and the one by the blue line is − (GND). Each rail is joined along its whole length.
  • Some longer breadboards split the rails halfway. If a part on the far end gets no power, add a short wire across the split.

Reading the lesson diagrams

  • The thick red line is the + rail (5V) and the thick blue line is the − rail (GND). A wire that ends on a rail with a dot connects to that rail.
  • Signal wires have their own colours so you can tell them apart - in Lesson 2 each LED's wire matches the LED. Your jumper wires can be any colour.
  • A yellow square on the UNO header is a pin this lesson uses.
  • A dot means connected. Wires that cross without a dot do not touch.
  • The diagrams are drawn from the pin plan, not photographed from a tested build. The connection table under each one says the same thing in words - if they ever seem to disagree, ask us.

Which way round

  • LED: the long leg is + and goes towards the UNO pin (through the resistor). The short leg, on the flat edge of the rim, goes to the − rail.
  • Resistor: either way round. 220 Ω has the bands red-red-brown (then gold). If yours have 5 bands, 220 Ω is red-red-black-black. The lessons use only 220 Ω; the 1 kΩ (brown-black-red) and 10 kΩ (brown-black-orange) are spares.
  • Potentiometer: the middle pin is the signal. The two outer pins go to + and −, either way round (swapping them only reverses the knob).
  • Servo: brown is −, red is +, orange is the signal.
  • Buzzer, distance sensor and LCD: go by the labels printed next to the pins, not by position. LCD pin 1 is usually marked 1 or VSS.

Getting a lesson's code onto the UNO

  • Scan the lesson's QR code. On the lesson page press Copy, or Download .ino.
  • In the Arduino IDE choose File → New Sketch, select everything in the new window, and paste the code over it. (A downloaded .ino file can be opened with File → Open instead.)
  • Check the bottom of the window still says Arduino Uno and your port (Start here, step 5).
  • Click Upload (the → arrow) and wait for "Done uploading."
  • Typing the code from this manual works too - copy it exactly, including every ; and { }.

Serial Monitor and Serial Plotter

  • Some lessons print messages or numbers to the computer. Open Tools → Serial Monitor (text) or Tools → Serial Plotter (a live graph).
  • Set the speed in the corner of the window to 9600 baud - every lesson in this kit uses 9600.
  • Only one window can use the port at a time: close the Plotter before you open the Monitor, and close both if an upload says the port is busy.
DIYKITArduino UNO Sensor & Output Starter Kit · pin plan
One pin plan for every lesson

Every lesson uses this one pin plan, so a part wired in one lesson can stay where it is for the next. A dot means the lesson uses that pin. Lesson 7 uses everything at once.

UNO pinConnects to SL1L2L3L4L5L6L7Note
5V+ rail of the breadboard ●●●●●●● Powers the parts. In Lesson 7 the servo gets its own 5V supply instead.
GND− rail of the breadboard ●●●●●●● Shared ground. Every part and any extra supply joins here.
D0, D1Nothing - leave free The USB connection uses these two pins. Wires here can stop uploads.
D2Red LED, through 220 Ω ●●
D3 ~Yellow LED, through 220 Ω ●●● ~ means it can dim (PWM).
D4Green LED, through 220 Ω ●●
D5 ~Servo signal (orange wire) ●●
D6 ~Buzzer S (signal) ●● May be labelled I/O or IN.
D7LCD pin 12 (D5) ●●
D8HC-SR04 TRIG ●●
D9HC-SR04 ECHO ●●
D10LCD pin 11 (D4) ●●
D11LCD pin 6 (E) ●●
D12LCD pin 4 (RS) ●●
D13Built-in L light only ● Blink in Start here. Nothing is wired to it.
A0Potentiometer middle pin ●● In Lessons 6 and 7 the middle pin moves to LCD pin 3 (VO) for contrast.
A1LCD pin 13 (D6) ●● Used as a normal on/off pin.
A2LCD pin 14 (D7) ●● Used as a normal on/off pin.
A3, A4, A5Nothing - free Spare pins for your own ideas.

S = Start here · L1-L7 = Lessons. ~ marks a pin that can dim an LED or drive a servo (PWM). The same pins are in every lesson's diagram and code.

DIYKITArduino UNO Sensor & Output Starter Kit · start here
Start here

Follow these 7 steps before Lesson 1. They take about 30-45 minutes and prove that your computer, cable and UNO all work - so if something goes wrong later, you know it is the wiring, not the setup.

0 · Start here30-45 min · setup
1 · LED Basics & Brightness30 min
2 · Traffic Light25 min
3 · Buzzer Patterns25 min
4 · Ultrasonic Distance30 min
5 · Servo & Knob30 min
6 · LCD Display45-60 min
Extra equipment
Adult help
7 · Parking Assistant & Sensor Dashboard45-60 min
Extra equipment
Adult help

Lessons 1-5 need only the kit and a computer. Lesson 6 needs an adult only if your LCD has no pins fitted. Lesson 7 is the first that needs extra equipment: a separate 5V supply for the servo (recommended) - or do it without the servo.

Safety rules for every lesson.
DIYKITArduino UNO Sensor & Output Starter Kit · start here

1Check the parts

Safety: Small parts: keep them away from young children and pets.
Use the "What's in the box" checklist on the front page.
You should see: You have all 10 items listed below.
Something is missing or brokenSend us a photo with your order number on WhatsApp.
Breadboard: A white board full of holes that lets you connect parts without soldering.

2Check what else you need

See "You also need" on the "How to build this kit" page.
You should see: You have a computer, a free USB port and an internet connection. Lessons 1-6 need nothing else from outside the box (unless your LCD has no pins - see Lesson 6).

3Set up the computer

You should see: The Arduino IDE opens with a new, empty sketch that contains setup() and loop().
The download or install is blockedSchool and work computers often block installs. Ask an adult or use a home computer.
IDE: The program where you write code and send it to the UNO.
Sketch: An Arduino program.

4Connect the UNO with its USB cable

Safety: Put the UNO on a dry table, away from coins, paper clips and other metal - they can touch the pins underneath and cause a short.
You should see: A small power light on the UNO (marked ON or PWR) lights up. The light marked L may already be blinking - some boards come with Blink loaded.
No light at allPush the plug fully into the UNO. Try another USB port, then another cable.

5Select the board and the port

You should see: The bottom of the IDE window shows "Arduino Uno" and your port.
The Port menu is greyed out or emptySome USB cables only charge and carry no data. Try the kit's cable in another port, or another data cable.
Windows shows "USB2.0-Serial" or an unknown deviceLook at the small chip next to the UNO's USB socket. If it says CH340, the computer needs the free CH340 driver - ask us on WhatsApp and we'll send the link.
Mac: no new port appearsDo the same CH340 check. After installing a driver, you may need to allow it in System Settings → Privacy & Security.
Linux: "permission denied" on the portAsk an adult to add your user to the dialout group (sudo usermod -a -G dialout $USER), then log out and back in.
Port: The name your computer gives the USB connection to the UNO.

6Upload Blink

You should see: The small light marked L (next to pin 13) blinks: 1 second on, 1 second off.
Try it: Change both delay(1000) lines to delay(200) and upload again. The L light blinks five times faster. Now you know you can change code and upload it.
"can't open device" or "Access is denied"The port is busy or wrong. Close other Arduino windows, choose the port again (step 5) and try again.
"programmer is not responding"The wrong board or port is selected, or the cable carries no data. Check step 5 and try another cable.
A red "Compilation error"The example was changed by accident. Close it without saving and open Blink again from File → Examples.
"Done uploading" but L doesn't changeYour board may already have been running Blink. Do the change below (delay 200) and look for faster blinking.
Upload: Sending your sketch from the computer into the UNO. It stays there even after you unplug.
Compile: The IDE checks your sketch and turns it into code the UNO understands. It happens automatically before every upload.

7Continue to Lesson 1

You should see: You are ready to build.
DIYKITArduino UNO Sensor & Output Starter Kit · lesson 1 of 7
Lesson 1 · Basics

Lesson 1: LED Basics & Brightness

Beginner · 30 min
Make an LED blink, then turn a knob to fade it from off to full brightness. You will learn how to wire an LED safely and how the UNO can dim a light.
Code & parts
Time30 min
Do these firstStart here: Blink uploaded and the L light blinking
On your ownYou can do this lesson on your own. For your very first wiring, an adult nearby is a good idea.
Pins used5V + rail of the breadboardGND − rail of the breadboardD3 ~ Yellow LED, through 220 ΩA0 Potentiometer middle pin
You will learn
  • Which LED leg is + and which is −
  • Why every LED needs a resistor
  • digitalWrite(): switching a pin on and off
  • analogRead() and analogWrite(): reading a knob and dimming a light
Parts
UNO R3 + USB cable1
400-point breadboard1
Yellow LED1
220 Ω resistor (red-red-brown)1
10K potentiometer1
Male-to-male jumper wiresabout 7
How it works

An LED only works one way round: current goes in through the long leg (+) and out through the short leg (−). On its own it would take too much current, so a 220 Ω resistor always goes in line with it to protect the LED and the UNO pin.

digitalWrite(3, HIGH) puts 5 volts on pin 3 and the LED lights. LOW turns it off. That is how the 3 blinks at the start work.

The potentiometer is a knob. Its middle pin gives a voltage between 0 and 5V depending on how far you turn it, and analogRead(A0) turns that into a number from 0 to 1023.

The UNO cannot make "half a volt". Instead analogWrite() switches pin 3 on and off very fast (PWM). On for half the time looks half as bright. 0 is off, 255 is full brightness.

New words
Breadboard: A board with hidden metal strips inside. Parts pushed into the same short row of holes are connected to each other.
Rail: The long lines of holes along the edge of the breadboard. We use the red line (+) for 5V and the blue line (−) for GND.
GND: Ground: 0 volts. Every circuit needs a way back to GND.
Resistor: A part that limits current. 220 Ω has the colour bands red-red-brown.
Pin: A numbered connection on the UNO's black header strips, like pin 3 or A0.
PWM: Switching a pin on and off very fast. Pins with a ~ mark can do it, and it makes an LED look dimmer.
Wiring
Connection diagramConnection diagram drawn from the pin plan - not a photo of a tested build. The table says the same in words.
Part / pinConnect toNote
UNO 5V+ rail (red line)Powers the knob
UNO GND− rail (blue line)Shared ground for everything
UNO pin 3220 Ω resistor → yellow LED long leg (+)Pin 3 has a ~ mark, so it can dim
Yellow LED short leg (−)− rail (GND)
Potentiometer outer pin+ rail (5V)Either outer pin
Potentiometer other outer pin− rail (GND)
Potentiometer middle pinUNO A0On the lower header, by ANALOG IN
Step by step · tick each step as you finish it
  1. Unplug the USB cable from the computer.Watch out: Always unplug the USB cable before you add, move or remove a wire.
  2. Put the breadboard next to the UNO. Find the red (+) and blue (−) lines along its edge: those are the rails.
  3. Connect a jumper wire from the UNO 5V pin to the + rail, and one from a UNO GND pin to the − rail.
  4. Push the yellow LED into the breadboard so its two legs are in two different rows. Remember which row has the long leg.Watch out: The long leg is +. If the legs have been cut, look for the flat edge on the LED's rim: that side is −.
  5. Push one end of a 220 Ω resistor (red-red-brown) into the long-leg row and the other end into an empty row.Watch out: Every LED needs its resistor. Without it the LED or the UNO pin can be damaged.
  6. Connect a jumper wire from that empty row to UNO pin 3.
  7. Connect a jumper wire from the LED's short-leg row to the − rail.
  8. Push the potentiometer into the breadboard. Wire one outer pin to the + rail, the other outer pin to the − rail and the middle pin to A0.
  9. Check every wire against the diagram and the table, then plug the USB cable back in.Watch out: If anything gets hot or smells, unplug straight away.
  10. Copy the Lesson 1 code below into the Arduino IDE and click Upload (→).
  11. Watch the LED blink 3 times, then turn the knob slowly from one end to the other.
The code · lesson1_led_basics.ino

Easiest: scan the QR code above and press Copy or Download .ino on the lesson page, then paste it into the Arduino IDE and click Upload. The full listing is here for reading along.

/*
  DIY KIT - Arduino UNO Sensor & Output Starter Kit
  Lesson 1 of 7: LED Basics & Brightness

  WIRING (unplug the USB cable before you wire)
    Yellow LED long leg (+)  -> 220 ohm resistor -> UNO pin 3
    Yellow LED short leg (-) -> GND
    Potentiometer outer pins -> 5V and GND (either way round)
    Potentiometer middle pin -> UNO pin A0

  WHAT SHOULD HAPPEN
    1. The LED blinks 3 times. That proves the LED is wired the right way.
    2. Then turn the knob: the LED fades from off to fully bright.
*/

const int LED_PIN  = 3;    // the yellow LED. Pin 3 has a ~ mark, so it can dim (PWM)
const int KNOB_PIN = A0;   // the middle pin of the potentiometer
const int BLINK_MS = 300;  // how long each start-up blink lasts, in milliseconds

void setup() {
  pinMode(LED_PIN, OUTPUT);   // pin 3 sends power OUT to the LED
  Serial.begin(9600);         // talk to the computer (Serial Monitor at 9600 baud)
  Serial.println("Lesson 1: LED Basics & Brightness");

  // Part A: blink 3 times so you know the LED works.
  for (int i = 1; i <= 3; i++) {
    digitalWrite(LED_PIN, HIGH);  // HIGH = 5 volts = LED on
    delay(BLINK_MS);              // wait
    digitalWrite(LED_PIN, LOW);   // LOW = 0 volts = LED off
    delay(BLINK_MS);
  }
  Serial.println("Now turn the knob");
}

void loop() {
  // Part B: the knob sets the brightness.
  int knob = analogRead(KNOB_PIN);              // 0 at one end of the turn ... 1023 at the other
  int brightness = map(knob, 0, 1023, 0, 255);  // squeeze 0-1023 into 0-255
  analogWrite(LED_PIN, brightness);             // 0 = off, 128 = half, 255 = full

  // Two numbers the Serial Plotter can draw as lines.
  Serial.print("knob:");
  Serial.print(knob);
  Serial.print(",brightness:");
  Serial.println(brightness);

  delay(100);  // 10 readings a second is plenty
}
How the code works
const int LED_PIN = 3;Gives pin 3 a name. If you ever move the LED, you only change this number.
setup()Runs once when the UNO starts. It makes pin 3 an OUTPUT and blinks the LED 3 times with digitalWrite() and delay().
loop()Runs again and again: read the knob (analogRead), change 0-1023 into 0-255 (map), set the brightness (analogWrite).
Serial.print(...)Sends the two numbers to your computer. Open Tools → Serial Monitor or Serial Plotter at 9600 baud to see them.
Change it and see
Change: Change BLINK_MS from 300 to 100, then upload.
What happens: The 3 start-up blinks become three times faster.
Change: In map(), swap 0, 255 to 255, 0.
What happens: The knob works backwards: turning it "up" now makes the LED dimmer.
What you should see or hear
If it doesn't work
The LED never lights, not even the 3 blinksUnplug USB. The LED is probably the wrong way round: turn it so the long leg is in the resistor's row. Check the wire goes to pin 3 and the short leg reaches the − rail.
The LED blinks 3 times but the knob does nothingThe LED is fine. Check the potentiometer: middle pin to A0, outer pins to the + and − rails.
The LED is only fully on or fully offThe wire is on a pin without a ~ mark. Move it to pin 3.
The LED is very dim even at full brightnessCheck the resistor colours: red-red-brown is 220 Ω. Brown-black-orange is 10 kΩ, which is far too big.
The knob works backwardsNothing is wrong. Swap the two outer potentiometer wires if you prefer the other way.
The upload failsSee Start here, step 6: "If the upload fails".
Small experiment

Cover the LED with a sheet of paper and turn the knob up slowly. At what knob number (shown in the Serial Monitor) can you first see light through the paper?

Check what you learned
  1. Why does the LED need a resistor?
  2. Which leg of the LED is + (positive)?
  3. What number does analogRead() give at each end of the knob?
  4. Why must the LED be on a pin with a ~ mark to fade?
Answers: 1. To limit the current, so the LED and the UNO pin are not damaged. 2. The long leg. 3. 0 at one end and 1023 at the other. 4. Only those pins can do PWM, the fast on-off switching that analogWrite() uses to dim the LED.
In the simulator. In the simulator the LED and the knob slider behave like the real ones. The simulator does not check which way round the LED is or whether you used a resistor - on the real breadboard both matter.
Next
My notes   It worked   Date: ____________   What I changed in the code, and what happened:
DIYKITArduino UNO Sensor & Output Starter Kit · lesson 2 of 7
Lesson 2 · Basics

Lesson 2: Traffic Light

Beginner · 25 min
Three LEDs run the red → red + yellow → green → yellow cycle of a real traffic light. You will control several outputs and write your own function.
Code & parts
Time25 min
Do these firstLesson 1
On your ownYou can do this lesson on your own.
Pins used5V + rail of the breadboardGND − rail of the breadboardD2 Red LED, through 220 ΩD3 ~ Yellow LED, through 220 ΩD4 Green LED, through 220 Ω
You will learn
  • Controlling several outputs from one sketch
  • Timing with delay(): 1000 ms = 1 second
  • Writing your own function (showLights)
  • Reading messages in the Serial Monitor
Parts
UNO R3 + USB cable1
400-point breadboard1
Red, yellow and green LED1 each
220 Ω resistors (red-red-brown)3
Jumper wiresabout 8
How it works

Each LED has its own pin: red on 2, yellow on 3, green on 4. HIGH turns an LED on and LOW turns it off.

showLights() switches all three LEDs at once, prints the name of the phase and waits. loop() calls it four times, one full cycle, and then starts again.

The order is the one many countries use: red (stop), red + yellow (get ready), green (go), yellow (prepare to stop).

New words
Function: A named block of code you can run as often as you like, such as showLights(...).
Millisecond (ms): One thousandth of a second. delay(1000) waits 1 second.
Serial Monitor: A window in the Arduino IDE (Tools → Serial Monitor) that shows the text the UNO sends.
Wiring
Connection diagramConnection diagram drawn from the pin plan - not a photo of a tested build. The table says the same in words.
Part / pinConnect toNote
Red LED long leg (+)220 Ω → UNO pin 2
Yellow LED long leg (+)220 Ω → UNO pin 3Already wired in Lesson 1
Green LED long leg (+)220 Ω → UNO pin 4
All three short legs (−)− rail (GND)
UNO 5V / GND+ rail / − railAlready wired in Lesson 1
PotentiometerCan stay as in Lesson 1Not used in this lesson
Step by step · tick each step as you finish it
  1. Unplug the USB cable.Watch out: Always unplug the USB cable before you add, move or remove a wire.
  2. Leave the yellow LED and its resistor on pin 3 from Lesson 1.
  3. Add the red LED and a 220 Ω resistor the same way, and wire the resistor's free end to UNO pin 2.Watch out: Long leg towards the resistor.
  4. Add the green LED and a 220 Ω resistor, wired to UNO pin 4.Watch out: Long leg towards the resistor.
  5. Connect each LED's short leg to the − rail.
  6. Check the three LEDs against the diagram, plug in USB, copy the Lesson 2 code into the IDE and upload it.
  7. Open Tools → Serial Monitor at 9600 baud to see the name of each phase.
The code · lesson2_traffic_light.ino

Easiest: scan the QR code above and press Copy or Download .ino on the lesson page, then paste it into the Arduino IDE and click Upload. The full listing is here for reading along.

/*
  DIY KIT - Arduino UNO Sensor & Output Starter Kit
  Lesson 2 of 7: Traffic Light

  WIRING (unplug the USB cable before you wire)
    Keep the yellow LED from Lesson 1 on pin 3 and add two more:
    Red LED long leg (+)    -> 220 ohm resistor -> UNO pin 2
    Yellow LED long leg (+) -> 220 ohm resistor -> UNO pin 3
    Green LED long leg (+)  -> 220 ohm resistor -> UNO pin 4
    Every short leg (-)     -> GND rail of the breadboard
    The potentiometer from Lesson 1 can stay where it is.

  WHAT SHOULD HAPPEN
    Red (3 s) -> red + yellow (1 s) -> green (3 s) -> yellow (1.2 s) -> repeat.
*/

const int RED_PIN    = 2;
const int YELLOW_PIN = 3;
const int GREEN_PIN  = 4;

// How long each light stays on, in milliseconds (1000 ms = 1 second).
const unsigned long RED_MS        = 3000;  // stop
const unsigned long RED_YELLOW_MS = 1000;  // get ready
const unsigned long GREEN_MS      = 3000;  // go
const unsigned long YELLOW_MS     = 1200;  // prepare to stop

// Switch the three lights, tell the Serial Monitor, then wait.
// true = on, false = off.
void showLights(bool red, bool yellow, bool green, const char *name, unsigned long holdMs) {
  digitalWrite(RED_PIN, red ? HIGH : LOW);
  digitalWrite(YELLOW_PIN, yellow ? HIGH : LOW);
  digitalWrite(GREEN_PIN, green ? HIGH : LOW);
  Serial.println(name);
  delay(holdMs);
}

void setup() {
  pinMode(RED_PIN, OUTPUT);
  pinMode(YELLOW_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
  Serial.begin(9600);
  Serial.println("Lesson 2: Traffic Light");
}

void loop() {
  showLights(true,  false, false, "RED",          RED_MS);
  showLights(true,  true,  false, "RED + YELLOW", RED_YELLOW_MS);
  showLights(false, false, true,  "GREEN",        GREEN_MS);
  showLights(false, true,  false, "YELLOW",       YELLOW_MS);
}
How the code works
const int RED_PIN = 2; ...Names for the three LED pins.
const unsigned long RED_MS = 3000;How long each phase lasts, in milliseconds.
showLights(red, yellow, green, name, holdMs)Our own function: true means on, false means off. It also prints the phase name and waits holdMs.
loop()Four calls to showLights(): one full traffic-light cycle.
Change it and see
Change: Change GREEN_MS from 3000 to 6000.
What happens: The green light now stays on for 6 seconds.
Change: Add a fifth line in loop(): showLights(false, false, false, "ALL OFF", 500);
What happens: All the lights go dark for half a second at the end of each cycle.
What you should see or hear
If it doesn't work
One LED never lightsUnplug USB and turn that LED round (long leg towards the resistor). Check its wire goes to the right pin.
The wrong colour lights at the wrong timeTwo pin wires are swapped. Red must be on 2, yellow on 3, green on 4.
All the LEDs stay offCheck the − rail is connected to a UNO GND pin.
Nothing in the Serial MonitorSet the speed in the Serial Monitor to 9600 baud.
Small experiment

Use a stopwatch (or a phone) to time the green phase. Is it really 3 seconds? Change GREEN_MS and time it again.

Check what you learned
  1. How many milliseconds are there in 2.5 seconds?
  2. What does showLights(false, true, false, ...) switch on?
  3. Why does the cycle start again after yellow?
Answers: 1. 2500. 2. Only the yellow LED. 3. Because loop() runs over and over for ever.
In the simulator. The simulator shows the same lights with the same timing. Real LEDs only light if they are the right way round - the simulator does not check that.
Next
My notes   It worked   Date: ____________   What I changed in the code, and what happened:
DIYKITArduino UNO Sensor & Output Starter Kit · lesson 3 of 7
Lesson 3 · Basics

Lesson 3: Buzzer Patterns

Beginner · 25 min
The active buzzer plays a slow beep, a fast alarm and SOS in Morse code. Type a number in the Serial Monitor to choose the pattern.
Code & parts
Time25 min
Do these firstLesson 2
On your ownYou can do this lesson on your own.
Pins used5V + rail of the breadboardGND − rail of the breadboardD6 ~ Buzzer S (signal)
You will learn
  • What an active buzzer is
  • Active-high and active-low modules, and how to tell which you have
  • Sending commands from your computer to the UNO
  • Morse code in code
Parts
UNO R3 + USB cable1
Active buzzer module1
Male-to-female jumper wires3
How it works

The active buzzer beeps at one fixed pitch whenever it is switched on. The sketch only decides when and for how long: the rhythm is the message, like a smoke alarm.

Some buzzer modules beep when their signal pin is HIGH (active-high), others when it is LOW (active-low). BUZZER_ACTIVE_LOW in the code lets you match your module.

While a pattern plays, the sketch keeps checking for anything you type in the Serial Monitor. Type 1, 2 or 3 and press Enter to choose a pattern, or 0 for silence. Until you type something, it shows off each pattern for 6 seconds.

New words
Active buzzer: A buzzer with its own tone maker inside: switch it on and it beeps.
Module: A small board with a part already fitted and its pins labelled.
Baud: The speed of the serial connection. Both sides must use the same number - here 9600.
Wiring
Connection diagramConnection diagram drawn from the pin plan - not a photo of a tested build. The table says the same in words.
Part / pinConnect toNote
Buzzer S (signal)UNO pin 6May be labelled I/O or IN
Buzzer ++ rail (5V)May be labelled VCC
Buzzer −− rail (GND)May be labelled GND
Step by step · tick each step as you finish it
  1. Unplug the USB cable.Watch out: Always unplug the USB cable before you add, move or remove a wire.
  2. Read the three labels printed next to the buzzer module's pins (S, +, − or I/O, VCC, GND).
  3. With male-to-female jumper wires connect S to UNO pin 6, + to the + rail and − to the − rail.Watch out: Do not swap + and −.
  4. Plug in USB and upload the Lesson 3 code.
  5. Listen: pattern 1 is a slow beep. After 6 seconds it changes to a fast alarm, then SOS.
  6. Open Tools → Serial Monitor (9600 baud), type 3 in the message box and press Enter: SOS plays and stays on. Type 0 for silence.
The code · lesson3_buzzer_patterns.ino

Easiest: scan the QR code above and press Copy or Download .ino on the lesson page, then paste it into the Arduino IDE and click Upload. The full listing is here for reading along.

/*
  DIY KIT - Arduino UNO Sensor & Output Starter Kit
  Lesson 3 of 7: Buzzer Patterns

  WIRING (unplug the USB cable before you wire)
    Active buzzer module, using 3 male-to-female jumper wires:
      S (signal, may be labelled I/O or IN) -> UNO pin 6
      + (VCC)                               -> 5V
      - (GND)                               -> GND
    The LEDs and potentiometer from Lessons 1-2 can stay where they are.

  WHAT SHOULD HAPPEN
    The buzzer plays pattern 1 (slow beep), then 2 (fast alarm), then 3 (SOS),
    changing every 6 seconds. Open the Serial Monitor (9600 baud), type a
    number 0-3 and press Enter to choose a pattern yourself. 0 = silence.
*/

const int BUZZER_PIN = 6;

// Most modules beep when the pin is HIGH. If yours beeps in the gaps or
// all the time, change false to true and upload again.
const bool BUZZER_ACTIVE_LOW = false;

const unsigned long SLOW_ON_MS = 300, SLOW_OFF_MS = 700;  // pattern 1: slow warning
const unsigned long FAST_ON_MS = 80,  FAST_OFF_MS = 120;  // pattern 2: urgent alarm
const unsigned long DOT_MS     = 120, DASH_MS     = 360;  // pattern 3: SOS in Morse code
const unsigned long AUTO_CHANGE_MS = 6000;                // demo mode: next pattern every 6 s

int pattern = 1;                 // the pattern playing now (0-3)
bool demoMode = true;            // true until you type a number
bool newChoice = false;          // set when you type a number
unsigned long patternStarted = 0;

void buzzer(bool on) {
  if (BUZZER_ACTIVE_LOW) {
    digitalWrite(BUZZER_PIN, on ? LOW : HIGH);
  } else {
    digitalWrite(BUZZER_PIN, on ? HIGH : LOW);
  }
}

void announce() {
  Serial.print("Pattern ");
  Serial.print(pattern);
  if (pattern == 0)      Serial.println(": silence");
  else if (pattern == 1) Serial.println(": slow beep");
  else if (pattern == 2) Serial.println(": fast alarm");
  else                   Serial.println(": SOS");
  patternStarted = millis();
}

// Read anything typed in the Serial Monitor.
void readKeyboard() {
  while (Serial.available() > 0) {
    char c = Serial.read();          // one character at a time
    if (c >= '0' && c <= '3') {
      pattern = c - '0';             // the character '2' becomes the number 2
      demoMode = false;              // you chose: stop changing by itself
      newChoice = true;
      announce();
    }
  }
}

// Wait, but keep listening to the keyboard.
// Returns true if you typed a new pattern while waiting.
bool waitAndListen(unsigned long ms) {
  unsigned long start = millis();
  while (millis() - start < ms) {
    readKeyboard();
    if (newChoice) return true;
    delay(1);                        // a tiny pause before checking again
  }
  return false;
}

// One beep: on for onMs, then off for offMs. Returns true if interrupted.
bool beep(unsigned long onMs, unsigned long offMs) {
  buzzer(true);
  bool stop = waitAndListen(onMs);
  buzzer(false);
  if (stop) return true;
  return waitAndListen(offMs);
}

void playSOS() {
  for (int i = 0; i < 3; i++) if (beep(DOT_MS, DOT_MS)) return;   // S = . . .
  if (waitAndListen(DASH_MS)) return;
  for (int i = 0; i < 3; i++) if (beep(DASH_MS, DOT_MS)) return;  // O = - - -
  if (waitAndListen(DASH_MS)) return;
  for (int i = 0; i < 3; i++) if (beep(DOT_MS, DOT_MS)) return;   // S = . . .
  waitAndListen(1000);
}

void setup() {
  pinMode(BUZZER_PIN, OUTPUT);
  buzzer(false);
  Serial.begin(9600);
  Serial.println("Lesson 3: Buzzer Patterns - type 0, 1, 2 or 3 and press Enter");
  announce();
}

void loop() {
  newChoice = false;

  // Demo mode: move on to the next pattern every few seconds.
  if (demoMode && millis() - patternStarted > AUTO_CHANGE_MS) {
    pattern = pattern % 3 + 1;  // 1 -> 2 -> 3 -> 1
    announce();
  }

  if (pattern == 1)      beep(SLOW_ON_MS, SLOW_OFF_MS);
  else if (pattern == 2) beep(FAST_ON_MS, FAST_OFF_MS);
  else if (pattern == 3) playSOS();
  else {                 // pattern 0: silence
    buzzer(false);
    waitAndListen(100);
  }
}
How the code works
BUZZER_ACTIVE_LOWfalse for most modules. Change it to true if your buzzer beeps in the gaps instead of on the beeps.
buzzer(true / false)Our function that switches the buzzer on or off the right way for your module.
readKeyboard()Reads the characters you type. A digit 0-3 becomes the new pattern and stops the automatic demo.
waitAndListen(ms)Waits, but keeps checking the keyboard, so a new choice works straight away.
playSOS()Three short, three long, three short beeps: S-O-S in Morse code.
Change it and see
Change: Change FAST_ON_MS from 80 to 300.
What happens: Pattern 2 becomes a slower, longer beep.
Change: Change DOT_MS from 120 to 60.
What happens: SOS plays twice as fast.
What you should see or hear
If it doesn't work
The buzzer sounds all the time, or in the gapsYour module is active-low. Change BUZZER_ACTIVE_LOW to true and upload again.
No sound at allCheck S is on pin 6 and + is on the + rail (5V), not swapped with −.
Only a click, no beepThat is how a passive buzzer behaves. Ask us on WhatsApp: the kit should contain an active buzzer.
Typing a number does nothingClick in the Serial Monitor's message box, type the digit and press Enter. Check the speed is 9600 baud.
Small experiment

Look up the first letter of your name in Morse code. Copy playSOS(), rename it and change the dots and dashes to beep your letter.

Check what you learned
  1. What is the difference between an active and a passive buzzer?
  2. Which UNO pin is the buzzer's signal on?
  3. What does typing 0 do?
Answers: 1. An active buzzer makes its own tone when it is switched on; a passive one needs the UNO to make the tone. 2. Pin 6. 3. Pattern 0: silence.
In the simulator. In the simulator the buzzer shows when it is on, and you type numbers into the serial box under the code. The on-screen buzzer sounds when the pin is HIGH; if your real module turned out to be active-low, keep BUZZER_ACTIVE_LOW = false in the simulator.
Next
My notes   It worked   Date: ____________   What I changed in the code, and what happened:
DIYKITArduino UNO Sensor & Output Starter Kit · lesson 4 of 7
Lesson 4 · Sensing

Lesson 4: Ultrasonic Distance

Beginner · 30 min
Measure distance with sound. The HC-SR04 times an echo, the UNO turns it into centimetres, and the Serial Plotter draws it as a live graph.
Code & parts
Time30 min
Do these firstLesson 3
On your ownYou can do this lesson on your own.
Pins used5V + rail of the breadboardGND − rail of the breadboardD8 HC-SR04 TRIGD9 HC-SR04 ECHO
You will learn
  • How sonar works: sound out, echo back
  • Timing a pulse with pulseIn()
  • Why the middle (median) of 5 readings is steadier
  • Drawing live graphs with the Serial Plotter
Parts
UNO R3 + USB cable1
HC-SR04 distance sensor1
Jumper wires4
A book or flat box, and a ruler (yours)1
How it works

The HC-SR04 has two round "eyes": one sends a short burst of ultrasound, the other listens for the echo. The sketch starts a measurement with a 10 µs pulse on TRIG.

The sensor then keeps ECHO HIGH until the echo comes back. pulseIn() measures how long that was, in microseconds. Sound takes about 58 µs to go 1 cm and come back, so distance in cm = time ÷ 58.

Single readings sometimes jump. So the sketch also takes 5 readings, sorts them and keeps the middle one. Both numbers are printed, so you can compare them in the Serial Plotter.

New words
Ultrasound: Sound too high for people to hear. This sensor uses 40 kHz.
Echo: Sound that bounces back off an object.
Microsecond (µs): One millionth of a second.
Median: The middle value after sorting a list. One wild number cannot move it much.
Serial Plotter: Tools → Serial Plotter: draws the numbers the UNO sends as moving lines.
Wiring
Connection diagramConnection diagram drawn from the pin plan - not a photo of a tested build. The table says the same in words.
Part / pinConnect toNote
HC-SR04 VCC+ rail (5V)
HC-SR04 TRIGUNO pin 8
HC-SR04 ECHOUNO pin 9
HC-SR04 GND− rail (GND)
Step by step · tick each step as you finish it
  1. Unplug the USB cable.Watch out: Always unplug the USB cable before you add, move or remove a wire.
  2. Push the sensor into the breadboard with its two eyes facing out over the edge.
  3. Wire VCC to the + rail, TRIG to UNO pin 8, ECHO to UNO pin 9 and GND to the − rail.Watch out: Read the pin names on the sensor: VCC and GND must not be swapped.
  4. Plug in USB and upload the Lesson 4 code.
  5. Open Tools → Serial Plotter and set it to 9600 baud.
  6. Hold a book flat in front of the sensor. Move it slowly between 5 cm and 1 m and check a few readings with a ruler.
The code · lesson4_distance.ino

Easiest: scan the QR code above and press Copy or Download .ino on the lesson page, then paste it into the Arduino IDE and click Upload. The full listing is here for reading along.

/*
  DIY KIT - Arduino UNO Sensor & Output Starter Kit
  Lesson 4 of 7: Ultrasonic Distance

  WIRING (unplug the USB cable before you wire)
    HC-SR04 VCC  -> 5V
    HC-SR04 TRIG -> UNO pin 8
    HC-SR04 ECHO -> UNO pin 9
    HC-SR04 GND  -> GND
    Parts from Lessons 1-3 can stay where they are.

  WHAT SHOULD HAPPEN
    Open Tools > Serial Plotter (9600 baud). Move a book slowly towards and
    away from the sensor. Two lines follow it: raw_cm (jumpy) and
    median_cm (smoother). 0 means "no echo" - nothing in range.
*/

const int TRIG_PIN = 8;   // we send the "click" from here
const int ECHO_PIN = 9;   // the sensor answers on this pin

const unsigned long ECHO_TIMEOUT_US = 30000;  // give up after 30 ms (about 5 m there and back)
const int MIN_CM = 2;      // closer than this the sensor cannot measure
const int MAX_CM = 400;    // further than this is out of range
const int SAMPLES = 5;     // readings in each median - try 1 or 9
const unsigned long REPORT_MS = 250;  // a new line 4 times a second

// One measurement in centimetres, or 0 if no echo came back.
long readOnceCm() {
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);   // a 10-microsecond pulse starts the measurement
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  // pulseIn() times how long ECHO stays HIGH, in microseconds.
  unsigned long us = pulseIn(ECHO_PIN, HIGH, ECHO_TIMEOUT_US);
  if (us == 0) return 0;          // no echo

  // Sound goes there and back: 58 microseconds for every centimetre of distance.
  long cm = us / 58;
  if (cm < MIN_CM || cm > MAX_CM) return 0;
  return cm;
}

// Take several readings, sort them, keep the middle one (the median).
// One wild reading cannot move the middle value much.
long medianCm() {
  long v[SAMPLES];
  for (int i = 0; i < SAMPLES; i++) {
    v[i] = readOnceCm();
    delay(20);  // let the last echo die away
  }
  for (int i = 1; i < SAMPLES; i++) {   // sort, smallest first
    long key = v[i];
    int j = i - 1;
    while (j >= 0 && v[j] > key) {
      v[j + 1] = v[j];
      j--;
    }
    v[j + 1] = key;
  }
  return v[SAMPLES / 2];
}

void setup() {
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  Serial.begin(9600);
  Serial.println("Lesson 4: Ultrasonic Distance");
}

void loop() {
  long raw = readOnceCm();
  long smooth = medianCm();

  // "name:value,name:value" is the format the Serial Plotter draws.
  Serial.print("raw_cm:");
  Serial.print(raw);
  Serial.print(",median_cm:");
  Serial.println(smooth);

  delay(REPORT_MS);
}
How the code works
readOnceCm()Sends one pulse on TRIG, times the echo with pulseIn() and turns microseconds into centimetres (÷ 58). Returns 0 if no echo came back.
medianCm()Takes SAMPLES readings, sorts them and returns the middle one.
Serial.print("raw_cm:") ...Prints name:value pairs - the format the Serial Plotter draws as two labelled lines.
Change it and see
Change: Change SAMPLES from 5 to 1.
What happens: The median line becomes as jumpy as the raw line: with one reading there is nothing to sort.
Change: Change REPORT_MS from 250 to 1000.
What happens: The graph only updates once a second.
What you should see or hear
If it doesn't work
Always 0TRIG and ECHO are swapped, or VCC is not on the + rail. Check the 4 wires against the table.
Numbers jump aroundUse a flat, hard target held straight in front. Soft things (cushions, clothes) and slanted surfaces scatter the sound.
The plotter shows nothingCheck the speed is 9600 baud and the port is your UNO.
Readings far too bigThe sensor may be seeing something behind your target, like a wall. Move the target closer.
Small experiment

Point the sensor at a cushion and then at a book, at the same distance. Which gives steadier readings, and why?

Check what you learned
  1. Why do we divide by 58?
  2. What does a reading of 0 mean?
  3. Why is the median steadier than one reading?
Answers: 1. Sound takes about 58 µs to travel 1 cm to the target and 1 cm back. 2. No echo came back - nothing in range. 3. A single wild reading ends up at one end of the sorted list, not in the middle.
In the simulator. In the simulator you set the distance with a slider, so raw and median are always the same. Real echoes are noisier - that is why the median is there.
Next
My notes   It worked   Date: ____________   What I changed in the code, and what happened:
DIYKITArduino UNO Sensor & Output Starter Kit · lesson 5 of 7
Lesson 5 · Motion

Lesson 5: Servo & Knob

Beginner · 30 min
Turn the knob and the servo arm follows it. Leave the knob alone for 4 seconds and the servo starts sweeping by itself.
Code & parts
Time30 min
Do these firstLesson 1 (the knob is still wired to A0) · Lesson 4
On your ownYou can do this lesson on your own. Call an adult if the UNO keeps restarting.
Pins used5V + rail of the breadboardGND − rail of the breadboardD5 ~ Servo signal (orange wire)A0 Potentiometer middle pin
You will learn
  • How a servo holds an angle
  • Using map() to turn 0-1023 into 10-170 degrees
  • Using a library (Servo.h)
  • Switching between knob mode and automatic mode with millis()
Parts
UNO R3 + USB cable1
SG90 servo with one plastic arm1
10K potentiometer (from Lesson 1)1
Male-to-male jumper wires3
How it works

The servo has three wires: brown (−), red (+) and orange (signal). The UNO sends a short pulse on the signal wire every 20 ms, and the length of the pulse tells the servo which angle to hold. The Servo library does this for you: servo.write(90) means "go to 90 degrees".

The knob still gives 0-1023 on A0. map() turns that into an angle from 10 to 170 degrees.

The sketch remembers when the knob last moved. After 4 seconds without a change it starts sweeping by itself; turn the knob and you are back in control.

New words
Servo: A small motor with gears and a position sensor inside. You tell it an angle and it moves there and holds it.
Library: Ready-made code you include, like #include <Servo.h>. The Servo library comes with the Arduino IDE.
millis(): The number of milliseconds since the UNO started. Used here to tell how long the knob has been still.
Wiring
Connection diagramConnection diagram drawn from the pin plan - not a photo of a tested build. The table says the same in words.
Part / pinConnect toNote
Servo orange (signal)UNO pin 5Pin 5 has a ~ mark
Servo red (+)+ rail (5V)See the power warning in step 5
Servo brown (−)− rail (GND)
Potentiometer middle pinUNO A0Still wired from Lesson 1
Step by step · tick each step as you finish it
  1. Unplug the USB cable.Watch out: Always unplug the USB cable before you add, move or remove a wire.
  2. Press one small plastic arm onto the servo's shaft so you can see it move.Watch out: Don't fix anything else to the arm, and don't twist it by hand: that can strip the servo's plastic gears.
  3. Push three male-to-male jumper wires into the servo's plug. Connect orange to UNO pin 5, red to the + rail and brown to the − rail.
  4. Check the potentiometer's middle pin is still on A0.
  5. Plug in USB and upload the Lesson 5 code.Watch out: If the UNO's lights flicker, it keeps restarting or the servo twitches, unplug USB straight away and read "If it doesn't work".
  6. Turn the knob slowly. Then let go and wait 4 seconds.
The code · lesson5_servo_knob.ino

Easiest: scan the QR code above and press Copy or Download .ino on the lesson page, then paste it into the Arduino IDE and click Upload. The full listing is here for reading along.

/*
  DIY KIT - Arduino UNO Sensor & Output Starter Kit
  Lesson 5 of 7: Servo & Knob

  WIRING (unplug the USB cable before you wire)
    SG90 servo, using 3 male-to-male jumper wires in its plug:
      orange (signal) -> UNO pin 5
      red (+)         -> 5V
      brown (-)       -> GND
    Potentiometer (still wired from Lesson 1):
      outer pins -> 5V and GND, middle pin -> UNO pin A0
    Parts from Lessons 1-4 can stay where they are.

  POWER: fit only the small plastic arm - nothing else on the servo.
  If the UNO resets or the servo twitches, unplug USB and read the
  troubleshooting table on the lesson page.

  WHAT SHOULD HAPPEN
    Turn the knob: the arm follows it. Let go for 4 seconds: the arm
    sweeps back and forth by itself until you turn the knob again.
*/

#include <Servo.h>   // comes with the Arduino IDE - nothing to install

const int SERVO_PIN = 5;
const int KNOB_PIN  = A0;

const int MIN_ANGLE = 10;    // the servo's travel limits, in degrees
const int MAX_ANGLE = 170;   // (0 and 180 can make some servos buzz at the end)
const int SWEEP_STEP = 2;                      // degrees per step while sweeping
const unsigned long SWEEP_STEP_MS = 20;        // smaller = faster sweep
const unsigned long WAIT_BEFORE_SWEEP_MS = 4000;
const int KNOB_DEADBAND = 8;                   // ignore tiny wobbles of the knob

Servo servo;
int lastKnob = -1000;
unsigned long lastKnobMove = 0;
int sweepAngle = 90;
int sweepDirection = 1;        // +1 = counting up, -1 = counting down
unsigned long lastSweepStep = 0;

void setup() {
  servo.attach(SERVO_PIN);     // the Servo library now pulses pin 5 for us
  servo.write(90);             // start in the middle
  Serial.begin(9600);
  Serial.println("Lesson 5: Servo & Knob - turn the knob, or wait for the sweep");
}

void loop() {
  int knob = analogRead(KNOB_PIN);   // 0 ... 1023

  if (abs(knob - lastKnob) > KNOB_DEADBAND) {
    // The knob moved: the arm follows it.
    lastKnob = knob;
    lastKnobMove = millis();
    int angle = map(knob, 0, 1023, MIN_ANGLE, MAX_ANGLE);
    servo.write(angle);
    sweepAngle = angle;
    Serial.print("knob ");
    Serial.print(knob);
    Serial.print(" -> ");
    Serial.print(angle);
    Serial.println(" degrees");
  } else if (millis() - lastKnobMove > WAIT_BEFORE_SWEEP_MS && millis() - lastSweepStep > SWEEP_STEP_MS) {
    // Nobody touched the knob for 4 seconds: sweep by ourselves.
    lastSweepStep = millis();
    sweepAngle = sweepAngle + sweepDirection * SWEEP_STEP;
    if (sweepAngle >= MAX_ANGLE) { sweepAngle = MAX_ANGLE; sweepDirection = -1; }
    if (sweepAngle <= MIN_ANGLE) { sweepAngle = MIN_ANGLE; sweepDirection = 1; }
    servo.write(sweepAngle);
  }

  delay(10);
}
How the code works
#include <Servo.h>Loads the Servo library.
servo.attach(SERVO_PIN)Tells the library which pin the servo's signal wire is on.
map(knob, 0, 1023, MIN_ANGLE, MAX_ANGLE)Changes the knob number into an angle.
KNOB_DEADBANDIgnores tiny changes, so the servo doesn't jitter when nobody touches the knob.
millis() - lastKnobMove > WAIT_BEFORE_SWEEP_MSTrue when the knob has been still for 4 seconds: time to sweep.
Change it and see
Change: Change SWEEP_STEP_MS from 20 to 5.
What happens: The automatic sweep becomes much faster.
Change: Change MAX_ANGLE from 170 to 90.
What happens: The arm only moves through a quarter turn.
What you should see or hear
If it doesn't work
The UNO restarts, its lights flicker, or the servo twitchesUnplug USB. The servo is taking more current than the USB port gives. Try a USB port on the computer itself (not a hub). If it still happens, stop and ask an adult: Lesson 7 shows how to give the servo its own 5V supply.
The servo buzzes at the end of its travelSome servos can't reach the very end. Keep MIN_ANGLE at 10 and MAX_ANGLE at 170, or make the range smaller.
The servo doesn't move at allCheck orange is on pin 5, red on the + rail and brown on the − rail.
The knob works backwardsSwap the potentiometer's two outer wires.
Small experiment

Stick a small paper pointer on the arm and draw a scale behind it (10°, 90°, 170°). When the Serial Monitor says 90 degrees, does the pointer really point to the middle?

Check what you learned
  1. What are the three servo wires for?
  2. What does map() do here?
  3. How does the sketch know you stopped turning the knob?
Answers: 1. Brown is −, red is +, orange is the signal. 2. It changes the knob range 0-1023 into the angle range 10-170. 3. It compares millis() with the time the knob last moved.
In the simulator. The simulator moves the servo instantly and never runs short of power. A real servo needs time to move and draws bursts of current - which is why the power warning matters on the real board.
Next
My notes   It worked   Date: ____________   What I changed in the code, and what happened:
DIYKITArduino UNO Sensor & Output Starter Kit · lesson 6 of 7
Lesson 6 · Display

Lesson 6: LCD Display

Beginner · 45-60 min
Put "Hello" and your name on the top line of the LCD and a seconds counter on the bottom line. The knob becomes the contrast control.
Code & parts
Time45-60 min
Do these firstLesson 5
Adult help neededYou can do this lesson on your own if your LCD has its 16 pins fitted. If it has only holes, an adult must solder the pins first.
Not in the boxOnly if your LCD has no pins fitted: a 16-pin header and soldering (adult only)
Pins used5V + rail of the breadboardGND − rail of the breadboardD7 LCD pin 12 (D5)D10 LCD pin 11 (D4)D11 LCD pin 6 (E)D12 LCD pin 4 (RS)A1 LCD pin 13 (D6)A2 LCD pin 14 (D7)
You will learn
  • How a 16 × 2 character display works
  • Wiring a display with 6 signal wires (4-bit mode)
  • Setting the contrast with the potentiometer
  • setCursor() and print() with the LiquidCrystal library
Parts
UNO R3 + USB cable1
LCD1602 display1
10K potentiometer (moved from A0)1
220 Ω resistor (backlight)1
Jumper wiresabout 16
How it works

The LCD has its own controller chip. The UNO sends it letters over 4 data wires (D4-D7) and 2 control wires: RS (letter or command?) and E (read it now!). The LiquidCrystal library does all of this for you.

LCD pin 3 (VO) sets the contrast. The potentiometer's middle pin gives a voltage between 0 and 5V, so turning the knob makes the letters darker or lighter.

lcd.setCursor(column, row) chooses where to write: row 0 is the top line, row 1 the bottom. Numbers are printed with spaces in front, so old digits never stay behind.

New words
LCD: Liquid crystal display. This one shows 2 rows of 16 characters.
Contrast: How dark the letters are against the background. Too much and you see solid blocks; too little and you see nothing.
Backlight: The light behind the display. Its pins are 15 (A, +) and 16 (K, −).
Header pins: The row of metal pins that lets the LCD plug into the breadboard.
Wiring
Connection diagramConnection diagram drawn from the pin plan - not a photo of a tested build. The table says the same in words.
Part / pinConnect toNote
LCD 1 VSS− rail (GND)
LCD 2 VDD+ rail (5V)
LCD 3 VOPotentiometer middle pinMOVED from A0 - contrast
LCD 4 RSUNO pin 12
LCD 5 RW− rail (GND)
LCD 6 EUNO pin 11
LCD 7, 8, 9, 10NothingLeave empty
LCD 11 D4UNO pin 10
LCD 12 D5UNO pin 7
LCD 13 D6UNO A1Used as a normal pin
LCD 14 D7UNO A2Used as a normal pin
LCD 15 A (backlight +)220 Ω → + rail (5V)Always through the resistor
LCD 16 K (backlight −)− rail (GND)
Potentiometer outer pins+ rail and − railSame as before
Step by step · tick each step as you finish it
  1. Unplug the USB cable.Watch out: Always unplug the USB cable before you add, move or remove a wire.
  2. Look at the LCD: are there 16 metal pins along its top edge?Watch out: If there are only 16 holes, stop here and ask an adult to solder a 16-pin header. Wires just pushed into the holes will not make a reliable connection.
  3. Push the LCD into the breadboard so each of its 16 pins is in its own row. Find the small 1 and 16 printed next to the end pins.
  4. Wire the power: LCD pin 1 (VSS) to the − rail, pin 2 (VDD) to the + rail and pin 5 (RW) to the − rail.
  5. Wire the backlight: LCD pin 15 (A) through a 220 Ω resistor to the + rail, and pin 16 (K) to the − rail.Watch out: Always use the resistor on pin 15.
  6. Move the potentiometer's middle wire from A0 to LCD pin 3 (VO). Its outer pins stay on the + and − rails.
  7. Wire the six signal pins: LCD 4 (RS) → pin 12, 6 (E) → pin 11, 11 (D4) → pin 10, 12 (D5) → pin 7, 13 (D6) → A1, 14 (D7) → A2. Leave LCD pins 7-10 empty.
  8. Plug in USB. The backlight should glow. Turn the knob until you see a row of faint blocks on the top line.Watch out: If the backlight stays dark, unplug and check pins 15 and 16.
  9. Upload the Lesson 6 code, then turn the knob slowly until the text is sharp.
The code · lesson6_lcd.ino

Easiest: scan the QR code above and press Copy or Download .ino on the lesson page, then paste it into the Arduino IDE and click Upload. The full listing is here for reading along.

/*
  DIY KIT - Arduino UNO Sensor & Output Starter Kit
  Lesson 6 of 7: LCD Display

  WIRING (unplug the USB cable before you wire) - LCD pins are numbered 1-16
    LCD 1 VSS -> GND          LCD 2 VDD -> 5V
    LCD 3 VO  -> potentiometer middle pin (MOVE this wire from A0 - the knob
                 now sets the contrast; outer pins stay on 5V and GND)
    LCD 4 RS  -> pin 12       LCD 5 RW  -> GND       LCD 6 E -> pin 11
    LCD 7-10  -> nothing
    LCD 11 D4 -> pin 10       LCD 12 D5 -> pin 7
    LCD 13 D6 -> pin A1       LCD 14 D7 -> pin A2
    LCD 15 A  -> 220 ohm resistor -> 5V   (backlight +)
    LCD 16 K  -> GND                      (backlight -)

  WHAT SHOULD HAPPEN
    Top line:    Hello, Maker!
    Bottom line: Time:    12 s   (counting up)
    If you see nothing, or only blocks, turn the knob slowly.
*/

#include <LiquidCrystal.h>   // comes with the Arduino IDE - nothing to install

// The pins in this order: RS, E, D4, D5, D6, D7
LiquidCrystal lcd(12, 11, 10, 7, A1, A2);

const char NAME[] = "Maker";               // put your name here (up to 8 letters)
const unsigned long REFRESH_MS = 250;      // redraw 4 times a second
unsigned long lastRefresh = 0;

// Print a number in a fixed width, with spaces in front,
// so "9" does not leave the old "0" of "10" behind.
void printPadded(unsigned long value, int width) {
  String s = String(value);
  while ((int) s.length() < width) s = " " + s;
  lcd.print(s);
}

void setup() {
  lcd.begin(16, 2);          // 16 characters, 2 rows
  lcd.setCursor(0, 0);       // column 0, row 0 = top left
  lcd.print("Hello, ");
  lcd.print(NAME);
  lcd.print("!");
  Serial.begin(9600);
  Serial.println("Lesson 6: LCD Display");
}

void loop() {
  if (millis() - lastRefresh < REFRESH_MS) return;
  lastRefresh = millis();

  unsigned long seconds = millis() / 1000;

  lcd.setCursor(0, 1);       // column 0, row 1 = bottom line
  lcd.print("Time: ");
  printPadded(seconds, 5);
  lcd.print(" s");

  Serial.print("time_s:");
  Serial.println(seconds);
}
How the code works
LiquidCrystal lcd(12, 11, 10, 7, A1, A2);Tells the library which UNO pins go to RS, E, D4, D5, D6 and D7 - in that order.
lcd.begin(16, 2)The display has 16 columns and 2 rows.
lcd.setCursor(0, 1)Move to column 0 of row 1: the start of the bottom line.
printPadded(seconds, 5)Prints the number 5 characters wide, with spaces in front.
const char NAME[] = "Maker";The name on the top line. Up to 8 letters fit.
Change it and see
Change: Change "Maker" to your own name (8 letters or fewer).
What happens: The top line greets you by name.
Change: Change REFRESH_MS from 250 to 2000.
What happens: The counter only updates every 2 seconds, so it jumps by 2.
What you should see or hear
If it doesn't work
Backlight on, but no text and no blocksTurn the knob slowly all the way: the contrast is too low. Check LCD pin 3 goes to the knob's middle pin.
A row of solid blocks on the top linePower and contrast are fine but the signal wires are not. Check RS → 12, E → 11, D4 → 10, D5 → 7, D6 → A1, D7 → A2, and RW to GND.
Random or strange charactersA loose signal wire. Press the LCD firmly into the breadboard, then press the UNO's RESET button.
The backlight doesn't lightCheck pin 15 goes through the 220 Ω resistor to the + rail and pin 16 to the − rail.
The backlight is very dimSome LCDs already have their own backlight resistor, so with ours as well it is dimmer. That is safe. Ask an adult before removing any resistor.
Small experiment

Turn the knob slowly from one end to the other while the text is showing. Where do the letters disappear, and where do they turn into solid blocks?

Check what you learned
  1. Which LCD pin sets the contrast?
  2. What does lcd.setCursor(0, 1) do?
  3. Why are numbers printed with spaces in front?
Answers: 1. Pin 3 (VO). 2. Moves to the first character of the bottom line. 3. So a shorter number fully covers the longer one before it.
In the simulator. The simulator shows the LCD text only: it has no contrast knob or backlight, and it draws the display as an I2C module. Your kit's LCD is wired with 6 signal wires, exactly as in this lesson.
Next
My notes   It worked   Date: ____________   What I changed in the code, and what happened:
DIYKITArduino UNO Sensor & Output Starter Kit · lesson 7 of 7
Lesson 7 · Sensing

Lesson 7: Parking Assistant & Sensor Dashboard

Beginner · 45-60 min
The final build uses every part: green, yellow and red LEDs show how close an object is, the buzzer warns when it is too close, the LCD shows the distance and the servo swings like a gauge needle.
Code & parts
Time45-60 min
Do these firstLessons 1-6 (all the wiring stays in place)
Adult help neededThe LEDs, buzzer, distance sensor and LCD you can do on your own. The servo's separate power supply needs an adult.
Not in the boxRecommended: a separate regulated 5V supply for the servo, with wires to connect it (not in the box)
Pins used5V + rail of the breadboardGND − rail of the breadboardD2 Red LED, through 220 ΩD3 ~ Yellow LED, through 220 ΩD4 Green LED, through 220 ΩD5 ~ Servo signal (orange wire)D6 ~ Buzzer S (signal)D7 LCD pin 12 (D5)D8 HC-SR04 TRIGD9 HC-SR04 ECHOD10 LCD pin 11 (D4)D11 LCD pin 6 (E)D12 LCD pin 4 (RS)A1 LCD pin 13 (D6)A2 LCD pin 14 (D7)
You will learn
  • Combining inputs and outputs into one system
  • Making decisions with if and thresholds
  • Turning a distance into a gauge angle
  • Testing a system one part at a time
Parts
Everything from Lessons 1-6all
Separate regulated 5V supply for the servo, with wires (recommended, not in the box)1
How it works

Every loop the sketch measures the distance, works out the zone and updates everything: 25 cm or more is green, 10-24 cm is yellow, under 10 cm is red with the buzzer.

The same distance, limited to 5-50 cm, becomes a servo angle, so the arm moves like a fuel-gauge needle. The LCD shows the distance and the angle.

If no echo comes back, the LCD shows --, all the LEDs and the buzzer go off and the servo goes to the middle.

New words
Threshold: A number where the behaviour changes - here 10 cm and 25 cm.
Common ground: When two power supplies share the same GND, so the signal between them makes sense.
Wiring
Connection diagramConnection diagram drawn from the pin plan - not a photo of a tested build. The table says the same in words.
Part / pinConnect toNote
Red / yellow / green LED (each through 220 Ω)UNO pins 2 / 3 / 4From Lesson 2
Buzzer SUNO pin 6From Lesson 3
HC-SR04 TRIG / ECHOUNO pins 8 / 9From Lesson 4
LCD RS, E, D4, D5, D6, D7UNO pins 12, 11, 10, 7, A1, A2From Lesson 6
Potentiometer middle pinLCD pin 3 (VO)From Lesson 6
Servo orange (signal)UNO pin 5From Lesson 5
Servo red (+)Separate 5V supply +NEW - not the UNO 5V or the + rail
Servo brown (−)− rail (GND)
Separate supply GND− rail (GND)NEW - joins the grounds
Step by step · tick each step as you finish it
  1. Unplug the USB cable (and the servo supply, if you have one).Watch out: Always unplug the USB cable before you add, move or remove a wire.
  2. Check every part from Lessons 1-6 against the pin map: nothing needs to move.
  3. With an adult: move the servo's red wire from the + rail to the + of the separate 5V supply.Watch out: Never connect the supply's + to the UNO 5V pin or the + rail. Only the two GNDs are joined.
  4. Connect the supply's GND to the breadboard's − rail. The servo's brown wire stays on the − rail and orange stays on pin 5.
  5. No separate supply? Unplug the servo completely for now - everything else works without it.
  6. Plug in USB (and switch on the servo supply). Upload the Lesson 7 code.
  7. Turn the knob until the LCD text is sharp.
  8. Hold a book about 50 cm in front of the sensor and move it slowly towards it.
The code · lesson7_parking_assistant.ino

Easiest: scan the QR code above and press Copy or Download .ino on the lesson page, then paste it into the Arduino IDE and click Upload. The full listing is here for reading along.

/*
  DIY KIT - Arduino UNO Sensor & Output Starter Kit
  Lesson 7 of 7: Parking Assistant & Sensor Dashboard (uses every part)

  PIN PLAN - the same pins as Lessons 1-6, so nothing moves:
    Red LED    -> 220 ohm -> pin 2      Yellow LED -> 220 ohm -> pin 3
    Green LED  -> 220 ohm -> pin 4      (LED short legs -> GND)
    Servo signal (orange) -> pin 5      Buzzer S -> pin 6
    HC-SR04 TRIG -> pin 8, ECHO -> pin 9
    LCD RS 12, E 11, D4 10, D5 7, D6 A1, D7 A2; VO -> potentiometer middle pin

  SERVO POWER (ask an adult): the servo's red wire goes to a SEPARATE
  regulated 5 V supply, its brown wire to GND, and that supply's GND joins
  the UNO GND. Never join the supply's + to the UNO 5V pin.
  No supply? Leave the servo unplugged - everything else still works.

  WHAT SHOULD HAPPEN (hold a book in front of the sensor)
    25 cm or more : green LED          10-24 cm : yellow LED
    under 10 cm   : red LED + buzzer   LCD shows the distance and servo angle,
    and the servo arm swings like a gauge between about 5 and 50 cm.
*/

#include <Servo.h>
#include <LiquidCrystal.h>

const int RED_LED    = 2;
const int YELLOW_LED = 3;
const int GREEN_LED  = 4;
const int SERVO_PIN  = 5;
const int BUZZER_PIN = 6;
const int TRIG_PIN   = 8;
const int ECHO_PIN   = 9;

const long NEAR_CM = 10;   // closer than this: red LED + buzzer
const long SLOW_CM = 25;   // closer than this: yellow LED
const bool BUZZER_ACTIVE_LOW = false;   // same setting as Lesson 3

LiquidCrystal lcd(12, 11, 10, 7, A1, A2);   // RS, E, D4, D5, D6, D7
Servo gauge;

void buzzer(bool on) {
  if (BUZZER_ACTIVE_LOW) {
    digitalWrite(BUZZER_PIN, on ? LOW : HIGH);
  } else {
    digitalWrite(BUZZER_PIN, on ? HIGH : LOW);
  }
}

// Distance in cm, or -1 when no echo comes back (nothing in range).
long readDistanceCm() {
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);
  long us = pulseIn(ECHO_PIN, HIGH, 30000);
  if (us == 0) return -1;
  return us / 58;
}

// Light exactly one LED for the zone - or none when there is no reading.
void showZone(long cm) {
  bool valid = cm > 0;
  digitalWrite(RED_LED,    valid && cm < NEAR_CM);
  digitalWrite(YELLOW_LED, valid && cm >= NEAR_CM && cm < SLOW_CM);
  digitalWrite(GREEN_LED,  valid && cm >= SLOW_CM);
  buzzer(valid && cm < NEAR_CM);
}

// 5 cm -> 170 degrees ... 50 cm -> 20 degrees. No reading -> middle (90).
int gaugeAngle(long cm) {
  if (cm < 0) return 90;
  cm = constrain(cm, 5, 50);
  return map(cm, 5, 50, 170, 20);
}

void setup() {
  pinMode(RED_LED, OUTPUT);
  pinMode(YELLOW_LED, OUTPUT);
  pinMode(GREEN_LED, OUTPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  buzzer(false);

  lcd.begin(16, 2);
  lcd.print("Parking Assist");
  gauge.attach(SERVO_PIN);
  gauge.write(90);

  Serial.begin(9600);
  Serial.println("Lesson 7: Parking Assistant & Sensor Dashboard");
  delay(1000);
  lcd.clear();
}

void loop() {
  long cm = readDistanceCm();
  int angle = gaugeAngle(cm);

  showZone(cm);
  gauge.write(angle);

  lcd.setCursor(0, 0);
  lcd.print("Dist: ");
  if (cm < 0) {
    lcd.print("--      ");
  } else {
    lcd.print(cm);
    lcd.print(" cm    ");   // spaces wipe old digits
  }
  lcd.setCursor(0, 1);
  lcd.print("Servo: ");
  lcd.print(angle);
  lcd.print(" deg  ");

  Serial.print("dist_cm:");
  Serial.print(cm);
  Serial.print(",servo_deg:");
  Serial.println(angle);

  delay(200);
}
How the code works
NEAR_CM and SLOW_CMThe two thresholds: under 10 cm is "too close", under 25 cm is "slow down".
readDistanceCm()The Lesson 4 measurement. Returns -1 when no echo comes back.
showZone(cm)Lights exactly one LED for the zone and switches the buzzer on only when too close.
gaugeAngle(cm)5 cm → 170°, 50 cm → 20°: the closer the object, the further the needle swings.
lcd.print(" cm ")The extra spaces wipe out old digits when the number gets shorter.
Change it and see
Change: Change NEAR_CM from 10 to 15.
What happens: The red LED and the buzzer now start at 15 cm instead of 10 cm.
Change: Change delay(200) at the end of loop() to delay(50).
What happens: Everything updates four times faster.
What you should see or hear
If it doesn't work
Some parts work, others don'tGo back to that part's lesson and run its sketch: every lesson uses the same pins.
The UNO restarts when the servo movesStop. In this build the servo must not run from the UNO 5V. Use the separate supply, or unplug the servo.
The servo doesn't move with the supply connectedCheck the supply's GND is joined to the − rail (common ground) and that the supply is switched on.
The buzzer is on all the timeSet BUZZER_ACTIVE_LOW = true, as you found in Lesson 3.
The LCD is blank or shows blocksTurn the contrast knob, then recheck the Lesson 6 wiring.
Distance shows -- with a book in frontCheck TRIG is on pin 8 and ECHO on pin 9, and aim at a flat, hard target.
Small experiment

Make a parking space: tape a line on the table 10 cm from the sensor and push a toy car (or a box) towards it. Can you stop on the line using only the LEDs and the buzzer?

Check what you learned
  1. Which LED is on at 17 cm?
  2. Why does the servo get its own supply?
  3. Why must the two GNDs be joined?
Answers: 1. Yellow (10-24 cm). 2. It can draw more current than the UNO's USB power can safely give. 3. So the servo's signal and the UNO share the same 0V reference.
In the simulator. The simulator runs this sketch with every part on the bench and a distance slider. It does not model power: on screen the servo never resets the UNO, but on the real board it can - follow the power steps above.
Next
My notes   It worked   Date: ____________   What I changed in the code, and what happened:
DIYKITArduino UNO Sensor & Output Starter Kit · fault finder
Fault finder Find what you see, then turn to that page

Unplug the USB cable first. Every problem below has its fix in the table of the lesson or step named on the right.

Something is missing or brokenStart here, step 1
The download or install is blockedStart here, step 3
No light at allStart here, step 4
The Port menu is greyed out or emptyStart here, step 5
Windows shows "USB2.0-Serial" or an unknown deviceStart here, step 5
Mac: no new port appearsStart here, step 5
Linux: "permission denied" on the portStart here, step 5
"can't open device" or "Access is denied"Start here, step 6
"programmer is not responding"Start here, step 6
A red "Compilation error"Start here, step 6
"Done uploading" but L doesn't changeStart here, step 6
The LED never lights, not even the 3 blinksLesson 1
The LED blinks 3 times but the knob does nothingLesson 1
The LED is only fully on or fully offLesson 1
The LED is very dim even at full brightnessLesson 1
The knob works backwardsLesson 1
The upload failsLesson 1
One LED never lightsLesson 2
The wrong colour lights at the wrong timeLesson 2
All the LEDs stay offLesson 2
Nothing in the Serial MonitorLesson 2
The buzzer sounds all the time, or in the gapsLesson 3
No sound at allLesson 3
Only a click, no beepLesson 3
Typing a number does nothingLesson 3
Always 0Lesson 4
Numbers jump aroundLesson 4
The plotter shows nothingLesson 4
Readings far too bigLesson 4
The UNO restarts, its lights flicker, or the servo twitchesLesson 5
The servo buzzes at the end of its travelLesson 5
The servo doesn't move at allLesson 5
The knob works backwardsLesson 5
Backlight on, but no text and no blocksLesson 6
A row of solid blocks on the top lineLesson 6
Random or strange charactersLesson 6
The backlight doesn't lightLesson 6
The backlight is very dimLesson 6
Some parts work, others don'tLesson 7
The UNO restarts when the servo movesLesson 7
The servo doesn't move with the supply connectedLesson 7
The buzzer is on all the timeLesson 7
The LCD is blank or shows blocksLesson 7
Distance shows -- with a book in frontLesson 7
DIYKITArduino UNO Sensor & Output Starter Kit · words
Words in this kit A to Z, with where each one is first used
Active buzzer: A buzzer with its own tone maker inside: switch it on and it beeps. · Lesson 3
Backlight: The light behind the display. Its pins are 15 (A, +) and 16 (K, −). · Lesson 6
Baud: The speed of the serial connection. Both sides must use the same number - here 9600. · Lesson 3
Breadboard: A white board full of holes that lets you connect parts without soldering. · Start here
Common ground: When two power supplies share the same GND, so the signal between them makes sense. · Lesson 7
Compile: The IDE checks your sketch and turns it into code the UNO understands. It happens automatically before every upload. · Start here
Contrast: How dark the letters are against the background. Too much and you see solid blocks; too little and you see nothing. · Lesson 6
Echo: Sound that bounces back off an object. · Lesson 4
Function: A named block of code you can run as often as you like, such as showLights(...). · Lesson 2
GND: Ground: 0 volts. Every circuit needs a way back to GND. · Lesson 1
Header pins: The row of metal pins that lets the LCD plug into the breadboard. · Lesson 6
IDE: The program where you write code and send it to the UNO. · Start here
LCD: Liquid crystal display. This one shows 2 rows of 16 characters. · Lesson 6
Library: Ready-made code you include, like #include <Servo.h>. The Servo library comes with the Arduino IDE. · Lesson 5
Median: The middle value after sorting a list. One wild number cannot move it much. · Lesson 4
Microsecond (µs): One millionth of a second. · Lesson 4
millis(): The number of milliseconds since the UNO started. Used here to tell how long the knob has been still. · Lesson 5
Millisecond (ms): One thousandth of a second. delay(1000) waits 1 second. · Lesson 2
Module: A small board with a part already fitted and its pins labelled. · Lesson 3
Pin: A numbered connection on the UNO's black header strips, like pin 3 or A0. · Lesson 1
Port: The name your computer gives the USB connection to the UNO. · Start here
PWM: Switching a pin on and off very fast. Pins with a ~ mark can do it, and it makes an LED look dimmer. · Lesson 1
Rail: The long lines of holes along the edge of the breadboard. We use the red line (+) for 5V and the blue line (−) for GND. · Lesson 1
Resistor: A part that limits current. 220 Ω has the colour bands red-red-brown. · Lesson 1
Serial Monitor: A window in the Arduino IDE (Tools → Serial Monitor) that shows the text the UNO sends. · Lesson 2
Serial Plotter: Tools → Serial Plotter: draws the numbers the UNO sends as moving lines. · Lesson 4
Servo: A small motor with gears and a position sensor inside. You tell it an angle and it moves there and holds it. · Lesson 5
Sketch: An Arduino program. · Start here
Threshold: A number where the behaviour changes - here 10 cm and 25 cm. · Lesson 7
Ultrasound: Sound too high for people to hear. This sensor uses 40 kHz. · Lesson 4
Upload: Sending your sketch from the computer into the UNO. It stays there even after you unplug. · Start here
DIYKITArduino UNO Sensor & Output Starter Kit
Keep going

Every project in this kit uses the same parts, so you can combine them: add the display to a sensor project, or a buzzer to a measuring one. The project pages on diykit.ae have the code, the parts list and ideas to take each build further.

Stuck?

Most problems are one wire in the wrong hole. Check these first, then the lesson's "If it doesn't work" table:

  1. Unplug, then compare every wire with the lesson's diagram and table. One pin off is the most common problem.
  2. LEDs: is the long leg on the resistor side?
  3. Is the − rail connected to a UNO GND pin, and the + rail to 5V?
  4. Upload problems: is Tools → Board set to Arduino Uno and Tools → Port to your UNO? (Start here, step 5.)
  5. Read the lesson's "If it doesn't work" table and find the line that matches what you see.

Still stuck? Send us this message on WhatsApp with a photo of your wiring - scan the code to open WhatsApp with it already filled in:

Hi DIY KIT, I'm stuck on the Arduino UNO Sensor & Output Starter Kit. Lesson: __ Step number: __ What should happen: __ What happens instead: __ Error message (copied exactly): __ I'll attach a photo of my wiring.
WhatsApp help
Code, photos & updatesScan the QR code on the cover
Help on WhatsApp+971 50 125 3600
More kits & partsdiykit.ae
DIY KIT FZE LLC · Arduino UNO Sensor & Output Starter Kit · printed 31 Oct 2026