. SmartElectronicsDIY

Automatic Fire Detection Suppression System(Arduino Uno | Embedded + Safety System)

This system automatically detects fire using flame and smoke sensors and activates a water pump to suppress it. At the same time, it triggers an alarm and can send alerts (optional GSM/IoT).

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Smart Dustbin Using Arduino & Ultrasonic Sensor

 Project Objective


To automatically open and close a dustbin lid when a person comes near it using an ultrasonic sensor and servo motor.





๐Ÿ“ฆ Components Required (Part Names)

No. Component

1 Arduino Uno

2 Ultrasonic Sensor (HC-SR04)

3 Servo Motor (SG90)

4 Breadboard

5 Jumper Wires

6 USB Cable

7 Dustbin / Cardboard Model

Circuit Connections

Ultrasonic Sensor (HC-SR04)

Sensor Pin Arduino Pin

VCC 5V

GND GND

TRIG Digital Pin 7

ECHO Digital Pin 6

๐Ÿ”น Servo Motor

Servo Wire Arduino Pin

Red 5V

Brown/Black GND

Yellow/Orange Digital Pin 9

 Working Principle


Ultrasonic sensor measures distance.


When hand comes within 15 cm, Arduino:


Opens dustbin lid (servo rotates)


After few seconds:


Lid closes automatically


 Arduino Code (Complete & Simple)

#include <Servo.h>


Servo myServo;


int trigPin = 7;

int echoPin = 6;

long duration;

int distance;


void setup() {

  pinMode(trigPin, OUTPUT);

  pinMode(echoPin, INPUT);

  myServo.attach(9);

  myServo.write(0);   // Lid closed

  Serial.begin(9600);

}


void loop() {

  digitalWrite(trigPin, LOW);

  delayMicroseconds(2);


  digitalWrite(trigPin, HIGH);

  delayMicroseconds(10);

  digitalWrite(trigPin, LOW);


  duration = pulseIn(echoPin, HIGH);

  distance = duration * 0.034 / 2;


  Serial.print("Distance: ");

  Serial.println(distance);


  if (distance > 0 && distance < 15) {

    myServo.write(90);  // Open lid

    delay(3000);

    myServo.write(0);   // Close lid

  }

}


 Applications


Smart garbage bins


Touch-less waste management


Hospitals & public places


Hygiene automation systems




Automatic Street Light Using Arduino & LDR

 Project Objective


To automatically turn ON the light at night and turn OFF during daytime using an LDR sensor and Arduino Uno.



 Components Required (Part Name)

No. Component Name

1 Arduino Uno

2 LDR (Light Dependent Resistor)

3 10kฮฉ Resistor

4 LED

5 220ฮฉ Resistor

6 Breadboard

7 Jumper Wires

8 USB Cable

๐Ÿ”Œ Circuit Connections

 LDR Connection


One leg of LDR → 5V


Other leg of LDR → A0 (Arduino)


10kฮฉ resistor from A0 → GND


 LED Connection


LED Anode (+) → Digital Pin 9 (via 220ฮฉ resistor)


LED Cathode (–) → GND


 Working Principle


LDR resistance changes with light.


Daylight → High light → LED OFF


Night → Low light → LED ON


Arduino reads LDR value from analog pin A0 and controls LED.






 Arduino Code (Full & Simple)

int ldrPin = A0;    // LDR connected to A0

int ledPin = 9;     // LED connected to D9

int ldrValue = 0;


void setup() {

  pinMode(ledPin, OUTPUT);

  Serial.begin(9600);

}


void loop() {

  ldrValue = analogRead(ldrPin);

  Serial.println(ldrValue);


  if (ldrValue < 500) {   // Night condition

    digitalWrite(ledPin, HIGH);

  } else {                // Day condition

    digitalWrite(ledPin, LOW);

  }


  delay(500);

}


 Applications


Street lights


Garden lights


Automatic room lighting


Energy saving systems









IoT Accident Detection & Emergency Alert System

 

 INTRODUCTION

Road accidents are one of the major causes of death worldwide, mainly due to delay in providing medical assistance. In many cases, victims are unable to call for help because of unconsciousness or severe injury.

