Disaster Rescue Robot with Arduino!

Build a Disaster Rescue Robot with Arduino – Kids DIY Robotics Project | MakeMindz
🏆 Arduino Robotics · Beginner Friendly

Build a Disaster Rescue Robot with Arduino!

Learn robotics, coding, and electronics — by building a robot that can search through dangerous zones and avoid obstacles, just like real rescue robots!

⏱️ ~3 Hours 🧒 Ages 10+ 💰 ~₹800–₹1200 🔧 Beginner Level 🤖 Arduino Uno
🌟 What You'll Build

Your Very Own Rescue Robot!

Real rescue teams use robots to search inside collapsed buildings, flooded areas, and fire zones — places that are too dangerous for people to go. Today, you're going to build one!

Your robot will:

🚗

Drive around on its own

Using two DC motors and wheels, your robot moves forward and explores.

📡

Detect obstacles with a sensor

An ultrasonic sensor acts like bat sonar — bouncing sound waves to find walls and objects.

🔄

Dodge and avoid crashes

When it senses something in the way, it stops, turns, and finds a new path!

🔴

Flash a rescue signal LED

A blinking LED signals "I found a path!" just like a real rescue robot beacon.

🌍
Real World Connection!
NASA's Mars Rover, earthquake rescue robots, and firefighting drones all use similar sensor + motor logic. You're learning real engineering today!
1 Step 1 — Gather Your Parts

🛒 What You Need

Collect all these parts before you start. Most are available at electronics shops or online!

🟦
Arduino Uno
× 1
⚙️
L298N Motor Driver
× 1
🚗
DC Gear Motors + Wheels
× 2
📡
HC-SR04 Ultrasonic Sensor
× 1
🔋
9V Battery + Connector
× 1
🔴
Red LED
× 1
220Ω Resistor
× 1
🧩
Breadboard
× 1
🌈
Jumper Wires
× 20+
🛞
Caster Wheel (front)
× 1
📦
Cardboard / Chassis
× 1
💻
USB Cable + PC
× 1
⚠️
Ask a Grown-Up!
Always ask a parent or teacher before buying parts or connecting batteries. Safety first, robot second!
2 Step 2 — Build the Robot Body

🏗️ Assemble the Chassis

Your robot needs a body to carry all its parts. You can use a cardboard box, a plastic tray, or a proper robot chassis kit!

📐 Layout Plan

  ┌─────────────────────────────────┐
  │         TOP VIEW OF ROBOT       │
  │                                 │
  │   [Sensor]  ← Front facing      │
  │      📡                         │
  │  ┌─────────────────────────┐    │
  │  │     Arduino Uno 🟦      │    │
  │  │   + L298N Motor Driver  │    │
  │  │   + Breadboard          │    │
  │  └─────────────────────────┘    │
  │                                 │
  │  ⚙️ Motor L         Motor R ⚙️  │
  │  🛞 Wheel L         Wheel R 🛞  │
  │                                 │
  │         🔵 Caster Wheel         │
  │            (Back/Front)         │
  │                                 │
  │  🔋 Battery (underneath)        │
  └─────────────────────────────────┘

🔨 Assembly Steps

1️⃣

Attach the motors

Stick or screw the two DC motors on the left and right sides of your chassis.

2️⃣

Add wheels

Push the wheels onto the motor shafts. Make sure they're tight!

3️⃣

Mount the caster

Attach a small caster wheel at the front or back — it helps the robot balance and turn smoothly.

4️⃣

Place your electronics

Stick the Arduino, L298N, and breadboard on top using double-sided tape or velcro.

5️⃣

Mount the sensor at the front

The HC-SR04 sensor should face forward like two robot eyes!

3 Step 3 — Wire the Circuit

⚡ Circuit Wiring Guide

Now for the exciting part — connecting all the parts with wires! Follow the table carefully. Use different-coloured wires so it's easy to track.

💡
Pro Tip!
Use RED wires for positive (+) power, BLACK for ground (–), and other colours for signal wires. This helps you spot mistakes quickly!

📡 HC-SR04 Ultrasonic Sensor

Sensor Pin→ Connect ToColour Tip
VCCArduino 5V🔴 Red
GNDArduino GND⚫ Black
TRIGArduino Pin 9🟡 Yellow
ECHOArduino Pin 10🟢 Green

⚙️ L298N Motor Driver

L298N Pin→ Connect ToColour Tip
IN1Arduino Pin 2🔵 Blue
IN2Arduino Pin 3🟣 Purple
IN3Arduino Pin 4🔵 Blue
IN4Arduino Pin 5🟣 Purple
ENAArduino Pin 6 (PWM)🟠 Orange
ENBArduino Pin 11 (PWM)🟠 Orange
12VBattery + terminal🔴 Red
GNDBattery – terminal + Arduino GND⚫ Black
5V OUTArduino 5V (optional)🔴 Red
OUT1 / OUT2Left Motor wiresAny
OUT3 / OUT4Right Motor wiresAny

