Build a Mini Vacuum Robot That Cleans Its Own Room!
Meet Sweepy — a miniature acrylic-and-MDF robot with a real Arduino Uno on top, twin ultrasonic "eyes," and a mini vacuum fan. It rolls around a tiny room, dodges furniture, and sucks up dust and paper bits while its OLED proudly displays "Cleaning..."
🌀 Say hi to Sweepy, your mini vacuum robot!
What Is a Smart Vacuum Robot, Anyway?
Real robot vacuums use sensors to "see" the room, motors to move around, and suction to pick up dirt — all without a person steering them. Sweepy works the same way on a mini scale: two ultrasonic sensors act as its eyes, two DC motors drive its wheels, and a small vacuum fan pulls light debris into a collection area, all controlled by a visible Arduino Uno mounted right on top of its acrylic body.
What You'll Need
Gather these parts before you start building Sweepy!
Arduino Uno
Mounted visibly on top — the brain of the whole robot.
Ultrasonic Sensors (HC-SR04)
Angled front-left and front-right to "see" obstacles.
DC Gear Motors + Wheels
Drive the robot forward, backward, and in turns.
L298N Motor Driver
Lets the Arduino safely control both drive motors.
Mini Vacuum Fan (5V DC)
Creates suction to pull in dust and paper bits.
0.96" I2C OLED Display
Shows live status like "Cleaning..." and "Obstacle!"
Acrylic or MDF Sheet
Laser-cut or hand-cut into the robot's round chassis layers.
Caster Wheel
A free-spinning third wheel for balance.
Small Buzzer
Beeps briefly whenever an obstacle is detected.
7.4V Battery Pack
Powers the motors and fan through the motor driver.
Jumper Wires + Breadboard
Connects every sensor, motor, and display.
The Circuit Diagram
Two ultrasonic sensors, two motors, a vacuum fan, an OLED, and a buzzer — all wired to one Arduino Uno.
Step-by-Step Build Instructions
We'll build the chassis first, then add the electronics layer by layer. Work with an adult on cutting and wiring the fan!
Cut the acrylic or MDF chassis
Cut a round or oval base plate plus a smaller top plate to hold the Arduino, leaving a cutout underneath for the vacuum fan and dust path.
Mount the motors, wheels, and caster
Attach the two DC gear motors on either side of the base with their wheels, and add a free-spinning caster wheel at the front or back for balance.
💡 Tip: Keep the two drive wheels symmetrical — an uneven robot will curve instead of driving straight!Install the vacuum fan and dust path
Mount the mini vacuum fan underneath, angled to pull air (and light debris) up from the floor into a small collection area or mesh bag.
Mount the Arduino and motor driver on top
Fix the Arduino Uno and L298N motor driver visibly on the top plate, so all the wiring is easy to see and troubleshoot.
Add the ultrasonic "eyes"
Mount the two ultrasonic sensors at the front, angled slightly outward (like eyes looking left-forward and right-forward) for wide obstacle coverage.
Add the OLED display and buzzer
Mount the OLED somewhere visible on top to show live status messages, and place the buzzer nearby for obstacle alerts.
Wire everything and test
Connect all sensors, motors, and the fan exactly as shown in the circuit diagram, upload the code, place Sweepy on a mini room floor with paper bits, and watch it clean!
The Arduino Code
This code needs the Adafruit_SSD1306 and Adafruit_GFX libraries for the OLED. Copy it into the Arduino IDE and click Upload.
// 🧹🤖 Sweepy the Smart Vacuum Robot — Arduino Robotics Project // Ultrasonic obstacle avoidance + real vacuum suction + OLED status #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> Adafruit_SSD1306 display(128, 64, &Wire, -1); // ---- Ultrasonic sensors ---- const int trigLeft = A0, echoLeft = A1; const int trigRight = A2, echoRight = A3; const int safeDistanceCM = 15; // ---- Left motor ---- const int leftIN1 = 7, leftIN2 = 8, leftENA = 9; // ---- Right motor ---- const int rightIN3 = 12, rightIN4 = 13, rightENB = 10; // ---- Fan + buzzer ---- const int fanPin = 6; const int buzzerPin = 2; void setup() { pinMode(trigLeft, OUTPUT); pinMode(echoLeft, INPUT); pinMode(trigRight, OUTPUT); pinMode(echoRight, INPUT); pinMode(leftIN1, OUTPUT); pinMode(leftIN2, OUTPUT); pinMode(leftENA, OUTPUT); pinMode(rightIN3, OUTPUT); pinMode(rightIN4, OUTPUT); pinMode(rightENB, OUTPUT); pinMode(fanPin, OUTPUT); pinMode(buzzerPin, OUTPUT); display.begin(SSD1306_SWITCHCAPVCC, 0x3C); analogWrite(fanPin, 200); // start the vacuum fan spinning showStatus("Cleaning..."); } void loop() { long distLeft = readDistanceCM(trigLeft, echoLeft); long distRight = readDistanceCM(trigRight, echoRight); bool blockedLeft = (distLeft > 0 && distLeft < safeDistanceCM); bool blockedRight = (distRight > 0 && distRight < safeDistanceCM); if (blockedLeft || blockedRight) { avoidObstacle(blockedLeft, blockedRight); } else { driveForward(); showStatus("Cleaning..."); } } // Stops, beeps, reverses a little, then turns away from the closer side void avoidObstacle(bool blockedLeft, bool blockedRight) { stopMotors(); tone(buzzerPin, 900, 150); showStatus("Obstacle! Turning..."); driveBackward(); delay(300); stopMotors(); if (blockedLeft && !blockedRight) { turnRight(); } else if (blockedRight && !blockedLeft) { turnLeft(); } else { turnRight(); // blocked on both sides — pick a direction } delay(400); stopMotors(); } void driveForward() { digitalWrite(leftIN1, HIGH); digitalWrite(leftIN2, LOW); digitalWrite(rightIN3, HIGH); digitalWrite(rightIN4, LOW); analogWrite(leftENA, 180); analogWrite(rightENB, 180); } void driveBackward() { digitalWrite(leftIN1, LOW); digitalWrite(leftIN2, HIGH); digitalWrite(rightIN3, LOW); digitalWrite(rightIN4, HIGH); analogWrite(leftENA, 160); analogWrite(rightENB, 160); } void turnLeft() { digitalWrite(leftIN1, LOW); digitalWrite(leftIN2, HIGH); digitalWrite(rightIN3, HIGH); digitalWrite(rightIN4, LOW); analogWrite(leftENA, 160); analogWrite(rightENB, 160); } void turnRight() { digitalWrite(leftIN1, HIGH); digitalWrite(leftIN2, LOW); digitalWrite(rightIN3, LOW); digitalWrite(rightIN4, HIGH); analogWrite(leftENA, 160); analogWrite(rightENB, 160); } void stopMotors() { analogWrite(leftENA, 0); analogWrite(rightENB, 0); } // Measures distance using an ultrasonic sensor long readDistanceCM(int trigPin, int echoPin) { digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); long duration = pulseIn(echoPin, HIGH, 20000); return duration * 0.034 / 2; } // Updates the OLED with the robot's current status void showStatus(String msg) { display.clearDisplay(); display.setTextSize(1); display.setTextColor(SSD1306_WHITE); display.setCursor(0, 25); display.println(msg); display.display(); }
How Does Sweepy Actually Work?
Here are the big robotics ideas hiding inside this project:
Two Sensors, Better Vision
With one ultrasonic sensor angled left and one angled right, Sweepy can tell which side an obstacle is on — not just that something is there — so it knows which way to turn.
Differential Drive
By spinning the left and right wheels in different directions or speeds, Sweepy can drive straight, turn in place, or curve — the same steering trick used in real robot vacuums.
Continuous Suction
The vacuum fan runs the whole time Sweepy is cleaning, using analogWrite() to control its speed through a transistor, since the Arduino pin alone can't power a fan directly.
Live Status Feedback
The showStatus() function updates the OLED every time the robot's behavior changes, so anyone watching always knows exactly what Sweepy is doing.
🧑🔬 Safety First!
- Build with an adult, especially when cutting acrylic/MDF and wiring the motor driver and fan.
- Keep fingers clear of the fan blades and wheels while the robot is powered on.
- Test on a clear, open mini-room floor first before adding paper bits, to make sure obstacle avoidance works reliably.
- This mini vacuum fan is for light dust and paper only — never test it near liquids or electronics.
- Sand any sharp edges on the cut acrylic or MDF chassis before handling.
Frequently Asked Questions
Why use two ultrasonic sensors instead of one?
A single sensor can only tell you "something is close," but two angled sensors let Sweepy compare distances on each side and choose the smarter direction to turn.
Can I control the fan speed?
Yes! Since the fan is connected through analogWrite(), you can change the number (0–255) in setup() to make suction stronger or gentler.
Why does the robot reverse before turning?
Backing up a little first gives Sweepy room to turn without bumping into whatever it just detected — the same habit real robot vacuums use.
What age group is this project good for?
Because it combines a physical chassis build with motors, sensors, and a display, this project is best for kids around age 10+ working closely with an adult.

Comments
Post a Comment