Final Project — Sleep Monitoring
!!! A compact, open-source wearable that detects snoring, tracks sleep position, and monitors temperature, all processed on-device and viewable live from any browser.
| Author | Mohammadreza Omidali |
| FabLab | Oulu Super FabLab, University of Oulu |
| Microcontroller | Seeed XIAO ESP32-S3 |
| Sensors | ICM20948 (9-DOF IMU), DHT22 (temp/humidity), and ICS-43434 (I2S microphone) |
| Output | OLED 0.96" I2C and WiFi web dashboard |
| Enclosure | 3D printed PLA (snap-fit) and UV laser printer |
| License | CC BY-NC-ND 4.0 |
| Repository | FabAcademy 2026, Oulu Super FabLab, Mohammadreza Omidali |
Presentation
Slide
Download slide: presentation.png
Video
Watch the final presentation video:
▶ Presentation Video (MP4)
1. The Idea
Sleep problems are hard to study outside a hospital. I wanted something small enough to wear overnight, open enough to modify, and cheap enough that a researcher — or anyone curious about their own sleep — could build one.
Prior work and inspiration
There are a few related work, summarize here in Week17, who has done what beforehand?
2. Answering the Official Questions
Please see all answer in the details in Week17
3. System Overview
The system is built around a single XIAO ESP32-S3 that reads three sensors over two different protocols, drives a local display, and serves a live dashboard over WiFi. There is no app, no cloud, no external server.
The block diagram shown and explained here in Week 15
| Layer | Protocol | Components |
|---|---|---|
| Sensing | I2C | ICM20948, OLED (shared bus, different addresses: 0x68 / 0x3C) |
| Sensing | 1-Wire | DHT22 |
| Sensing | I2S | ICS-43434 microphone |
| Connectivity | WiFi + WebSocket | Browser dashboard |
4. Designs: 2D & 3D
The enclosure were designed across two weeks:
Enclosure
- Organic, low-profile form factor, modeled in Fusion 360
- Two-part snap-fit shell (body + lid) with press-fit sensor windows
- Internal standoffs for PCB mounting, recessed pocket for the battery
- Material: PLA, printed on a Prusa Core One L
5. Fabrication
5.1 Additive: 3D Printing
- Printer: Prusa Core One L
- Slicer: PrusaSlicer
- Material: PLA
- Settings: [layer height: 150 µm / infill: 20 % / No supports]
5.2 Subtractive: Laser Cutting & UV Laser
A custom breadboard was laser cut (Fusion 360 → Inkscape) to hold all components during testing, before the PCB was milled.
The lid detail was cut with the UV laser. [Add settings: power / speed / passes]
6. Electronics
6.1 Design
Schematic and PCB were designed in KiCad, built up component by component.
The OLED footprint wasn't in the default KiCad libraries, it was sourced from this repository and added via Preferences → Manage symbol libraries → Add.
6.2 Production
[Add photos of the milled board, soldering process, and continuity/power-on test.]
6.3 Wiring Reference
Datasheets consulted for every component:
- 📒 XIAO Seeed ESP32-S3
- 📒 DHT22
- 📒 ICM20948
- 📒 ICS-43434
- 📒 OLED SSD1306
| Sensor | Signal | GPIO Pin | XIAO Pin | Notes |
|---|---|---|---|---|
| DHT22 | DATA | GPIO4 | D3 | |
| ICM20948 | SDA | GPIO5 | SDA / D4 | |
| ICM20948 | SCL | GPIO6 | SCL / D5 | |
| OLED | SDA | GPIO5 | SDA / D4 | shared bus |
| OLED | SCL | GPIO6 | SCL / D5 | shared bus |
| ICS-43434 | BCLK | GPIO43 | TX / D6 | |
| ICS-43434 | WS | GPIO44 | RX / D7 | |
| ICS-43434 | DOUT | GPIO2 | D1 | |
| ICS-43434 | L/R | GND | GND | left channel |
| all GND | GND | GND | ||
| all VCC | 3.3V | 3.3V | never 5V |
7. Embedded Programming
7.1 Input Devices
Full development and testing detail: Week 09, Input Devices
Sleep position from the IMU: Roll and Pitch come from a complementary filter (96% gyroscope, 4% accelerometer) so the estimate doesn't drift like a raw gyro integration would:
8. Networking & Interface
9. System Integration & Assembly
Full detail: Week 15
[Add: 2–3 photos or a short video of the physical assembly — PCB going into the enclosure, battery placement, lid closing.]
10. Testing & Results
| Test | Method | Result | Status |
|---|---|---|---|
| DHT22 accuracy | Compared to reference thermometer | [ ] | 🔲 |
| IMU position detection | Tested in 4 known orientations | [ ] | 🔲 |
| Snore detection | Recorded snoring audio vs. silence | [ ] | 🔲 |
| WiFi/WebSocket stability | Left running for [X] hours | [ ] | 🔲 |
| Battery life | Measured with current probe | [ ] | 🔲 |
| Enclosure fit | Snap-fit closes without gaps | [ ] | 🔲 |
11. Bill of Materials
I have provided here in Week 17
12. Fab Academy Skills Map
| Fab Academy Week | Application in this project |
|---|---|
| Week 02 - Computer-aided design | Breadboard and Enclosure 2D/3D design |
| Week 03 - Computer controlled cutting | Laser-cut test breadboard |
| Week 04 - Embedded programming | First microcontroller programs, precursor to final firmware |
| Week 05 - 3D scanning and printing | FDM-printed enclosure and its lid |
| Week 06 - Electronics design | KiCad schematic and PCB layout |
| Week 07 - Computer controlled machining | Not used for this project |
| Week 08 - Electronics production | PCB milling, soldering, testing |
| Week 09 - Input devices | ICM20948, ICS-43434, DHT22 |
| Week 10 - Output devices | OLED display, WiFi data output |
| Week 11 - Networking and communications | WiFi + WebSocket server |
| Week 12 - Mechanical design | Snap-fit enclosure mechanism |
| Week 13 - Molding and casting | Not used for this project |
| Week 14 - Interface and application programming | Web dashboard |
| Week 15 - System integration | Full assembly into enclosure |
| Week 16 - Wildcard | Pattern design / UV laser lid |
13. Dissemination & Future Opportunities
This project will be released fully open source. The next step is adding a physiological sensor to support basic sleep apnea screening, with a Proof-of-Concept grant application planned through the University of Oulu Innovation Centre.
Full plan: week 18.
14. License
For this project, I provide the license here during week 18.
15. Reflection
What worked:
What didn't work
What I learned
16. Acknowledgements
I would like to express my sincere gratitude to:
- Jani Ylioja, Director of Fab Lab Oulu, for his support and guidance throughout this project.
- The instructors at Oulu Super FabLab for their valuable assistance and expertise.
- Neil Gershenfeld for creating this exceptional course and fostering a global network community.
- The FabAcademy program for providing the opportunity, resources, and collaborative environment that made this work possible.