🔴 LED Rescue Signal

LED→ Connect ToNote
Long leg (+)Arduino Pin 13 via 220Ω resistorAlways use a resistor!
Short leg (–)Arduino GND

📊 Full Circuit Diagram

  ┌────────────────────────────────────────────────────┐
  │                  ARDUINO UNO                       │
  │                                                    │
  │  5V ──────────────────────── HC-SR04 VCC           │
  │  GND ─────────────────────── HC-SR04 GND           │
  │  Pin 9 ──── [TRIG] ──────── HC-SR04 TRIG           │
  │  Pin 10 ─── [ECHO] ──────── HC-SR04 ECHO           │
  │                                                    │
  │  Pin 2 ──── [IN1] ───┐                             │
  │  Pin 3 ──── [IN2] ───┤  L298N Motor Driver         │
  │  Pin 4 ──── [IN3] ───┤  ┌──────────────────┐      │
  │  Pin 5 ──── [IN4] ───┘  │  OUT1 ── Motor L │      │
  │  Pin 6 ──── [ENA] ──────┤  OUT2 ──┘        │      │
  │  Pin 11 ─── [ENB] ──────┤  OUT3 ── Motor R │      │
  │                          │  OUT4 ──┘        │      │
  │  GND ───────────────────┤  GND             │      │
  │                          │  12V ─── Battery+│      │
  │                          └──────────────────┘      │
  │                                                    │
  │  Pin 13 ─── [220Ω] ─── LED(+)                     │
  │  GND ──────────────────LED(–)                      │
  │                                                    │
  │  Power: 9V Battery ──► L298N ──► Arduino           │
  └────────────────────────────────────────────────────┘

  ⚙️ Left Motor ←─ L298N OUT1/OUT2
  ⚙️ Right Motor ←─ L298N OUT3/OUT4
  📡 Sensor faces FORWARD
  🔴 LED visible on TOP of robot
4 Step 4 — Upload the Code

💻 Arduino Code

Open the Arduino IDE on your computer, paste the code below, select your board (Arduino Uno) and port, then click the ➡️ Upload button!

💡
No IDE yet?
Download the free Arduino IDE from arduino.cc/en/software — it's available for Windows, Mac, and Linux!
  disaster_rescue_robot.ino
/*
 ================================================
   🤖 DISASTER RESCUE ROBOT — MakeMindz
   Obstacle-avoiding Arduino robot with
   ultrasonic sensor, dual motors & LED signal
 ================================================
*/

// ── PIN DEFINITIONS ──────────────────────────
#define TRIG_PIN   9    // HC-SR04 Trigger
#define ECHO_PIN   10   // HC-SR04 Echo
#define LED_PIN    13   // Rescue signal LED

#define IN1  2          // Left Motor
#define IN2  3
#define IN3  4          // Right Motor
#define IN4  5
#define ENA  6          // Left Motor Speed (PWM)
#define ENB  11         // Right Motor Speed (PWM)

#define SAFE_DISTANCE  20  // cm — stop if obstacle closer
#define MOTOR_SPEED   180  // 0–255 (PWM speed)

// ── SETUP ────────────────────────────────────
void setup() {
  // Motor pins
  pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT);
  pinMode(ENA, OUTPUT); pinMode(ENB, OUTPUT);

  // Sensor pins
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);

  // LED
  pinMode(LED_PIN, OUTPUT);

  Serial.begin(9600);
  Serial.println("🤖 Rescue Robot Online!");
}

// ── MEASURE DISTANCE (Ultrasonic) ────────────
long getDistance() {
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  long duration = pulseIn(ECHO_PIN, HIGH);
  long distance  = duration * 0.034 / 2;
  return distance;
}

// ── MOTOR CONTROL FUNCTIONS ───────────────────
void moveForward() {
  analogWrite(ENA, MOTOR_SPEED);
  analogWrite(ENB, MOTOR_SPEED);
  digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
  digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}

void stopMotors() {
  analogWrite(ENA, 0); analogWrite(ENB, 0);
  digitalWrite(IN1, LOW); digitalWrite(IN2, LOW);
  digitalWrite(IN3, LOW); digitalWrite(IN4, LOW);
}

void turnRight() {
  analogWrite(ENA, MOTOR_SPEED);
  analogWrite(ENB, MOTOR_SPEED);
  digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);  // Left forward
  digitalWrite(IN3, LOW);  digitalWrite(IN4, HIGH); // Right backward
}

void turnLeft() {
  analogWrite(ENA, MOTOR_SPEED);
  analogWrite(ENB, MOTOR_SPEED);
  digitalWrite(IN1, LOW);  digitalWrite(IN2, HIGH); // Left backward
  digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);  // Right forward
}

// ── RESCUE SIGNAL LED ─────────────────────────
void rescueSignal() {
  for (int i = 0; i < 3; i++) {
    digitalWrite(LED_PIN, HIGH); delay(100);
    digitalWrite(LED_PIN, LOW);  delay(100);
  }
}

