user-img

Rishabh Jain

+ Follow

SnoreSense : An AI powered Sleep Quality Monitor

SnoreSense is an intelligent sleep quality monitoring device that leverages AI-powered snore detection to assess and improve sleep health.

SnoreSense : An AI powered Sleep Quality Monitor
 
  • thumbnail-img
 

Hardware Components

  • Seeed Studio MG24 Sense

    X 1

Tools, APP Software Used etc.

  • Edge Impulse Studio

    Edge Impulse
  • Arduino IDE

    Arduino IDE

    Arduino

Story

 

Sleep is a critical component of human health. Poor sleep quality, often due to sleep disorders like snoring and sleep apnea, can negatively impact daily life and long-term well-being. Traditional sleep studies are expensive, invasive, and require clinical settings.

SnoreSense aims to provide an affordable, portable, and AI-powered solution to monitor snoring activity, analyze sleep quality, and provide actionable insights to users.


Components Used

Hardware

  • Seeed Studio MG24 Sense

Software & Tools

  • Simplicity Studio IDE (for firmware development)

  • Edge Impulse Studio (for model Training)
  • TensorFlow Lite Micro (for running AI model inference on MCU)

  • C/C++ programming

  • Custom Snore Detection ML Model (trained on snore vs. non-snore audio samples)

  • Android/iOS App (future expansion) for displaying sleep score & history


Implementation Steps

Step 1: Dataset Preparation

  • The dataset for snoring vs. non-snoring audio can be sourced from Kaggle (public audio datasets).

  • Alternatively, you can record your own dataset using a microphone in different conditions (quiet background, fan noise, conversations, actual snores).

  • Make sure you label the dataset into two classes: Snore and Non-Snore.

 


Step 2: Model Training using Edge Impulse Studio

  1. Go to Edge Impulse Studio.

  2. Create a new project (e.g., SnoreSense AI).

  3. Select Audio Classification project type.

  4. Upload your datasets (Snore / Non-Snore audio samples).

  5. Use MFCC (Mel Frequency Cepstral Coefficients) feature extraction for audio preprocessing.

  6. Add a Neural Network (Keras) block for classification.

  7. Train the model and validate accuracy.

  8. Once trained, go to Deployment → TensorFlow Lite for Microcontrollers.

  9. Download the generated .tflite model file from Dashboard.


Step 3: Converting Model in Simplicity Studio

  1. Open Simplicity Studio IDE.

  2. Create a new empty C++ project for your target device (e.g., EFR32xG24).

  3. Copy the .tflite file into the config folder of your project.

  4. Enable AI/ML SDK in the project settings.

    • Go to Project → Properties → SDKs and enable AI/ML SDK.

  5. Build the project.

  6. The .tflite file will be automatically converted into .c and .h array files, which will appear inside the autogen folder of your project.

You check the other information on the silicon lab website 


Step 4: System Description

  • Data Flow:
    Microphone → MCU (Noise Filtering + AI Inference) → Snore Events → Sleep Score → Bluetooth → Smartphone App

  • Key Algorithms:

    • Adaptive silence threshold

    • RMS-based amplitude filtering

    • TensorFlow Lite Micro inference

    • Snore probability margin filtering

    • Sleep score calculation

  • User Experience:

    1. Place SnoreSense device near bed.

    2. Device listens and detects snores overnight.

    3. Sleep score & snore insights are available on smartphone app.

Step 5: Arduino IDE Integration

  1. Install the Silicon Labs Arduino Core and required libraries:

  2. Install the Silicon Labs board files from board manager.

       

  1. Create a new Arduino sketch.

  2. Include the necessary headers:

    #include <SilabsMicrophoneAnalog.h>
    #include "SilabsTFLiteMicro.h"
  3. Copy the .c and .h files (generated from Simplicity Studio) into your Arduino project folder.

  4. In your Arduino code, configure the microphone and inference logic (as in your final working snore detection sketch). Check the steps given on the Github page.

  5. Sleep Quality Monitoring

    • Count snore events per hour.

    • Track intensity, frequency, and duration of snoring.

    • Compute Sleep Score using formula:

      Sleep Score = 100 – (Weighted impact of snore frequency, duration, intensity)
    • Classify sleep into categories: Excellent, Good, Fair, Poor.

    • You can find the full working code on this github link.

Compile and upload the sketch to your development board.


Step 5: Testing and Verification

  • Place the device near the bed while sleeping.

  • Open Serial Monitor to view:

    • Snore detected / No snore detected

    • Sleep score update

  • Verify that the inference results match real-world audio input.

    Bluetooth Communication (Future Integration)
    • Transmit snore events, sleep score, and timeline to smartphone.

    • Display results in a mobile app with daily/weekly/monthly trend.

   

Results

  • Successfully detects snores in real-time.
  • Adaptive threshold reduces false positives from fan noise and speech.
  • System computes sleep score based on snore patterns.
  • Basic results displayed via Serial Monitor, with planned mobile integration.

 Uses / Applications

  • Personal sleep monitoring at home.
  • Early detection of potential sleep apnea or breathing disorders.
  • Non-invasive sleep quality assessment.
  • Integration with smart home/IoT devices for health tracking.

 Future Expansion

  • Android/iOS Mobile App for:
  • Sleep score dashboard 
  • Snore pattern visualization
  • Long-term trends & cloud sync
  • Integration with Wearables (heart rate, SpO2) for comprehensive sleep monitoring.
  • Machine Learning Improvements – refine model with more diverse datasets to distinguish snore vs. speech more accurately.
  • Alerts & Smart Actions – vibrate a smart band or adjust smart home devices (e.g., increase room airflow) when excessive snoring is detected.

 Conclusion

SnoreSense demonstrates how AI at the edge can enable affordable and effective sleep monitoring. By combining low-power hardware, real-time snore detection, and AI inference, it provides valuable insights into sleep quality. With future Bluetooth app integration, SnoreSense has the potential to become a powerful personal health companion for millions of users struggling with sleep disorders.

Code
  • Arduino IDE Code

    https://github.com/rjrishabh/Snore-detection-MG24
    View

SnoreSense : An AI powered Sleep Quality Monitor

SnoreSense is an intelligent sleep quality monitoring device that leverages AI-powered snore detection to assess and improve sleep health.

174
 
3
1
0

Share your project on social media to expand its influence! Get more people to support it.

  • Comments( 1 )
  • Like( 3 )
/1000
Upload a photo:
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP

You May Also Like

View All
Add to cart
Board Type : GerberFile :
Layer : Dimensions :
PCB Qty :
Different PCB Design
PCB Thickness : PCB Color :
Surface Finish : Castellated Hole :
Copper Weight : 1 oz Production Time :
Total: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.

PCB Assembly

PCBA Qty: BomFile:
NO. OF UNIQUE PARTS: NO. of Components:
Country: Shipping Way:
Assembly Cost: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
3dPrintingFile : Size :
Unit : Volumn :
3D Printing Qty : Material :
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Acrylic Type : AcrylicFile :
Dimensions: Engrave:
Acrylic Qty :
Acrylic Thickness:
Acrylic Color:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
CNC Milling File : Size:
Unit: Volumn:
CNC Milling Qty : Material:
Type of Aluminum: Surface Finish:
Tolerance:
Surface Roughness:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Item Price Qty Subtotal Delete
Total: US $0.00
Certified Product | Supported Purchase: Full After-sales Protection