5725

NeuroSense is a real-time, embedded mental health monitoring device powered by STM32N6. It uses speech analysis, EEG signals, and facial emotion recognition to detect stress, anxiety, depression, and other emotional states. With the use of interactive TouchGFX-based touchscreen UI, users can receive instant feedback, mood tracking, and alerts, enabling applications in personal health, workplaces, therapy, and clinical environments. Our proposed system aims to be an optimized, lightweight and efficient.

NeuroSense – Real-Time Mental Health Monitoring System on STM32N6

Introduction
Our project is inspired by the urgent global need for accessible, portable, and continuous mental health monitoring solutions. Mental health issues such as anxiety, stress and depression affect millions worldwide. The excessive emphasis on the physical health monitoring devices has resulted in the world ignoring issues related to mental well-being. The few systems currently available in the medico-tech space are either prohibitively expensive, restricted to clinical environments, or too simplistic to provide meaningful insights.

NeuroSense is our honest attempt to bridge this gap by creating a compact, multimodal, real-time monitoring system powered by the advanced STM32N6 microcontroller with its integrated NPU. The system integrates data streams, EEG signal acquisition, and facial emotion recognition—into a unified AI-based model for mental state inference. By leveraging an EEG signal acquisition circuitry and Yolo-v8 the device can analyze emotional and cognitive patterns directly on the edge, ensuring low latency and high efficiency.

The solution is supported by EEG acquisition circuitry based on established STM32 designs, enabling high-precision amplification, filtering, and digitization of bio-signals. Results and feedback are presented through a TouchGFX-powered interactive LCD interface, offering users instant insights into their stress and mood levels.

Problem Statement
Mental health disorders such as stress, anxiety, and depression are among the most pressing global health challenges, affecting one in eight people worldwide, as reported by the World Health Organization. Beyond the human cost, stress-related conditions result in more than $1 trillion annually in lost productivity. Despite this scale, technological innovation has disproportionately focused on physical health monitoring, leaving mental well-being under-served. The few solutions that exist are either prohibitively expensive, confined to specialized clinical settings, or too basic to deliver actionable insights.

Recognizing this gap, we thought of how embedded systems and edge AI could be harnessed to make mental health monitoring more accessible, continuous, and non-invasive. This reflection led us toward the effort of developing  NeuroSense using the STM32N6 microcontroller, combining advanced real-time neural processing with portability and affordability.

System Architecture
  • 2 Input streams: EEG and facial data
  • Preprocessing: amplification/filtering (EEG).
  • AI Inference: Yolov8 for Facial expression processing and FFT for EEG signal processing
  • Fusion on STM32N6 MCU
  • Outputs: TouchGFX LCD screen displays current facial expression and along with that the type of EEG signal currently observed.
Diagram
elektor
Core Components
  1. STM32N6570-DK Board (main MCU with NPU)
  2. EEG electrodes for brain signal acquisition.
  3. INA128 instrumentation amplifier + OpAmps for filtering.
  4. SD card for local storage.
  5. Battery for portable operation.
Hardware Circuitry
  1. EEG:
    1. Introduction: Electroencephalography (EEG) is a technique to measure the electrical activity of the brain by placing electrodes on the scalp. Typical EEG signals are in the range of microvolts, with frequency content mainly between 0.5 Hz and 100 Hz. Since these signals are extremely weak, a dedicated circuit is required to amplify and filter the signal.
    2. Ideation and Design Approach: The core challenges in EEG signal acquisition are:
      • Very low signal amplitude (µV level) → requires high-gain, low-noise amplifiers.
      • Noise contamination (especially 50 Hz mains hum) → requires careful filtering.
      • ADC compatibility (microcontrollers work on 0–3.3 V or 0–5 V) → requires level-
        shifting and safe output scaling.
    3. Chosen Solution: 
      • INA118 instrumentation amplifier for initial amplification and common-mode noise rejection.
      • Passive low-pass filter to reduce high-frequency interference.
      • Twin-T notch filter tuned to 50 Hz to suppress mains interference.
      • Final gain stage using op-amp for signal scaling.
    4. Circuit Design:
      screenshot-2025-09-30-at-110847-pm.png
      1. Input Stage: INA118 Instrumentation Amplifier
        • Chosen because of high CMRR (~120 dB), essential for rejecting common-mode noise from the body and environment.
        • Gain is set using an external resistor:
          G = 1 + (50k/Rg).
        • The amplifier boosts EEG signals from tens of µV to a few mV.
        • Powered with dual supply to allow symmetric swing around 0 V.
      2. Low-Pass Filter
        • Implemented as a passive RC filter with R = 1 kΩ, C = 1.5 µF.
        • Cutoff frequency:
        • Fc = 1/(2πRC) = 106 Hz
        • Purpose: remove high-frequency interference (>100 Hz), preserving EEG content.
      3. Buffer Stage
        • Implemented with an op-amp in voltage follower configuration.
        • Purpose: prevent loading of the RC filter and stabilize impedance for the next stage.
      4. Twin-T Notch Filter
        • Designed to suppress 50 Hz mains noise.
        • Component selection: R ≈ 3.16 kΩ, C = 1 µF.
        • Notch frequency: 
          • F = 1/(2πRC) = 50.5 Hz
        • Achieved by combining two RC networks (series and parallel) for destructive interference at 50 Hz.
          screenshot-2025-09-30-at-110620-pm.png
        • The red curve in the above photo shows the final output.
    5. Implementation
      • The complete circuit was assembled on a breadboard using the INA118, LM741 op-amps, resistors, and capacitors.
        whatsapp-image-2025-09-28-at-234500.jpeg
      • Power was provided by a ±12 V dual rail supply.
      • Electrodes were connected to the inputs of the INA118.
      • Outputs were observed on an oscilloscope, showing visible EEG activity with mains
        interference suppressed.
    6. Testing and Observations: 
      1. Preliminary tests confirmed amplification of weak input signals.
        whatsapp-image-2025-09-28-at-201736.jpeg
      2. The Twin-T notch filter successfully attenuated 50 Hz noise.
        screenshot-2025-09-30-at-112017-pm.png
      3. The final op-amp stage produced output signals in the expected range (hundreds of mV).
        image-20250930200105.png
      4. Some limitations observed:
        1. Noise floor is still present due to breadboard parasitics and op-amp choice.
        2. LM741 op-amp added offset and drift; modern low-noise op-amps would improve performance.
        3. High-pass filter was not implemented but is recommended for long-term stability.
