Hardware · Firmware · Software
A full breakdown of every piece of hardware and software that makes PosturePal tick — from the gyroscopes on your back to the push notification on your phone.
Hardware
Three core hardware components work together on a NodeMCU V2 board, communicating over I²C and GPIO to detect, process, and signal posture events.
GY-521 · I²C · Addr 0x68 / 0x69
Two MPU6050 modules are placed at opposite ends of the spine — one near the upper back, one at the lower. They share the same I²C bus but are differentiated by the AD0 pin: module 1 connects AD0 to 3V3 (address 0x69), module 2 to GND (address 0x68).
ESP8266 · 80MHz · 2.4GHz WiFi
The brain of the device. It reads both MPU6050 sensors via I²C, runs the posture detection logic, drives the vibration motor over GPIO, and uses its built-in ESP8266 WiFi chip to communicate with the Flask server over HTTP when bad posture is detected.
GPIO D5 · Digital Control · 5V
A simple vibration motor module that provides the first tactile alert to the user. Driven by pin D5 on the NodeMCU, it activates instantly when the posture threshold is crossed, giving the user a physical reminder before any network action is taken.
| NodeMCU | MPU6050 | |
|---|---|---|
| 3V3 | → | VCC |
| GND | → | GND |
| D1 | → | SCL |
| D2 | → | SDA |
| 3V3 | → | AD0 |
| NodeMCU | MPU6050 | |
|---|---|---|
| 3V3 | → | VCC |
| GND | → | GND |
| D1 | → | SCL |
| D2 | → | SDA |
| GND | → | AD0 |
| NodeMCU | Vibration Module | |
|---|---|---|
| D5 | → | IN |
| VIN | → | VCC |
| GND | → | GND |
Software Stack
Three Python/web layers handle subscription management, push delivery, and public access — all running locally but exposed to the internet via ngrok.
/subscribe), receives posture signals from the Arduino (/signal), exposes and receives sensitivity settings (/getSensitivity, /setSensitivity), and fires Web Push notifications to all registered phones.
/signal endpoint is triggered, pywebpush sends encrypted push payloads to each subscribed phone's push service (e.g., Google FCM, Apple APNs). Expired subscriptions (410) are automatically removed.
/signal) or send a new sensitivity value to the server (/setSensitivity). Useful for debugging push notification delivery and tuning angle thresholds.
Signal Path
From sensors on your back to a notification on your phone — this is the complete signal journey.
Configuration
The sensitivity slider maps a 0–100 value to an angular threshold in the Arduino firmware. Higher sensitivity = smaller angle triggers an alert faster.