LED PROJECTS

Smart Helmet for Enhanced Biker Safety

The Smart Helmet for Enhanced Biker Safety integrates advanced technology to provide bikers with real-time monitoring and alert systems, enhancing their safety on the road.

Equipped with sensors and communication modules, this helmet can detect environmental conditions, such as temperature and gas levels, and detect falls or accidents.

In case of abnormal conditions or emergencies, it alerts the rider and sends notifications to predefined emergency contacts via SMS and phone calls.

Component List:

NameQuantityComponent
U11Arduino Uno R3
U21LCD 16 x 2
Rpot21250 kΩ Potentiometer
R11220 Ω Resistor
GAS21Gas Sensor
R2120 kΩ Resistor
U31Wifi Module (ESP8266)
R4
R5
R8
R9
R10
R11
61 kΩ Resistor
R6
R7
2220 Ω Resistor
PIEZO11Piezo
U41Temperature Sensor [TMP36]
U51Tilt Sensor 4-pin
R31Photoresistor
D11Red LED
D21Green LED

Arduino Code:

#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
float t=0;
char data = 0;
String apiKey = "ZY6DICQ136QRGTH1";
SoftwareSerial ser(8,9);
const int rs = 13, en = 12, d4 = 6, d5 = 5, d6 = 4, d7 = 3;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
float temp = 0;
unsigned long start, finished, elapsed;
int period = 250;
unsigned long time_now = 0;
int const PINO_SGAS = A0;
int belt=A2;
int red=2;
int green=11;
int yellow=1;
int tilt=7;
int buzzer=A4;
int valor;
void setup() {
ser.begin(9600);
Serial.begin(9600);
pinMode(red, OUTPUT);
digitalWrite(red, LOW);
pinMode(green, OUTPUT);
digitalWrite(green, LOW);
pinMode(yellow, OUTPUT);
digitalWrite(yellow, LOW);
pinMode(buzzer, OUTPUT);
pinMode(belt, INPUT);
lcd.begin(16, 2);
ser.println("AT");
delay(1000);
ser.println("AT+GMR");
delay(1000);
ser.println("AT+CWMODE=3");
delay(1000);
ser.println("AT+RST");
delay(5000);
ser.println("AT+CIPMUX=1");
delay(1000);
String cmd="AT+CWJAP=\"Thiha Htun\",\"12345678\"";
ser.println(cmd);
delay(1000);
ser.println("AT+CIFSR");
delay(1000);
}
void loop() {
digitalWrite(green, LOW);
digitalWrite(red, LOW);
lcd.clear();
if(analogRead(belt)>=500){
int start=millis()/1000;
digitalWrite(green,HIGH);
lcd.print (" Helmet Wearing");
static unsigned long sensortStamp = 0;
valor = analogRead(PINO_SGAS);
t=valor;
if(valor>800){
gas();
}
if(millis() - sensortStamp > 1000){
sensortStamp = millis();
int reading = analogRead(A1);
Serial.print(F("Real Time Temp: "));
float voltage = reading * 5.0;
voltage /= 1024.0;
float temperatureC = (voltage - 0.5) * 100 ;
Serial.print(temperatureC); Serial.print(" degrees C ");
lcd.setCursor(0,1);
for (int positionCounter = 0; positionCounter < 13; positionCounter++) { lcd.scrollDisplayLeft(); delay(300); } lcd.setCursor(0,1); lcd.print(temperatureC); lcd.print(" "); lcd.print("C"); lcd.print(" "); float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0; lcd.setCursor(9, 1); lcd.print(temperatureF); lcd.print(" "); lcd.print("F"); lcd.print(" "); } if(digitalRead(tilt)==HIGH){ lcd.clear(); lcd.print("Fall Detect"); lcd.setCursor(0,1); lcd.print("Wait 5 seconds"); start=millis(); delay(5000); finished=millis(); Serial.println("Finished"); elapsed=finished-start; Serial.print(elapsed); Serial.println(" milliseconds elapsed"); Serial.println(); delay(500); lcd.clear(); tone(buzzer, 440, 250); lcd.print("Sending ALERT"); lcd.setCursor(0,1); lcd.print("SMS & Emerg call"); delay(3000); lcd.clear(); } if(temperatureC > 38){
time_now = millis();
digitalWrite(green, LOW);
digitalWrite(yellow, LOW);
digitalWrite(red, HIGH);
lcd.clear();
lcd.print("Alert Abnormal");
lcd.setCursor(0,1);
lcd.print("Body Temperature");
while(millis() < time_now + period){
}
}
}
}
void gas(){
if(valor>80){
tone(buzzer, 440, 250);
delay(2000);
digitalWrite(red, HIGH);
lcd.clear();
lcd.print("Harmful Gas");
lcd.setCursor(0,1);
lcd.print("condition");
delay(1000);
lcd.clear();
Serial.println(valor);
}
}

The helmet continuously monitors environmental conditions and the rider’s status. It detects helmet wearing, measures temperature, checks gas levels, and monitors for falls.

If abnormal conditions are detected, such as high temperature or harmful gas levels, or if a fall occurs, the helmet triggers alerts.

These alerts include visual cues on the display, audible warnings via the buzzer, and communication with emergency contacts through SMS and phone calls using the ESP8266 module.

This comprehensive system ensures that bikers are promptly notified of potential dangers, allowing them to take appropriate action and stay safe on the road.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button