Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grandma Safety Alert (IoT Emergency System)

A full-stack Internet of Things (IoT) emergency alert system combining custom ESP32 microcontroller firmware with a Python/Flask local web server. When a physical hardware button is pressed, the system instantly triggers an SMS notification to family members via the Twilio API.

Disclaimer: This project is for educational and personal prototype use only. It is not a certified medical life-safety device and should not replace professional medical alert systems.

Architecture & Tech Stack

  • Hardware: ESP32 Development Board, push-button circuit.
  • Firmware: C++ (PlatformIO / Arduino framework).
  • Backend Server: Python (Flask).
  • External APIs: Twilio Communications API.
  • Network: Local TCP/IP communicating over home Wi-Fi.

Hardware & Breadboard Setup

This project requires a simple physical circuit.

Components Needed:

  • 1x ESP32 Dev Board
  • 1x Momentary Push-Button
  • 1x Breadboard
  • 2x Jumper Wires

Wiring Instructions:

  1. Place the ESP32 securely onto the breadboard.
  2. Place the push-button onto the breadboard, straddling the center gap.
  3. Connect a jumper wire from GPIO Pin 4 on the ESP32 to one leg of the push-button.
  4. Connect a second jumper wire from any GND (Ground) pin on the ESP32 to the opposite leg of the push-button.

Note: The C++ code utilizes the ESP32's internal INPUT_PULLUP resistor on Pin 4. Pressing the button closes the circuit to Ground, successfully triggering the alert without needing external resistors.


Software Installation & Setup

This monorepo requires two environments to run simultaneously: the local Python web server and the ESP32 hardware firmware.

1. Twilio API Setup (SMS)

  1. Create a free developer account at Twilio.com.
  2. Generate a Twilio Phone Number.
  3. Locate your Account SID and Auth Token on your Twilio console dashboard.

2. The Python Web Server

  1. Navigate to the root directory of this project.
  2. Install the required Python dependencies:
    pip install flask twilio python-dotenv
  3. Copy .env.example and rename it to .env.
  4. Fill in your Twilio credentials and target phone numbers inside .env.
  5. Start the server:
    python app.py
  6. Take note of the local IP address printed in the terminal (e.g., 192.168.X.X).

3. The ESP32 Firmware

  1. Open this project folder in VS Code with the PlatformIO extension installed.
  2. Navigate to src/secrets.h.example and rename it to secrets.h.
  3. Input your home Wi-Fi SSID and PASSWORD into secrets.h.
  4. Open src/main.cpp and update the serverName string with the local IP address of your Python server (from step 2.6).
  5. Build and upload the firmware to your ESP32 board.

🔒 Security Warning

DO NOT COMMIT YOUR SECRETS! This repository uses a unified .gitignore file to prevent API keys and Wi-Fi passwords from being uploaded to the internet. If you fork this project, never commit your .env or secrets.h files.

About

A full-stack IoT emergency alert system using an ESP32 and Python/Flask to trigger Twilio SMS notifications. ⚠️ Warning: Ensure local .env and secrets.h files remain strictly untracked.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages