Skip to content

About

Smart Safety Helmet powered by ESP32 featuring crash detection, Bluetooth connectivity, rear vehicle proximity alerts, LED-based turn-by-turn navigation, and an Android app for SOS alerts with GPS location sharing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Smart Safety Helmet

An intelligent motorcycle safety helmet that combines crash detection, rear proximity monitoring, Bluetooth connectivity, and LED-based navigation assistance to improve rider safety while minimizing rider distraction.


Overview

Motorcyclists are particularly vulnerable to road accidents due to limited protection and the need to constantly divide attention between the road and navigation devices. This project addresses these challenges by integrating intelligent sensing, emergency response, and hands-free navigation into a single smart helmet.

The system consists of an ESP32-based embedded hardware platform and an Android companion application communicating over Bluetooth.

The helmet is capable of:

  • Detecting crashes using an MPU6050 accelerometer
  • Detecting vehicles approaching from behind using an ultrasonic sensor
  • Providing turn-by-turn navigation through LED indicators inside the helmet
  • Sending SOS alerts with live GPS coordinates after confirmed crashes
  • Maintaining wireless communication with the Android application via Bluetooth

Features

Crash Detection

The MPU6050 continuously monitors acceleration experienced by the helmet.

If acceleration exceeds 3G, the firmware assumes a possible accident. This value is only arbitrary and chosen only for demonstration purposes, actual threshold value needs to be determined by testing on real road conditions and recording sensor data.

The ESP32 immediately:

  • Sends a CRASH event to the Android application
  • Activates an audible warning
  • Starts a 10-second cancellation timer

If the rider cancels the alert within 10 seconds:

  • Emergency procedure is aborted.

Otherwise:

  • The ESP32 sends an SOS command to the application.
  • The Android application:
    • Retrieves the phone's GPS location
    • Sends emergency SMS messages to registered contacts
    • Includes a Google Maps location link
    • Notifies hospitals registered for the rider's city

Rear Vehicle Detection

The helmet monitors vehicles approaching from behind using an HC-SR04 ultrasonic sensor.

Distance-based warning logic:

Distance Alert
>40 cm No warning
25–40 cm Slow beeping
15–25 cm Medium beeping
8–15 cm Fast beeping
<8 cm Continuous warning tone

For demonstration purposes the ultrasonic sensor is connected directly to the ESP32.

The intended production design uses a detachable rear module that mounts magnetically on the motorcycle and communicates wirelessly with the helmet.


Smart Navigation

The Android application generates navigation commands

NOTE: as of now the app only simulates navigation commands and does not yet support google map-like real time navigation. Currently it can only determine the turns required for reaching a destination and those turn signals can be simulated within the app.

These commands are transmitted over Bluetooth to the helmet.

The helmet provides navigation using LEDs mounted inside the helmet so riders receive navigation cues through their peripheral vision without needing to look at a phone.

Navigation Bluetooth Command Helmet Response
Left Turn L Left green LED blinks with audible feedback
Right Turn R Right green LED blinks with audible feedback
Go Straight S Both green LEDs blink simultaneously
U-Turn U Both red LEDs blink simultaneously

Each navigation event is acknowledged back to the Android application.


Hardware Components

  • ESP32 Development Board
  • MPU6050 Accelerometer/Gyroscope
  • HC-SR04 Ultrasonic Sensor
  • Active Buzzer
  • Left Green Navigation LED
  • Left Red Navigation LED
  • Right Green Navigation LED
  • Right Red Navigation LED
  • Android Smartphone
  • Bluetooth (Built into ESP32)

Hardware Wiring

ESP32 Connections

Component ESP32 Pin Description
HC-SR04 Trigger GPIO 5 Ultrasonic trigger output
HC-SR04 Echo GPIO 18 Ultrasonic echo input
Buzzer GPIO 13 Audible warnings and navigation feedback
Right Red LED GPIO 27 U-turn indicator
Right Green LED GPIO 26 Right turn indicator
Left Red LED GPIO 25 U-turn indicator
Left Green LED GPIO 33 Left turn indicator
MPU6050 SDA GPIO 21 I²C Data
MPU6050 SCL GPIO 22 I²C Clock
Bluetooth Built-in ESP32 Communication with Android app

Power Connections

Component Supply Voltage
ESP32 USB / 5V
MPU6050 3.3V
HC-SR04 5V
LEDs 3.3V (through current limiting resistors)
Active Buzzer 3.3V–5V

System Communication

                 Android Application
          (Navigation + SOS + GPS + Maps)
                     ▲
                     │ Bluetooth
                     ▼
                 ESP32 Controller
        ┌────────────┼────────────┐
        │            │            │
   MPU6050      HC-SR04      Navigation LEDs
        │            │            │
        └────────────┼────────────┘
                     │
                  Buzzer

Bluetooth Protocol

Messages Sent by ESP32

Message Description
OK Heartbeat packet (every 2 seconds)
CRASH Crash detected
SOS Rider did not cancel emergency
CANCELLED Crash cancelled by rider
ACK: Navigation command acknowledged

Messages Received from Android App

Command Function
L Left turn indication
R Right turn indication
S Straight ahead indication
U U-turn indication
CANCEL Cancels pending emergency alert

Firmware Responsibilities

The ESP32 firmware performs:

  • Continuous acceleration monitoring
  • Crash detection
  • SOS timer management
  • Bluetooth communication
  • Rear obstacle monitoring
  • Distance-based audible warnings
  • Navigation LED control
  • Command acknowledgement
  • Heartbeat transmission

Android Application

The Android application provides:

  • Bluetooth pairing and communication
  • Navigation command generation
  • Crash confirmation interface
  • GPS location retrieval
  • SOS SMS transmission
  • Emergency contact management
  • Hospital notification system

Repository Structure

Smart-Safety-Helmet/

├── README.md
├── .gitignore
│
├── firmware/
│   └── SmartSafetyHelmet.ino
│
└── android/
    └── SmartSafetyHelmet.apk

Future Improvements

  • Wireless detachable rear sensor module
  • Rechargeable battery management system
  • PCB design for compact integration
  • Waterproof enclosure
  • Automatic emergency calling
  • Cloud synchronization
  • Ride analytics dashboard
  • Voice assistant integration

Team

Developed as a collaborative engineering project focused on improving rider safety using embedded systems, Bluetooth communication, sensor fusion, and Android application development.

NOTE: This repository contains the firmware and Android application binary for demonstration purposes. The Android source code is not included.

About

Smart Safety Helmet powered by ESP32 featuring crash detection, Bluetooth connectivity, rear vehicle proximity alerts, LED-based turn-by-turn navigation, and an Android app for SOS alerts with GPS location sharing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages