π Introduction
Smart Home Automation is a system where different electronic devices and sensors connect to a central controller (Arduino UNO).
This allows your home to become automatic, smart, energy-saving, and more secure.
With Arduino, you can control:
- π‘ Temperature & humidity (DHT11)
- π¦ Traffic light simulation
- πͺ Automatic garage door
- π’ Mini elevator system
- π― Motion detection (Radar/PIR)
- π‘ Lights automation
- π¦ Water fountain
- β Air conditioner indicator
This project is perfect for students, DIY makers, and STEM learners.
π§© Components Needed
β Arduino UNO
β DHT11 Temperature & Humidity Sensor
β PIR Motion Sensor or Radar sensor
β Servo Motor (Garage / Elevator)
β LEDs (Red/Yellow/Green for traffic light)
β Relay Module (to control AC indicator or fountain)
β Jumper wires
β 5V power
Everything in this project uses low voltage (5V) for safety.
π System Overview From Picture
The system includes:
π‘ Lights Automation
Lights turn ON when needed using Arduino control.
β Air Conditioner Control (via relay indicator)
Arduino triggers a relay when temperature is high.
π¦ Traffic Light Example
Red, yellow, green LEDs programmed to cycle automatically.
π§ Water Fountain
Controlled by relay based on schedule or button.
π‘ DHT11 Temperature Sensor
Reads room temperature & humidity.
πͺ Garage System
Servo motor or DC motor opens/closes the garage door.
π’ Elevator Mini System
A small servo simulates elevator up/down movement.
π― Radar or PIR Motion
Detects motion and triggers lights or buzzer.
π§Ύ FULL ARDUINO CODE (All functions combined)
This code includes:
- Traffic light
- Garage door (servo)
- Elevator (servo)
- Motion sensor
- DHT11 temperature & humidity
- Relay control (AC & fountain)
π Before uploading: install DHT library
π DHT sensor library by Adafruit
#include <DHT.h>
#include <Servo.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
// Traffic Light Pins
int redLED = 3;
int yellowLED = 4;
int greenLED = 5;
// Motion Sensor
int motionPin = 6;
// Relay Outputs
int relayAC = 7;
int relayFountain = 8;
// Garage Door Servo
Servo garageServo;
// Elevator Servo
Servo elevatorServo;
void setup() {
Serial.begin(9600);
// Traffic light pins
pinMode(redLED, OUTPUT);
pinMode(yellowLED, OUTPUT);
pinMode(greenLED, OUTPUT);
// Motion sensor
pinMode(motionPin, INPUT);
// Relays
pinMode(relayAC, OUTPUT);
pinMode(relayFountain, OUTPUT);
// Servos
garageServo.attach(9);
elevatorServo.attach(10);
// Initialize
dht.begin();
garageServo.write(0); // Garage closed
elevatorServo.write(90); // Elevator idle
}
void loop() {
// -------------------------
// 1. TRAFFIC LIGHT SYSTEM
// -------------------------
digitalWrite(redLED, HIGH);
delay(3000);
digitalWrite(redLED, LOW);
digitalWrite(yellowLED, HIGH);
delay(1500);
digitalWrite(yellowLED, LOW);
digitalWrite(greenLED, HIGH);
delay(3000);
digitalWrite(greenLED, LOW);
// -------------------------
// 2. READ TEMP & HUMIDITY
// -------------------------
float t = dht.readTemperature();
float h = dht.readHumidity();
if (!isnan(t)) {
Serial.print("Temp: ");
Serial.print(t);
Serial.print(" Humidity: ");
Serial.println(h);
}
// AC control (relay)
if (t > 30) {
digitalWrite(relayAC, HIGH); // Turn ON AC indicator
} else {
digitalWrite(relayAC, LOW);
}
// -------------------------
// 3. MOTION SENSOR AUTOMATION
// -------------------------
int motionDetected = digitalRead(motionPin);
if (motionDetected == HIGH) {
Serial.println("Motion Detected!");
digitalWrite(relayFountain, HIGH); // Turn fountain ON
} else {
digitalWrite(relayFountain, LOW);
}
// -------------------------
// 4. GARAGE DOOR
// -------------------------
garageServo.write(0); // Closed
delay(2000);
garageServo.write(90); // Opening half
delay(2000);
garageServo.write(180); // Fully open
delay(2000);
// -------------------------
// 5. MINI ELEVATOR
// -------------------------
elevatorServo.write(0); // Down
delay(2000);
elevatorServo.write(180); // Up
delay(2000);
}
π How the Code Works
β Traffic Light
Simulates real traffic system using 3 LEDs.
β Temperature Control
If temperature > 30Β°C β AC relay turns ON.
β Motion Sensor
Detects movement β activates water fountain.
β Garage Door
Servo moves between 0Β° and 180Β°.
β Elevator
Servo moves up and down.
π§ Possible Extensions
- Add LCD display
- Use Bluetooth to control via phone
- Add flame or gas sensor
- Add IR remote control
- Add automatic curtains
If you want, I can generate schematic wiring diagrams, PDF file, or PowerPoint version too.
π· Hashtags (English + Khmer)
π§ Tech & Arduino
#Arduino #ArduinoUNO #SmartHome
#HomeAutomation #IOTProject #ArduinoProject
#ElectronicsDIY #STEMProject #CodingProject
#SmartHouse #DHT11 #PIRSensor
#RelayModule #TrafficLightSystem
π°π Khmer + English
#α§αααααα’αα‘α·α
ααααΌαα·α #ααααααArduino
#ααααααααΆα #αα
αα
αααα·ααααΆααααα»ααΆ
#αααArduino #αα·αααSTEM
#ααααααΈααΈαα #αααααΎααααΌααΌα
