βοΈπ₯ ESP32-Based Smart Helmet with Piezoelectric Shock Tap Sensors: Enhanced Motorcycle Safety and Emergency Assistance System via Geolocation API and PhilSMS
ποΈ A Capstone Commission Project, for Bohol Wisdom School's Research Fair
CRASHTech is a speed-tracking and crash-detection system designed for motorcycles. It combines real-time speed monitoring, helmet impact detection, and automated SMS emergency alerts. The system uses an ESP32 microcontroller, piezoelectric sensors, a Node.js backend, and a modern web frontend.
[ESP32 Helmet] --(WiFi/HTTP)--> [Node.js Backend] <--(REST API)--> [Frontend Web App]
| |
Piezo Sensors PhilSMS API
- ESP32: Reads impact sensors, displays status on LCD, sends impact data to backend.
- Backend: Receives impact data, exposes REST API for frontend, relays SMS via PhilSMS.
- Frontend: Web app for monitoring, settings, and alert management.
- Edit WiFi credentials and backend URL in
esp32_code.c
. - Flash code to ESP32.
- Connect helmet sensors to GPIO pins as defined in the code.
-
Go to
backend/
and run:npm install
-
Create a
.env
file inbackend/
with:PHIL_SMS_API_TOKEN=your_philsms_api_token PHIL_SMS_SENDER_ID=your_sender_id
-
Start the server:
npm start
-
The backend exposes:
POST /api/impact
(from ESP32)GET /api/latest-impact
(for frontend)POST /api/send-philsms
(for SMS alerts)
- Open
index.html
in your browser. - Configure settings (name, contacts, speed limit, backend URL, etc.).
- Click Start Monitoring to begin.
.
βββ esp32_code.c # ESP32 firmware for helmet sensors
βββ index.html # Main web UI
βββ main.js # Frontend logic
βββ style.css # Web UI styles
βββ Speed Alert.mp3 # Speeding alert sound
βββ backend/
β βββ server.js # Node.js backend server
β βββ package.json
β βββ .gitignore
βββ README.md
- Backend API URL: Set to your deployed backend (e.g.,
https://your-backend.onrender.com
) - PhilSMS: Register at philsms.com for API credentials.
- Save your settings in the web app.
- Start monitoring.
- When a crash is detected (sudden deceleration + helmet impact), SMS alerts are sent automatically.
- Use the Test Send SMS Alert button to verify SMS delivery.
- ESP32, Node.js, Express, PhilSMS, Google Maps, and open web APIs.