A cloud based smart alarm clock using IoT sensors. This system aims to integrate various hardware and software components to provide an efficient and user-friendly alarm clock that leverages cloud connectivity for enhanced functionality.
- Web based application - set alarm from any device
- Alarm rings only when necessary. (If user is on his bed around the scheduled time)
- Smart Weight Tracking
- Sleep Pattern Tracking
- This alarm system is designed to help you stay on top of your meetings.
- You input all your
meetingsinto the app, and the hardware detects if you're still in bed before a meeting starts. - If you're in bed
5 minutesbefore a scheduled meeting, the alarm will ring continuously until you get up. - The alarm detects your presence by measuring an increase in
weightreading through a load cell and a decrease indistancereading using a TOF and ultrasound sensor.
Setting-alarm.mp4
Important
For Demonstration purposes, A 20kg loadcell was used only for the head. However for the actual Project a combination of four 20 kg load cells were placed under the bed to weigh the whole body.
UI.mp4
ESP32Microcontroller connects to WebApplication Serverwebsocket, gets alarm data in realTime- During NightTime, User Weight and Movement data from TOF, Ultrasound and HX711 Weight Sensors are sent to
InfluxDBviaTelegraf,HiveMQ. - Live real time monitoring of data and database data are available through the cloud
Grafanadashboard - Data from
InfluxDBis read byAWS Sage Makerfor model based data Analytics using Machine Learning Models - All User Alarms and Aggregated Statistics are stored in
MYSQL DatabaseinAzure. - NextJS Frontend Server and NodeJS(ExpressJS) Backend Server are passed through a reverse proxy for user Abstraction and Security.
Google OAuth 2.0withJSON Web Tokenis implemented for authenticating users.
Data_flow.mp4
- By leveraging sensors, microcontrollers, communication modules,
MQTTbrokers, andreal-timedata processing, we have developed a cohesive system that offers valuable insights and enhanced user interaction. - The project highlights the potential of IoT technology in everyday applications, transforming a traditional clock into a multifunctional device capable of improving user awareness and decision-making.
- Our system integrates various components seamlessly. The end devices, represented by the
ESP32 microcontroller, ensure accurate data collection using sensors like theHX711for weight measurement and theVL53L0Xfor distance measurement. - These devices collect essential data, which is then transmitted to the MQTT broker for real-time processing and analytics.
- The
OLEDdisplay and buzzer provide immediate feedback to users, enhancing the interactivity and functionality of the system. - The integration of
WebSocketcommunication further enablesreal-timeupdates andremote monitoringcapabilities.
- HX711: This sensor is an
analog-to-digital converter(ADC) which is used forweight sensingfeatures, switching off the alarm only when weight is removed from the bed. - VL53LOX: VL53L0X is a
Time-of-Flight(ToF) ranging sensor. It is used for movement recognition, which gives the sleep scores based onuser’s movementduring sleep. - HC-SR04: This sensor provides
2cm - 400cmnon-contact measurement function. It measures distances usingultrasonic waves. This is used to detect if someone is there, magnitude of change in conjuction with the TOF sensor for double check(since the frequency of waves are different in both).
- OLED Display: An
OLED(Organic Light Emitting Diodes) display shows time information. OLEDs have a much higher contrast ratio compared to traditional displays, making them visible from all angles and even in low-light situations. - Buzzer: The component that generates the alarm sound. It's the crucial part of the alarm clock, notifying or waking the user at the designated times.
ESP32 Microcontroller: ESP32 is a feature-rich SoC with integrated Wi-Fi and Bluetooth connectivity for a wide-range of IoT applications. In the given circuit it is connected to the sensors, collects sensor data, transmits it using the WiFi to the Cloud.
Sage_maker_analytics.mp4
- We have used
AWS Sagemakerfor deploying, training and modelling of several models and datasets. - We have added few attributes such as Start time the user’s sleep, End time of the User’s sleep, sleep quality, time in bed, weight and Distance (Movement of the person).
- We have calculated the User’s time in bed by the start and end time of sleep by the user.
- Weight monitoring is done by the
loadcellwhich is placed under the bed. - The tof sensor,
VL53LOXand Ultrasound sensorHC-SR04which is placed near the bed measures the distance of the User moving and tracking the percentage of deep sleep he/she is in. - The sleep quality of the user is trained by models to give a precise quality by checking the total time duration of the sleep and the movement the user while sleeping.
- For modelling, we have used,
Preprocessing,Visualization,EDA,Linear regression,KNN,Logistic regression,Decision tree,Random ForestandSVMfor better accuracy and got successful results.
Note
We have used our sleep data from 10.4.2024 to 10.5.2024 to train and test the models.



