SQuiE (Sleep Quality Enhancer) is an ESP32-based IoT system that monitors and actively improves sleep conditions using environmental sensing, automation, and a real-time web dashboard.
It is designed as a low-cost, modular, and extensible smart sleep engineering platform suitable for smart homes, hostels, and research prototypes.
- Sleep Quality Index (SQI) computation (0–100)
- Touch-based Sleep Mode control
- Automatic ventilation with 3-level servo control (LOW / MED / HIGH)
- Smart lighting control (auto OFF during sleep)
- Continuous white-noise generation using buzzer
- Movement detection using Ultrasonic + IR sensor (sensor fusion)
- Temperature & humidity monitoring (DHT11)
- Light intensity monitoring (LDR)
- Real-time Wi-Fi web dashboard
- Fully offline local network operation
SQuiE works as a closed-loop automation system:
Environment → Sensors → ESP32 → Decision Logic → Actuators → Improved Environment
It continuously senses the sleep environment, calculates a Sleep Quality Index, and adjusts ventilation, lighting, and sound to optimize sleep conditions.
- ESP32 Development Board
- DHT11 Temperature & Humidity Sensor
- LDR (Light Sensor Module)
- Ultrasonic Sensor (HC-SR04)
- IR Obstacle Sensor
- Touch Sensor Module
- SG90 Servo Motor
- Active Buzzer
- LED
- Resistors, breadboard, jumper wires
| Component | ESP32 GPIO |
|---|---|
| DHT11 Data | GPIO 4 |
| LDR Analog | GPIO 34 |
| Ultrasonic TRIG | GPIO 26 |
| Ultrasonic ECHO | GPIO 27 |
| IR Sensor OUT | GPIO 14 |
| Touch Sensor OUT | GPIO 12 |
| Servo Signal | GPIO 13 |
| LED | GPIO 5 |
| Buzzer | GPIO 33 |
The ESP32 hosts a local web server.
Features shown:
- SQI score
- Temperature
- Humidity
- Light level
- Movement status
- Sleep mode status
- LED status
Access using:
http://<ESP32-IP-address>
(Phone/Laptop must be on the same Wi-Fi network.)
- Connect sensors and actuators according to the pin mapping table.
- Ensure common ground for all modules.
Install the following Arduino libraries:
DHT sensor library(Adafruit)Adafruit Unified SensorESP32Servo
Install ESP32 board support using Arduino Boards Manager.
Edit in the firmware:
#define WIFI_SSID "YOUR_WIFI_NAME"
#define WIFI_PASS "YOUR_WIFI_PASSWORD"- Select board: ESP32 Dev Module
- Select correct COM port
- Upload the code
Check Serial Monitor for IP address and open it in a browser.
| Condition | Action |
|---|---|
| Sleep Mode ON | LED OFF, Buzzer ON (white noise) |
| Sleep Mode OFF | LED ON, Buzzer OFF |
| Temp < 20°C | Servo LOW |
| Temp 20–24°C | Servo MED |
| Temp > 24°C | Servo HIGH |
| Movement detected | SQI decreases |
- Smart homes
- Hostels / PG rooms
- Hospitals
- Hotels
- Elder care systems
- Sleep research labs
- Mobile app control
- Cloud data logging
- Machine learning sleep classification
- CO₂ and noise sensors
- RGB mood lighting
- Multi-room support
- Secure login for dashboard
The following ideas are part of the future roadmap and are not implemented in the current version.
-
SQuiE Baby – Baby Sleep Monitoring System
Extension of SQuiE for infant safety and monitoring, including:- Cry detection using microphone/sound sensor
- Breathing & motion safety alerts
- Over‑temperature risk detection
- Parent notification system (mobile / cloud)
- Dedicated “Baby Mode” with stricter safety thresholds
-
Advanced Human Sleep Monitoring System
Enhanced version for detailed sleep analysis, including:- Sleep stage estimation (light / deep / REM)
- Long‑term sleep quality trends
- Wearable integration
- Personalized sleep optimization using ML models
These enhancements position SQuiE as a scalable sleep‑engineering platform rather than a single‑purpose device.
(Add images here)
- Hardware setup photo
- Dashboard screenshot
- Servo operation
Tejasva Chaudhary
Engineering Student | Embedded Systems & IoT
This project is licensed under the MIT License – free to use, modify, and distribute.
- Arduino Community
- Espressif Systems
- Adafruit Libraries
SQuiE – Because good sleep should be engineered. 💤