The IoT Accident Detection & Emergency Alert System is designed to automatically detect vehicle accidents using sensors and instantly send emergency alerts with live GPS location to predefined contacts such as ambulance services, police, or family members.

This system uses IoT, embedded systems, GPS, and GSM technologies to ensure fast response time, reduce human intervention, and increase the chances of saving lives. It is a low-cost, reliable, and scalable solution suitable for smart transportation systems.


 PART NAME & CONNECTION PIN DETAILS


1️⃣ Microcontroller – ESP32 Dev Module

Function: Controls all sensors and modules

ESP32 PinConnected To
3.3VMPU6050 VCC
GNDAll module GND
GPIO21MPU6050 SDA
GPIO22MPU6050 SCL
GPIO16GPS RX
GPIO17GPS TX
GPIO26GSM TX
GPIO27GSM RX
GPIO25Buzzer
GPIO33SOS Button

2️⃣ Accelerometer – MPU6050

Function: Detects accident by sudden acceleration

MPU6050 PinConnected To
VCCESP32 3.3V
GNDESP32 GND
SDAESP32 GPIO21
SCLESP32 GPIO22

3️⃣ GPS Module – NEO-6M

Function: Provides real-time location

GPS PinConnected To
VCCESP32 5V
GNDESP32 GND
TXESP32 GPIO16
RXESP32 GPIO17

4️⃣ GSM Module – SIM800L

Function: Sends emergency SMS

⚠️ Power Warning: Use 3.7V–4.2V battery only

SIM800L PinConnected To
VCC3.7V Battery
GNDESP32 GND
TXDESP32 GPIO26
RXDESP32 GPIO27

5️⃣ Buzzer

Function: Gives sound alert

Buzzer PinConnected To
+ (Positive)ESP32 GPIO25
– (Negative)ESP32 GND

6️⃣ SOS / Cancel Button

Function: Cancels false alert

Button PinConnected To
One SideESP32 GPIO33
Other SideGND

๐Ÿ“Œ Internal pull-up resistor used


7️⃣ Power Supply

ModuleVoltage
ESP325V (USB)
MPU60503.3V
GPS5V
SIM800L3.7V Battery

FULL ARDUINO CODE

Controller: ESP32
Sensors: MPU6050 + GPS (NEO-6M) + GSM (SIM800L)

๐Ÿ”ง Before upload:

  1. Install libraries: MPU6050, TinyGPS++

  2. Replace mobile number in code

  3. Use 3.7V battery for SIM800L


๐Ÿ“Œ COMPLETE CODE

#include <Wire.h> #include <MPU6050.h> #include <TinyGPS++.h> #include <HardwareSerial.h> MPU6050 mpu; TinyGPSPlus gps; // Serial ports HardwareSerial gpsSerial(1); HardwareSerial gsmSerial(2); // Pin definitions #define BUZZER_PIN 25 #define BUTTON_PIN 33 float ax, ay, az; float threshold = 2.5; // Accident detection limit void setup() { Serial.begin(9600); pinMode(BUZZER_PIN, OUTPUT); pinMode(BUTTON_PIN, INPUT_PULLUP); // MPU6050 Wire.begin(21, 22); mpu.initialize(); // GPS gpsSerial.begin(9600, SERIAL_8N1, 16, 17); // GSM gsmSerial.begin(9600, SERIAL_8N1, 27, 26); delay(3000); sendSMS("IoT Accident Detection System Ready"); } void loop() { mpu.getAcceleration(&ax, &ay, &az); float magnitude = sqrt(ax * ax + ay * ay + az * az) / 16384.0; if (magnitude > threshold) { digitalWrite(BUZZER_PIN, HIGH); delay(2000); // Cancel false alert if (digitalRead(BUTTON_PIN) == LOW) { digitalWrite(BUZZER_PIN, LOW); delay(5000); return; } sendLocationSMS(); digitalWrite(BUZZER_PIN, LOW); delay(15000); } } // ---------------- SMS Functions ---------------- void sendLocationSMS() { float latitude = 0.0, longitude = 0.0; unsigned long start = millis(); while (millis() - start < 6000) { while (gpsSerial.available()) { gps.encode(gpsSerial.read()); } } if (gps.location.isValid()) { latitude = gps.location.lat(); longitude = gps.location.lng(); } String message = "๐Ÿšจ ACCIDENT ALERT!\nLocation:\n"; message += "https://maps.google.com/?q="; message += String(latitude, 6); message += ","; message += String(longitude, 6); sendSMS(message); } void sendSMS(String text) { gsmSerial.println("AT+CMGF=1"); delay(1000); gsmSerial.println("AT+CMGS=\"+91XXXXXXXXXX\""); // Replace number delay(1000); gsmSerial.print(text); delay(500); gsmSerial.write(26); delay(3000); }

