Sleep Apnea Device & Webapp

Job ID: 40107372

Budget: $30 – $250 USD

I have a functioning breadboard prototype that uses an ESP32 (programmed through the Arduino IDE) to read three sensors:

• a stretch sensor strapped around the chest to track expansion and contraction
• a 3-axis accelerometer that decides whether the wearer is on their side, stomach, or back
• a small vibration motor that must pulse whenever the wearer stays on their back (supine) for more than 20 seconds

Right now the hardware behaves as expected, but the firmware is cluttered test code and there is no front-end for users to view their sleep session. I want to turn this into production-ready firmware and pair it with a secure, responsive web-based app.

Scope of work
– Rewrite the ESP32 firmware in clean, well-documented Arduino-style C/C++. The code should:
• sample the stretch sensor for breathing rhythm logging
• poll the accelerometer, determine body position, start a 20 s timer when supine, cancel when position changes
• drive the vibration motor immediately after that timer expires
• time-stamp and buffer all readings locally, then stream them over Wi-Fi (preferred) or Bluetooth LE in JSON packets

– Build a lightweight web app (React, Vue, or plain JS—open to suggestions) that:
• receives the live data feed and shows it in real time
• triggers audio/visual alerts in the browser when the vibration event fires, mirroring the on-body feedback
• stores the night’s data so the user can refresh without losing the current session

Acceptance criteria
1. Supine detection must fire the motor within 1 s after the 20 s threshold.
2. No dropped packets during an 8-hour overnight test on a standard home Wi-Fi router.
3. Real-time dashboard updates within 500 ms of data arrival and plays a subtle chime + screen flash with every vibration event.
4. All source code, pinouts, and build instructions delivered in a public Git repo I supply.

Future phases might add historical reports or export options, but right now the focus is tight: reliable firmware plus a real-time, alert-enabled web dashboard.