Introduction to Robotics: Build a Smart Recycling Robot is a beginner-friendly hands-on project designed to introduce students to the fundamentals of robotics. Through the construction of a simple smart recycling robot, participants explore how sensors, electronic components and basic automation can work together to create an interactive robotic system.
Begin by constructing the body of the recycling robot from a scaled technical drawing prepared in AutoCAD. Use a scale of 1:2 to translate the drawing into a physical model. Approximately 400 gsm card can be used for the main body, while recycled card can be used to construct the lid.
Install an ultrasonic sensor to detect a hand approaching the robot and connect an SG90 micro servo motor to operate the lid. An Arduino acts as the controller, processing the distance measured by the ultrasonic sensor and controlling the movement of the servo motor.
Using the Arduino IDE, program a detection distance—for example, 20 cm. When a hand is detected within this distance, the Arduino commands the servo motor to open the lid automatically. After the programmed sequence is completed, the lid returns to its closed position.
Experiment with different detection distances, servo angles and timing values to observe how changes in the program affect the physical behaviour of the robot.
By completing this project, you will explore several fundamental STEAM concepts, including:
• Reading and interpreting a scaled technical drawing
• Understanding scale and dimensions through a 1:2 model
• Constructing a physical prototype from card and recycled materials
• Understanding how an ultrasonic sensor measures distance
• Using an Arduino as the controller of a robotic system
• Controlling an SG90 micro servo motor
• Writing and modifying a simple program using the Arduino IDE
• Understanding the relationship between input, processing and output in an automated system
• Testing and adjusting parameters such as detection distance, servo angle and timing
Arduino board + USB cable — controller and programming connection
Ultrasonic sensor — detects an approaching hand and measures distance
SG90 micro servo motor — opens and closes the lid
Jumper wires — connects the electronic components
Computer with Arduino IDE — programs the Arduino
Approx. 400 gsm card — main robot body
Recycled card — lid
Popsicle stick — extends the servo horn to push the lid
Hot glue gun + glue sticks — assembly
Ruler and pencil — measuring and marking
Scissors — general cutting
Box cutter / craft knife — precise card cutting
1:2 scale technical drawing — construction guide
Print the provided 1:2 scale technical drawing on A4 paper. Use the drawing as a reference to transfer the dimensions onto a blank A3 sheet of approximately 400 gsm card, enlarging the dimensions according to the indicated scale.
Use a ruler and pencil to carefully mark the front, back, base, lid and side panels on the A3 card. Once the drawing has been transferred, carefully cut out the required sections and assemble the body using hot glue.
Download the Technical Drawing (PDF)
Print the drawing on A4 paper at 100% / Actual Size and use it as the 1:2 scale reference for transferring the design onto A3 card.
Safety: Take care when using craft knives and hot glue guns. Younger makers should work under appropriate adult supervision.
Position the ultrasonic distance sensor on the front of the robot, where it can detect a hand approaching the recycling bin. Carefully create the required opening and secure the sensor in position using hot glue.
Mount the Arduino Uno R3 and breadboard on the back of the robot. Keep the USB port of the Arduino accessible so that the board can easily be connected to a computer for programming and testing.
Position the SG90 micro servo motor near the lid so that its movement can be used to push the lid open. The final position may require some adjustment depending on the dimensions and movement of your lid.
Connect the ultrasonic distance sensor to the Arduino circuit using jumper wires and the breadboard.
• Connect VCC (+) on the sensor to the positive power rail (+) of the breadboard.
• Connect GND (−) on the sensor to the negative power rail (−) of the breadboard.
• Connect the Trig pin of the sensor to digital pin 2 on the Arduino Uno R3.
• Connect the Echo pin of the sensor to digital pin 3 on the Arduino Uno R3.
Check each connection carefully before powering the circuit. Incorrect wiring may prevent the sensor from operating correctly.
First, connect the Arduino Uno R3 to the breadboard power rails:
• Connect the 5V pin on the Arduino to the positive (+) power rail of the breadboard.
• Connect a GND pin on the Arduino to the negative (−) power rail of the breadboard.
Next, connect the SG90 micro servo motor:
• Connect the servo's positive (+) wire to the positive power rail.
• Connect the servo's negative (−) wire to the negative power rail.
• Connect the servo's signal/control wire to digital pin 9 on the Arduino Uno R3.
The breadboard power rails now provide the common 5V and ground connections used by both the servo motor and ultrasonic sensor.
Attach a popsicle stick to the servo horn to create a longer lever arm. Secure it firmly so that it moves together with the servo horn when the servo rotates.
Position the servo motor near the lid so that the extended arm can push the lid upward when the servo rotates. When the servo returns to its starting position, the lid should be able to return to the closed position.
Test the movement manually before finalising the position of the servo. Make sure that the arm can move freely and that it does not jam against the robot body or lid.
The exact position of the servo and the required rotation angle may vary slightly depending on how the robot body and lid were constructed. These values can later be adjusted in the Arduino program.
Open the Arduino IDE on your computer and connect the Arduino Uno R3 using the USB cable.
The program should continuously measure the distance between the ultrasonic sensor and nearby objects. In this project, a detection distance of approximately 20 cm is used as the activation zone.
The program follows this sequence:
Measure distance → Detect hand within 20 cm → Open lid → Wait 5 seconds → Close lid → Lock trigger → Wait for hand to move away → Reset trigger
The trigger lock prevents the robot from repeatedly opening and closing the lid while the same hand remains in front of the sensor.
The servo motor is moved gradually using loops, changing its position by approximately 1 degree at a time. In this program, a delay of 15 milliseconds is used while opening the lid and 10 milliseconds while closing it.
The detection distance, servo angles and timing values can be modified to experiment with the behaviour of the robot.
Connect the Arduino Uno R3 to the computer using the USB cable and open the program in the Arduino IDE.
Select the appropriate Arduino board and connection port. Use the Verify function to check the program for errors, then Upload the program to the Arduino.
Once the upload is complete, test the robot by slowly moving your hand towards the ultrasonic sensor.
When your hand enters the programmed detection zone, the servo motor should operate the mechanism and open the lid. After the programmed delay, the lid should close again.
Move your hand away from the sensor and test the robot several times to check that the system resets and responds consistently.
If the lid does not open or close correctly, adjust the servo angles in the program and test again until the movement matches the physical mechanism.
The following Arduino program controls the ultrasonic distance sensor and SG90 servo motor. The robot continuously measures the distance in front of the sensor and automatically opens the lid when an object is detected within approximately 20 cm.
Then the code from your workshop is:
#include <Servo.h>
Servo myServo;
const int trigPin = 2;
const int echoPin = 3;
long duration;
int distance;
bool triggered = false;
void setup() {
Serial.begin(9600);
myServo.attach(9);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
myServo.write(0);
Serial.println("Intelligent Smart Bin Ready");
}
void loop() {
// Ultrasonic trigger
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.034 / 2;
// Display distance
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
// OPEN ONLY ONCE
if (distance > 0 && distance < 20 && triggered == false) {
triggered = true;
Serial.println("Opening lid");
// Smooth OPEN
for (int pos = 0; pos <= 60; pos++) {
myServo.write(pos);
delay(15);
}
delay(5000);
Serial.println("Closing lid");
// Smooth CLOSE
for (int pos = 60; pos >= 0; pos--) {
myServo.write(pos);
delay(10);
}
}
// RESET trigger ONLY when hand moves away
if (distance >= 20) {
triggered = false;
}
delay(200);
}