๐Ÿ“Œ OUTPUT (REAL)

๐Ÿšจ ACCIDENT ALERT! Location: https://maps.google.com/?q=28.6139,77.2090

๐Ÿ CONCLUSION (FOR PROJECT FILE)

๐Ÿ”น Conclusion

The IoT Accident Detection & Emergency Alert System successfully demonstrates an automated and reliable solution for detecting road accidents and providing immediate emergency assistance. The system continuously monitors vehicle movement using an accelerometer sensor and detects sudden impacts that indicate an accident.

Once an accident is detected, the system automatically fetches the live GPS location and sends an emergency SMS alert through the GSM module to predefined contacts such as ambulance services, police, or family members. This significantly reduces response time and minimizes human intervention, which is critical in saving lives.

The proposed system is cost-effective, scalable, and efficient, making it suitable for real-time implementation in vehicles. With further enhancements such as AI-based accident severity detection and cloud integration, the system can play a vital role in smart transportation and road safety management.

IoT Smart Home – Control Light Using Mobile

 

๐Ÿ“Œ Introduction

In this IoT project, we will build a Smart Home Light Control System using ESP8266 WiFi module, Arduino, and Blynk IoT platform.
You can turn ON/OFF a light from your mobile phone from anywhere in the world using the Internet.


๐Ÿง  Working Principle

  • Mobile app sends command via Internet

  • ESP8266 receives data through WiFi

  • Arduino processes the command

  • Relay switches the light ON or OFF

This is a real-world IoT application used in smart homes and offices.


๐Ÿงฐ Components Required

ComponentQuantity
Arduino UNO1
ESP8266 (ESP-01)1
Relay Module (5V)1
Bulb / Load1
Breadboard1
3.3V Regulator (AMS1117)1
10kฮฉ Resistor2
Jumper WiresAs required
Smartphone1

๐Ÿ–ผ️ Project Images (Upload in Blog)

๐Ÿ”น Image 1: Components Used




๐Ÿ”น Image 2: Circuit Diagram



๐Ÿ”น Image 3: Mobile App Interface



๐Ÿ”น Image 4: Final Working Model





๐Ÿ”Œ Circuit Connections

๐Ÿ“ ESP8266 to Arduino

ESP8266 PinArduino Pin
VCC3.3V
GNDGND
CH_PD3.3V
TXD2
RXD3 (via 10k/20k divider)

⚠️ ESP8266 works only on 3.3V – do NOT connect to 5V


๐Ÿ“ Relay Connections

Relay PinArduino
IND8
VCC5V
GNDGND

๐Ÿงพ Arduino + ESP8266 Code (Blynk IoT)

#define BLYNK_PRINT Serial #include <ESP8266_Lib.h> #include <BlynkSimpleShieldEsp8266.h> char auth[] = "Your_Blynk_Auth_Token"; char ssid[] = "Your_WiFi_Name"; char pass[] = "Your_WiFi_Password"; ESP8266 wifi(&Serial); void setup() { Serial.begin(9600); Blynk.begin(auth, wifi, ssid, pass); pinMode(8, OUTPUT); } BLYNK_WRITE(V1) { int value = param.asInt(); digitalWrite(8, value); } void loop() { Blynk.run(); }

๐Ÿ“ฑ Mobile App Setup (Blynk IoT)

  1. Install Blynk App

  2. Create new project → Select Arduino UNO

  3. Add Button Widget

  4. Set Virtual Pin V1

  5. Mode → Switch

  6. Copy Auth Token to code


