Smart Automatic Board Cleaning Robot for Classroom | Kids DIY Robot Tutorial

Smart Automatic Board Cleaning Robot for Classroom | Kids DIY Robot Tutorial
🏫 Classroom Science Project

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!

⚡ Arduino Uno 🕹️ Beginner Friendly 🏫 Classroom Project 🤖 Robotics ⏱️ 2–3 Hours

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.

Arduino Uno 🧠 BRAIN D8 – Motor A IN1 D9 – Motor A IN2 D10 – Motor B IN1 D11 – Motor B IN2 A0 – IR Sensor OUT L298N Driver IN1 IN2 IN3 IN4 / ENA ENB OUT A → Motor Left OUT B → Motor Right 12V → Battery + GND → Battery – Motor LEFT DC Gear Motor Motor RIGHT DC Gear Motor IR Sensor VCC → 5V (Arduino) GND → GND OUT → A0 (Arduino) Detects board marks 🔍 9V Battery + → L298N 12V/VIN – → Common GND 🔋 Power Source ── COMMON GROUND BUS ── WIRE COLOR GUIDE Arduino → Motor Driver (A) Arduino → Motor Driver (B) IR Sensor → Arduino Common GND 🤖 Smart Board Cleaning Robot – Circuit Diagram

📌 Pin Connection Table

Component Pin / Terminal Connects To Notes
IR SensorVCCArduino 5VPower for sensor
IR SensorGNDArduino GNDGround
IR SensorOUTArduino A0Signal output
L298NIN1Arduino D8Motor A direction 1
L298NIN2Arduino D9Motor A direction 2
L298NIN3Arduino D10Motor B direction 1
L298NIN4Arduino D11Motor B direction 2
L298NENA / ENB5V (jumper)Always-on motors
L298N12V / VINBattery (+)Main power
L298NGNDBattery (–) + Arduino GNDCommon ground
Motor LeftM+ / M–L298N OUT ALeft wheel motor
Motor RightM+ / M–L298N OUT BRight wheel motor

Step-by-Step Instructions 🔨

Follow each step carefully. Take your time — good robots aren't built in a rush! 😄

1

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).

2

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.
3

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!

4

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
5

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!

6

Upload the Arduino Code 💻

Now for the magic! Copy this code into the Arduino IDE and upload it to your board.

🤖 board_cleaner_robot.ino
// =========================================================
// 🤖 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!

7

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:

🔴 Motors don't spin at all
Check if the battery is connected and has charge. Make sure ENA and ENB jumpers are on the L298N. Double-check that GND wires from the Arduino and the battery are all connected to the same GND pin on L298N.
🔵 Robot moves but goes the wrong way
Swap the M+ and M– wires on the motor that's going backward. Each motor has two wires — just flip them around on the L298N output terminals.
🟣 IR Sensor never triggers (always shows "Clean")
Turn the small blue potentiometer on the sensor with a screwdriver — slowly clockwise. Test with a dark marker mark on white paper first to calibrate. Also check the OUT wire is connected to A0, not a digital pin.
🟡 Robot doesn't stick to the board
Use stronger neodymium magnets. Make sure the whiteboard has a metal frame rail — the robot rides along that edge, not on the glass surface itself. You can also add a fishing line guide system.
🟢 Arduino upload fails
Make sure you selected the correct COM port in Arduino IDE → Tools → Port. Try a different USB cable (some are charge-only). Also check that "Arduino Uno" is selected under Board.
🔵 Sponge isn't cleaning well
Dampen the sponge slightly with water. Make sure it presses against the board with gentle consistent pressure. Try a softer sponge material or a felt eraser pad.

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!

Frequently Asked Questions ❓

What age group is this project for?
This project is perfect for students aged 10 and above. Younger kids (8–10) can build it with the help of a parent or teacher. It's a great school science fair project for grades 5 through 10!
Do I need coding experience?
No prior coding experience needed! The code is fully provided above. All you need to do is copy, paste, and upload it. The Arduino IDE is free to download and very beginner-friendly.
How much does it cost to build?
The total cost is approximately ₹600–₹900 in India or about $8–$15 USD. You can find all parts on Amazon, Robu.in, or any local electronics market.
Can this clean a blackboard too?
This design is specifically for whiteboards (the IR sensor works best on light surfaces). For a blackboard, you'd need to use a different sensor — like an ultrasonic distance sensor or a camera-based detector.
Is this safe for classroom use?
Yes! The robot uses a low 9V battery and moves slowly. Just make sure an adult supervises the first few runs. Keep the sponge damp (not soaking wet) to avoid any dripping near electronics.
🤖🧹✨

You Built a Real Robot — That's AMAZING!

Share your creation with your class, enter it in a science fair, or keep upgrading it. The best engineers started exactly where you are right now.

Made with ❤️ for curious kids everywhere  |  Smart Kids Robotics

Keywords: automatic whiteboard cleaner robot, Arduino classroom project, kids robotics DIY, board cleaning robot tutorial, school science project Arduino, smart eraser robot

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course