Disaster-Proof Smart House: Amazing Arduino Project (2026)
DIY Disaster-Proof Smart House : Complete STEM Project Using Arduino, Sensors and Servo Automation
The Disaster-Proof Smart House is a beginner-friendly STEM project that demonstrates how sensors and automation can help a miniature house respond to common dangers. Students build a small model house that can detect fire, water leakage and rain. When a danger is detected, the Arduino activates an appropriate safety response such as an alarm, warning LED or automatically closing the window.
The project combines electronics, sensors, programming, mechanical movement, problem-solving and disaster awareness in one simple interactive model.
Innovation
The project transforms an ordinary miniature house into a smart safety model. Instead of waiting for a person to notice a problem, the sensors detect changes and send information to the Arduino. The Arduino then makes a simple decision and activates the correct response.
Fire → Buzzer + Red LED
Water Leakage → Warning Buzzer/LED
Rain → Servo Closes Window
Learning Objectives
- Understand how sensors detect changes in the environment.
- Learn how an Arduino receives sensor information.
- Understand simple if-else decision making.
- Learn how a buzzer and LED can provide a warning.
- Understand how a servo motor can move a model window.
- Practice connecting components, uploading code, testing and troubleshooting.
- Connect STEM learning with disaster prevention and smart-home technology.
Materials Required for the smart house
- Arduino Uno or compatible board
- Flame sensor module
- Water leakage/water sensor module
- Rain sensor module
- SG90 servo motor
- Piezo buzzer
- Red LED
- 220 Ω resistor
- Breadboard
- Jumper wires
- USB cable
- 5V suitable power supply
- Cardboard or foam board for the house
- Small cardboard window
- Tape/hot glue
- Small water container/dropper for testing
Safety Notes
- Do not connect water to the Arduino, breadboard or exposed electrical connections.
- Keep the electronic parts away from the water-testing area.
- Use only low-voltage components suitable for the project.
- A child should not handle a real flame. Any flame-sensor demonstration must be controlled and supervised by an adult.
- Disconnect power before changing circuit connections.
- Do not connect a motor or other high-current load directly to an Arduino output pin.
Working Principle of Disaster-Proof Smart House
Hazard Detection → Sensor Reading → Arduino Decision → Automatic Safety Response
The flame sensor monitors for a flame, the water sensor detects water leakage, and the rain sensor detects water droplets. The Arduino reads these sensor signals and decides what action to take. If fire is detected, the buzzer and red LED turn on. If water leakage is detected, a warning is activated. If rain is detected, the servo rotates and closes the miniature window.
The Arduino acts as the brain of the smart house, while the sensors act as its detectors and the buzzer, LED and servo act as its response devices.
Detailed Step-by-Step Procedure
Step 1: Build the Miniature smart House — Make a simple smart house model using cardboard or foam board. Add a small window that can move. Leave enough space inside for the Arduino and breadboard.
Step 2: Connect the Arduino to the Computer — Connect the Arduino Uno to the computer using the USB cable. Install the Arduino IDE, select Arduino Uno and select the correct USB port. The Arduino IDE is used to write and upload the program to the board.
Step 3: Test the Arduino — Before connecting sensors, upload a simple Blink program to make the built-in LED turn on and off. This confirms that the computer and Arduino are communicating correctly.
void setup() { pinMode(LED_BUILTIN, OUTPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); }
Step 4: Connect the Flame Sensor — Connect VCC to 5V, GND to GND and the digital output (DO) to Arduino digital pin 2.
Step 5: Add the Fire Alarm — Connect the piezo buzzer to pin 8 and GND. Connect the red LED to pin 9 through a 220 Ω resistor, with the other LED leg connected to GND.
Step 7: Upload the Fire Alarm Program — C++ Program the Arduino to read the flame sensor. When the sensor detects the selected flame condition, the Arduino turns on the buzzer and red LED. Test the sensor carefully and only use a controlled flame demonstration with adult supervision.
Code:
int flameSensor = 2;
int buzzer = 8;
int redLED = 9;
void setup() {
pinMode(flameSensor, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(redLED, OUTPUT);
}
void loop() {
int flame = digitalRead(flameSensor);
if (flame == LOW) {
digitalWrite(buzzer, HIGH);
digitalWrite(redLED, HIGH);
}
else {
digitalWrite(buzzer, LOW);
digitalWrite(redLED, LOW);
}
}
Step 8: Connect the Water Sensor — Connect VCC to 5V, GND to GND and the analog output (AO) to Arduino analog pin A0.
Step 9: Test the Water Sensor — Upload a simple sensor-reading program and observe the value in the Serial Monitor. Compare the dry and wet readings. Choose a threshold between them so the Arduino can recognize water reliably.
int waterSensor = A0; void setup() { Serial.begin(9600); } void loop() { int waterValue = analogRead(waterSensor); Serial.println(waterValue); delay(500); }
Step 10: Add the Water Warning — Program the Arduino so that when the water reading passes the selected threshold, the warning buzzer or LED turns on. Place the sensor near the floor of the model house to represent a water leak.
int waterSensor = A0; int buzzer = 8; int warningLED = 9; void setup() { pinMode(buzzer, OUTPUT); pinMode(warningLED, OUTPUT); } void loop() { int waterValue = analogRead(waterSensor); if (waterValue > 300) { digitalWrite(buzzer, HIGH); digitalWrite(warningLED, HIGH); } else { digitalWrite(buzzer, LOW); digitalWrite(warningLED, LOW); } }
Step 11: Connect the Rain Sensor — Connect VCC to 5V, GND to GND and the digital output (DO) to Arduino digital pin 3.
Step 12: Attach the Servo — Connect the SG90 servo signal wire to Arduino pin 5. Connect its power and ground appropriately. Attach the servo horn to the cardboard window so that rotating the servo can close the window.
Step 13: Program the Rain-Proof Window — Program the Arduino to read the rain sensor. When rain is detected, the servo rotates to the closed position. When the sensor is dry, the servo returns to the open position.
Code:
#include <Servo.h> Servo windowServo; int rainSensor = 3; void setup() { pinMode(rainSensor, INPUT); windowServo.attach(5); windowServo.write(0); } void loop() { int rain = digitalRead(rainSensor); if (rain == LOW) { windowServo.write(90); } else { windowServo.write(0); } delay(200); }
Step 14: Combine the Three Systems — After testing each system separately, combine the fire alarm, water warning and rain-protection window into one Arduino program. The Arduino should continuously check all three sensors.
Step 15: Test One Danger at a Time — Test fire detection, water leakage and rain detection separately. Make sure each response works before testing multiple conditions.
Step 16: Test Multiple Conditions — Test combinations such as rain plus water leakage. Check that the Arduino can continue monitoring the different sensors and perform the appropriate actions.
Step 17: Arrange the Final House — Place the flame sensor near the front or side, the water sensor on the floor, the rain sensor on the roof, and the servo-controlled window on the side of the smart house. Keep the Arduino and electrical connections protected from water.
Step 18: Improve and Decorate — Label each safety system, tidy the wires and decorate the house. Students can add signs such as FIRE ALERT, WATER ALERT and RAIN DETECTED.
Simple Arduino Program
The following is a beginner example for the three-safety-system model. Pin assignments are: flame sensor D2, rain sensor D3, water sensor A0, buzzer D8, red LED D9 and servo D5.
The water threshold of 300 is only an example. The student should first compare dry and wet readings and adjust the threshold for the actual sensor.
After testing each section separately, you can combine them into one program.
For the example setup below:
- Flame sensor → Pin 2
- Rain sensor → Pin 3
- Water sensor → A0
- Temperature sensor → A1
- Buzzer → Pin 8
- Red LED → Pin 9
- Servo → Pin 5
- Fan driver → Pin 6
Complete Arduino Code for the smart house
#include <Servo.h> Servo windowServo; int flameSensor = 2; int rainSensor = 3; int waterSensor = A0; int buzzer = 8; int redLED = 9; void setup() { pinMode(flameSensor, INPUT); pinMode(rainSensor, INPUT); pinMode(buzzer, OUTPUT); pinMode(redLED, OUTPUT); windowServo.attach(5); windowServo.write(0); Serial.begin(9600); } void loop() { // Fire detection bool fireDetected = (digitalRead(flameSensor) == LOW); // Water detection int waterValue = analogRead(waterSensor); bool waterDetected = (waterValue > 300); // Rain detection bool rainDetected = (digitalRead(rainSensor) == LOW); // Fire OR water activates the warning if (fireDetected || waterDetected) { digitalWrite(buzzer, HIGH); digitalWrite(redLED, HIGH); } else { digitalWrite(buzzer, LOW); digitalWrite(redLED, LOW); } // Rain closes the window if (rainDetected) { windowServo.write(90); } else { windowServo.write(0); } Serial.print("Water value: "); Serial.println(waterValue); delay(500); }
How the Code Works in this smart house project
The Arduino repeatedly checks three sensors.
- It checks the flame sensor. If fire is detected, it marks fireDetected as true.
2. It reads the water sensor. If the reading is above the chosen threshold, waterDetected becomes true.
3. It checks the rain sensor. If rain is detected, the servo moves the window to the closed position.
4. The symbol || means OR. Therefore, if fire OR water is detected, the buzzer and red LED turn on.
5. If neither fire nor water is detected, the warning turns off.
6. The Arduino keeps repeating these checks so the house can respond continuously.
Conclusion
The Disaster-Proof Smart House demonstrates how simple sensors, programming and automation can work together to create a smart safety system. Students learn how an Arduino receives information from the environment and responds with an alarm, warning light or mechanical movement.
By building this Smart House model, students explore sensing, decision making, circuits, coding, servo movement and engineering design. The project also shows how STEM ideas can be used to think about safer and smarter homes.
Applications
The Disaster-Proof Smart House demonstrates how sensor-based automation can be used to improve safety in homes and buildings. Although this smart house project is a miniature model, the same basic ideas are used in real-world smart systems.
- Fire Safety Systems — Fire and heat sensors can be used in buildings to detect signs of fire and activate alarms, helping people respond quickly.
- Water Leakage Detection — Water sensors can be placed near pipes, tanks, washing machines or other areas where leaks may occur. They can provide an early warning before water causes major damage.
- Smart Windows and Roofs — Rain sensors can be connected to automated windows, roofs or awnings so they can close when rain is detected.
- Smart Homes — Sensors and microcontrollers can work together to monitor different conditions and automatically control devices inside a home.
- Building Safety Systems — Automated monitoring can help buildings respond to environmental changes and provide warnings when unusual conditions are detected.
- Disaster Awareness Education — This model can be used in classrooms to teach students about fire safety, water leakage, weather conditions, sensors, programming and automation.
- Future Smart-City Technology — Similar sensor-based ideas can be expanded for larger buildings and smart-city systems where computers continuously monitor conditions and control safety equipment.
Real-World Connection
The project shows an important engineering idea:
Detect a problem → Process the information → Take action automatically
This same concept is used in many modern automated systems. The miniature house gives students a simple way to understand how technology can help make homes smarter, safer and more responsive.
Frequently Asked Questions
- What is the Arduino doing in this Disaster-Proof Smart House project?
The Arduino acts as the brain of the smart house. It reads the sensors and decides which action to take. - How does the smart house detect fire?
A flame sensor detects the selected flame condition and sends a signal to the Arduino. The Arduino then activates the buzzer and red LED. - How does the water leakage system work?
The water sensor detects water on its sensing surface. The Arduino reads the sensor value and activates the warning when the value passes the selected threshold. - How does the rain window work?
The rain sensor detects water droplets. The Arduino tells the servo motor to rotate, which closes the cardboard window. - Why do we need to calibrate the water sensor?
Sensor readings can vary. Comparing dry and wet readings helps students choose a threshold that works for their particular sensor. - Can the three systems in smart house work at the same time?
Yes. The Arduino continuously checks the sensors. For example, the window can close because of rain while the warning is active because of water leakage. - Do we need a temperature sensor?
No. To keep the project simple for beginners, the temperature-sensing system has been removed. - Can we add more safety systems later?
Yes. Once students understand the basic project, they can add other sensors or outputs as an advanced extension. - What STEM concepts are used in this Disaster-Proof Smart House project?
The Smart House project teaches sensors, electrical circuits, programming, logical decisions, automation, mechanical movement and engineering design.
Arduino Reference
Arduino documentation identifies the UNO as a beginner-friendly board and provides official guides for installing Arduino IDE and uploading sketches. See the official Arduino UNO and IDE documentation for setup details.

