// ── MAIN LOOP ─────────────────────────────────
void loop() {
  long dist = getDistance();

  Serial.print("Distance: ");
  Serial.print(dist);
  Serial.println(" cm");

  if (dist > 0 && dist < SAFE_DISTANCE) {
    // 🚨 OBSTACLE DETECTED!
    stopMotors();
    rescueSignal();           // Flash LED alert
    delay(300);

    // Choose a random turn direction
    if (random(2) == 0) {
      turnRight();
    } else {
      turnLeft();
    }
    delay(600);                // Turn for 600ms
    stopMotors();
    delay(200);

  } else {
    // ✅ PATH CLEAR — move forward!
    moveForward();
    digitalWrite(LED_PIN, HIGH);  // Steady LED = moving
  }

  delay(100);
}
5 Step 5 — How It Works

🧠 The Science Behind Your Robot

Let's break down the cool science happening inside your robot!

🔊

Ultrasonic Sound Waves

The HC-SR04 sends out a pulse of sound (too high for humans to hear!) and waits for it to bounce back. The time it takes tells us how far away an object is — just like how bats navigate in the dark!

📐

Distance Formula

The Arduino calculates: distance = duration × 0.034 / 2. Sound travels at 343 m/s, and we divide by 2 because the sound goes and comes back!

PWM Motor Control

Pulse Width Modulation (PWM) lets the Arduino control motor speed by switching power on and off very fast. 255 = full speed, 0 = stop. Pin 6 and 11 are PWM pins!

🧩

The L298N Motor Driver

The Arduino can't power motors directly (too weak!). The L298N acts as a power booster — it takes commands from Arduino and uses battery power to spin the motors.

🔴

The Resistor's Job

LEDs need limited current or they burn out! The 220Ω resistor acts like a tap — it controls how much electricity flows through the LED to keep it safe.

6 Step 6 — Test Your Robot!

🧪 Time to Test!

Before setting your robot free, test it step by step:

Open Serial Monitor

In Arduino IDE, open Tools → Serial Monitor at 9600 baud. You should see distance readings printing live!

Test the sensor

Put your hand in front of the sensor. Distance should decrease. Move it away — distance increases. 🎉

Test motors off the ground

Hold the robot in the air and power on. Both wheels should spin forward. Check direction!

Test the full robot

Put it on the floor. It should move forward until it detects something, then flash the LED and turn!

🔧
Robot Going in Circles?
Swap the wires on one motor (OUT1 and OUT2). If a wheel spins the wrong way, reversing the motor wires fixes it!
Level Up!

🚀 Upgrade Your Rescue Robot

Once your basic robot is working, try these awesome upgrades to make it even more powerful!

📷

Add a Camera

Use an ESP32-CAM module to add live video streaming — see what your robot sees!

🌡️

Temperature Sensor

Add a DHT11 sensor to detect heat — real rescue robots look for survivors using heat signatures!

📶

Bluetooth Control

Add an HC-05 Bluetooth module and control your robot from your phone using a free app!

🔊

Buzzer Alarm

Add a piezo buzzer that beeps when an obstacle is found — just like a real danger alarm!

❓ FAQ

Got Questions? We've Got Answers!

My robot isn't moving. What's wrong?
Check your battery connection first. Make sure the L298N is getting power (its green LED should be on). Then verify your IN1–IN4 pins are wired correctly. Open Serial Monitor — if you see distance values, the Arduino is working!
The robot keeps spinning and won't go straight.
One motor might be running backwards! Swap the two wires on that motor (e.g. swap OUT1 and OUT2 connections on the L298N). That reverses one motor direction to match the other.
The sensor shows 0 or wrong distances.
Make sure TRIG is on Pin 9 and ECHO is on Pin 10 (matching your code). Also check the sensor's VCC is connected to 5V, not 3.3V. Try pointing the sensor at a flat wall.
Can I use AA batteries instead of a 9V battery?
Yes! You can use a 4×AA battery pack (which gives 6V) but note that motor speed may be slightly lower. A 9V battery or a 2S LiPo gives better performance for the motors.
Do I need to know coding to do this project?
Not at all! Just copy the code as-is and upload it. As you get comfortable, you can start changing values like SAFE_DISTANCE or MOTOR_SPEED to see what happens. That's how real programmers learn!
🎓 You Did It!

🏅 What You Learned Today

📡
Ultrasonic Sensing
How sonar works
PWM Motor Control
Controlling speed
🧩
Circuit Building
Wiring electronics
💻
Arduino C++ Code
Functions & logic
🔧
Debugging Skills
Problem solving
🤖
Robotics Design
Real engineering!
🌟
Share Your Robot!
Built your rescue robot? Take a video and share it with friends and family. Tag it #MakeMindz — we'd love to see your creation! Every great engineer starts exactly where you are right now. 🚀

Made with ❤️ by MakeMindz · Inspiring the next generation of engineers, one robot at a time.

🤖 Arduino · Electronics · Robotics · STEM for Kids

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