Data Acquistion for AI Model
For this we used a code from STM32N6 code firmware (VENC) to record video and capture images in my desired size 480x480 after making some changes in IMX335 header file and following instructions from ST Community Forum.
We also used existing dataset available on roboflow
screenshot-2025-09-30-at-115320-pm.png
  • Total of 6 classes :
    • Anger
    • Fear
    • Happy
    • Neutral
    • Sad
    • Disgust
    • Contempt
AI/Machine Learning Models
We tried many models like
  1. SSD MobileNet v2 fpn lite 0.35
  2. Tiny Yolo v2
  3. Yolov8n
  4. ST Yolo X
But eventually settled for yolov8n because as our application had many classes and we preferred accuracy over fps whereas we got less acc. as compared to yolov8n - 91.2%.

Power Management
We tested this with a multimeter and got around 2A.

Potential Use Cases and Applications
  1. Personal Use
    1. Daily mood and stress tracking.
    2. Helps individuals with anxiety or depression monitor changes over time.
    3. Provides actionable insights into emotional well-being.
  2. Workplace Use
    1. Burnout and stress detection in high-pressure jobs (healthcare, IT, emergency services).
    2. Enables preventive measures to improve employee health and productivity.
  3. Healthcare/Clinical Use
    1. Therapy support tool with real-time emotional state data.
    2. Enhances therapy effectiveness.
    3. Useful for remote or resource-limited settings.
    4. Emergency triage of psychological distress in hospitals.
  4. Broader Societal Impact
    1. Reduces stigma by making mental health monitoring seamless and non-invasive.
    2. Can integrate with wellness programs and public health initiatives.
    3. Potential use in educational environments to promote resilience and awareness.

Future Enhancements
In this phase of our project, the primary focus was on emotion detection, while EEG signal analysis remained a challenge due to limitations in our acquisition environment. Detecting specific brain wave patterns such as alpha and beta rhythms was inherently difficult for us as a team because of their low amplitudes (in the range of microvolts) and low frequency bands (most of them within 10s of Hz, all under 100 Hz), which make them highly susceptible to external interference. Issues such as line noise, motion artifacts, and poor electrode contact further affected signal clarity, leading to reduced accuracy in mental state inference.

As part of our future work, we aim to refine the EEG acquisition subsystem by improving electrode placement techniques, shielding, and grounding, as well as designing better amplification and filtering circuits to minimize noise. A multi-electrode setup is the only way to go ahead with accurate EEG signal acquisition to achieve medical-industry level accuracy. By enhancing signal quality and stability, we expect to achieve more reliable detection of alpha, beta, and other critical EEG bands, which will significantly strengthen the overall performance and clinical relevance of the NeuroSense system.

Conclusion

Some Additional Testing Images
  1. b77ca091-e56e-4bc4-a90b-2ea8166f5279-1-102-a.jpeg
  2. whatsapp-image-2025-09-28-at-201739.jpeg
  3. whatsapp-image-2025-09-28-at-234501.jpeg
  4. image-20250930204252.png
  5. image-20250930204327.png
THANK YOU FOR GIVING US THE OPPORTUNITY TO PRESENTING OUR WORK!!!