⚙️ Applications

  • Smart home automation

  • Remote light control

  • IoT learning project

  • Home security systems

  • College IoT projects


✅ Advantages

✔ Control from anywhere
✔ Low cost
✔ Easy to expand
✔ Real-time control
✔ Beginner friendly IoT project


⚠️ Safety Note

Do not touch AC wires directly. Use proper insulation while connecting relay and bulb.


๐Ÿ“Œ Conclusion

This IoT Smart Home Project demonstrates how Internet and electronics work together.
It is perfect for students, beginners, and final-year projects.



Arduino Automatic Street Light Project (With Circuit & Code)

Project Name

Automatic Street Light Using Arduino and LDR


๐Ÿ“Œ Introduction

In this Arduino project, we will make an Automatic Street Light System using an Arduino UNO and an LDR (Light Dependent Resistor).
The light turns ON automatically at night and OFF during daytime.
This project is widely used in smart cities, energy saving systems, and home automation.


๐Ÿง  Working Principle

  • LDR senses sunlight

  • When light is high (day) → Resistance of LDR is low → LED OFF

  • When light is low (night) → Resistance of LDR is high → LED ON

  • Arduino reads LDR value and controls the LED automatically


๐Ÿงฐ Components Required

ComponentQuantity
Arduino UNO1
LDR (Light Sensor)1
LED1
220ฮฉ Resistor1
10kฮฉ Resistor1
Breadboard1
Jumper WiresAs required
USB Cable1

๐Ÿ”Œ Circuit Connections

๐Ÿ“ LDR Connections

LDR PinConnection
One leg5V
Other legA0 + 10kฮฉ to GND

๐Ÿ“ LED Connections

LED PinConnection
Anode (+)Digital Pin 9
Cathode (–)220ฮฉ Resistor → GND

๐Ÿงพ Arduino Code

int ldrPin = A0; int ledPin = 9; int ldrValue = 0; void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { ldrValue = analogRead(ldrPin); Serial.println(ldrValue); if (ldrValue < 400) { // Night condition digitalWrite(ledPin, HIGH); } else { // Day condition digitalWrite(ledPin, LOW); } delay(500); }

⚙️ How to Upload Code

  1. Open Arduino IDE

  2. Select Board: Arduino UNO

  3. Select correct COM Port

  4. Paste the code

  5. Click Upload

๐ŸŽฏ Advantages

✔ Saves electricity
✔ Fully automatic
✔ Low cost
✔ Easy to build
✔ Beginner friendly


๐Ÿ“Œ Conclusion

This Arduino Automatic Street Light Project is simple, useful, and perfect for students and beginners. It helps understand sensors, analog input, and automatic control systems.



Arduino LED Blinking Project

Introduction

Arduino is a beginner-friendly microcontroller platform, perfect for learning electronics and programming. In this tutorial, we will make a simple LED blinking project. This is usually the first project for anyone starting with Arduino.

This project will teach you:

  • How to use Arduino IDE

  • How to connect LEDs

  • How to write a simple Arduino program


Components Required

  • Arduino UNO Board

  • LED (any color)

  • 220 ฮฉ Resistor

  • Breadboard

  • Jumper Wires


Circuit Diagram

Connect the LED as follows:

  • Long leg (Anode) → Digital Pin 13

  • Short leg (Cathode) → Resistor → GND

(You can insert a circuit diagram image here if available)


Arduino Code

// Arduino LED Blinking Example void setup() { pinMode(13, OUTPUT); // Set pin 13 as OUTPUT } void loop() { digitalWrite(13, HIGH); // LED ON delay(1000); // Wait 1 second digitalWrite(13, LOW); // LED OFF delay(1000); // Wait 1 second }

Explanation:

  1. pinMode(13, OUTPUT) → Sets pin 13 as output.

  2. digitalWrite(13, HIGH) → Turns the LED on.

  3. delay(1000) → Waits for 1 second.

  4. Loop repeats indefinitely.


Project Output

Once you upload the code to Arduino:

  • The LED will blink on and off every second.

  • You can change the delay value to make it faster or slower.


Conclusion

This project is a perfect start for beginners. After mastering LED blinking, you can move to ESP32 projects, IoT applications, and home automation.