Build a Smart Board
Cleaning Robot!
A super fun, step-by-step tutorial for kids to build an automatic whiteboard cleaner using Arduino. No experience needed!
What Does This Robot Do? 🤩
Tired of wiping the whiteboard by hand? Let's build a robot that does it automatically! This little robot slides along your classroom whiteboard, detects dirt using a sensor, and cleans it — all on its own!
Detects Dirt
Uses a sensor to find dirty spots on the whiteboard.
Auto Cleans
Motors move the cleaning sponge across the board.
Moves Back & Forth
Travels in rows — just like a lawnmower pattern!
Stops When Done
Knows when the board is clean and stops itself.
How Does It Work? 🧠
Here's the journey from a dirty board to a sparkly clean one, step by step:
Sensor Scans
IR sensor checks if board has marks
Arduino Thinks
Reads sensor signal, decides what to do
Motors Move
L298N drives wheels along the board
Sponge Cleans
Soft eraser wipes as robot moves
All Done!
Robot stops when board is clean
What You Need 🛒
Gather these parts before you start building. Most are cheap and easy to find online!
Arduino Uno
The brain of the robot. Runs the code.
2× DC Gear Motors
Moves the robot left and right across the board.
L298N Motor Driver
Tells motors how fast and which direction to go.
IR Sensor Module
Detects dark marker marks on the whiteboard.
9V Battery + Clip
Power source for the whole robot.
Strong Magnets (×4)
Stick the robot onto the whiteboard surface!
Soft Sponge / Eraser
The cleaning part! Attach to the front of the robot.
Chassis / Cardboard
The body. Use a small robot chassis kit or thick cardboard.
Jumper Wires
Connects everything together. Get male-to-male and female-to-male.
LED Indicator (optional)
Lights up green when cleaning, red when done. Super cool!
Budget Tip: You can get all these parts for about ₹600–₹900 (or $8–$12 USD) on Amazon or any local electronics shop. Ask a parent or teacher to help you order!
Wiring It All Together ⚡
Follow this diagram carefully. Each wire has a job to do — like roads in a city! Use the color guide below the diagram.
📌 Pin Connection Table
| Component | Pin / Terminal | Connects To | Notes |
|---|---|---|---|
| IR Sensor | VCC | Arduino 5V | Power for sensor |
| IR Sensor | GND | Arduino GND | Ground |
| IR Sensor | OUT | Arduino A0 | Signal output |
| L298N | IN1 | Arduino D8 | Motor A direction 1 |
| L298N | IN2 | Arduino D9 | Motor A direction 2 |
| L298N | IN3 | Arduino D10 | Motor B direction 1 |
| L298N | IN4 | Arduino D11 | Motor B direction 2 |
| L298N | ENA / ENB | 5V (jumper) | Always-on motors |
| L298N | 12V / VIN | Battery (+) | Main power |
| L298N | GND | Battery (–) + Arduino GND | Common ground |
| Motor Left | M+ / M– | L298N OUT A | Left wheel motor |
| Motor Right | M+ / M– | L298N OUT B | Right wheel motor |
Step-by-Step Instructions 🔨
Follow each step carefully. Take your time — good robots aren't built in a rush! 😄
Build the Robot Body 🏗️
The chassis is the skeleton of your robot. It holds everything together!
- Get a small robot chassis kit OR cut a rectangle (18 cm × 12 cm) from thick cardboard/acrylic.
- Attach the two DC gear motors to the bottom — one on each side (left and right).
- Add wheels to the motor shafts and make sure they spin freely.
- Attach 4 small strong magnets to the top edge so the robot sticks to the metal whiteboard frame rail.
- Hot-glue a soft sponge or whiteboard eraser to the front of the chassis.
Pro Tip: Make sure the sponge presses gently against the board surface — not too hard (motors strain) and not too loose (won't clean well).
Mount the Electronics 🔩
Now place the electronic parts on the chassis. Keep it tidy so wires don't tangle!
- Stick the Arduino Uno in the center of the chassis using double-sided tape or velcro.
- Mount the L298N motor driver next to the Arduino.
- Attach the IR sensor at the front, pointing toward the board surface.
- Place the 9V battery holder at the back for balance.
Wire the Motors ⚙️
Connect the motors to the L298N driver. This is how the robot gets its legs!
- Connect Left Motor's M+ wire → L298N OUT1, and M– → OUT2.
- Connect Right Motor's M+ wire → L298N OUT3, and M– → OUT4.
- If a motor spins backward, simply swap its two wires (M+ and M–).
- Check that ENA and ENB jumpers are in place (this keeps motors always active).
Be Careful: Never connect motors directly to Arduino pins! Always use the L298N driver. The Arduino can't handle the motor's power and will get damaged!
Wire the Motor Driver to Arduino 🔌
Now tell the Arduino how to talk to the L298N using digital pins!
- L298N IN1 → Arduino Pin D8 (orange jumper wire)
- L298N IN2 → Arduino Pin D9 (orange jumper wire)
- L298N IN3 → Arduino Pin D10 (purple jumper wire)
- L298N IN4 → Arduino Pin D11 (purple jumper wire)
- L298N GND → Arduino GND (black wire)
- L298N 12V → Battery positive (+) terminal
Connect the IR Sensor 👁️
The IR sensor is the robot's eyes — it sees the board marks!
- IR Sensor VCC → Arduino 5V (red wire)
- IR Sensor GND → Arduino GND (black wire)
- IR Sensor OUT → Arduino Pin A0 (pink wire)
- Point the sensor toward the whiteboard surface — about 1–2 cm away.
- Turn the little blue potentiometer on the sensor to adjust sensitivity.
Fun Fact: IR means Infrared — the same kind of light your TV remote uses! It bounces off the white board but gets absorbed by dark marker ink, so the sensor can tell them apart!
Upload the Arduino Code 💻
Now for the magic! Copy this code into the Arduino IDE and upload it to your board.
// ========================================================= // 🤖 Smart Board Cleaning Robot // By: Kids Robotics Club | Arduino Uno // ========================================================= // ── Pin Definitions ── const int IN1 = 8; // Motor A - direction pin 1 const int IN2 = 9; // Motor A - direction pin 2 const int IN3 = 10; // Motor B - direction pin 1 const int IN4 = 11; // Motor B - direction pin 2 const int IR_PIN = A0; // IR sensor output // ── Settings ── const int DIRTY_THRESHOLD = 500; // Value below = dirty board const int MOVE_TIME = 3000; // ms to move in one direction const int PAUSE_TIME = 800; // ms to pause before reversing // ── Setup (runs once) ── void setup() { pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT); Serial.begin(9600); Serial.println("🤖 Board Cleaner Robot Ready!"); } // ── Move Forward (left across board) ── void moveForward() { digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW); digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW); } // ── Move Backward (right across board) ── void moveBackward() { digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH); digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH); } // ── Stop All Motors ── void stopMotors() { digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); } // ── Main Loop (repeats forever) ── void loop() { int sensorValue = analogRead(IR_PIN); Serial.print("IR Value: "); Serial.println(sensorValue); if (sensorValue < DIRTY_THRESHOLD) { // 🧹 Board is dirty — start cleaning! Serial.println("Dirty! Cleaning..."); moveForward(); delay(MOVE_TIME); stopMotors(); delay(PAUSE_TIME); moveBackward(); delay(MOVE_TIME); stopMotors(); delay(PAUSE_TIME); } else { // ✅ Board is clean — stop and wait Serial.println("Clean! Resting..."); stopMotors(); delay(1000); } }
How to Upload: Open Arduino IDE → Paste the code → Select Board: Arduino Uno → Select the correct COM Port → Click the ➡️ Upload button. Open Serial Monitor to see the sensor readings live!
Test & Fine-Tune Your Robot! 🧪
Time to bring your robot to life! Here's how to test it properly:
- Write something on the whiteboard with a dark marker.
- Turn on the robot and place it on the board rail (magnets should grip the frame).
- Open Arduino Serial Monitor — you should see "Dirty! Cleaning..."
- Watch the robot move back and forth, wiping the board clean!
- If the sensor doesn't trigger: adjust the IR sensor's blue dial (potentiometer) slightly.
- If motors spin wrong direction: swap the motor wire connections on L298N.
- Once the board is clean, you should see "Clean! Resting..."
Level Up! Try adding multiple IR sensors for better coverage, or connect a buzzer that beeps when cleaning is done. You could even add a small water tank and wet sponge for deep cleaning!
Something Not Working? 🛠️
Don't worry! Every robot builder faces problems. Here are fixes for the most common issues:
Make It Even Cooler 🚀
Once your basic robot is working, try these awesome upgrades:
Bluetooth Control
Add an HC-05 Bluetooth module and control the robot from your phone!
Wet Cleaning Mode
Add a small water pump and reservoir for deep-cleaning stubborn marks.
Buzzer Alert
Beep when cleaning starts and play a melody when done!
LCD Display
Show "CLEANING..." or "BOARD CLEAN ✅" on a small 16×2 LCD screen.
Timer Mode
Set it to auto-clean every 30 minutes during class breaks.
WiFi Control
Use an ESP8266 module to control the robot from a web browser!

Comments
Post a Comment