Embedded Systems · Edge Vision · Biosignal

Detect drowsiness.
Warn without blocking.

A two-Raspberry-Pi embedded prototype that separates stable PPG acquisition from compute-heavy EAR vision, then connects the sensing server to an analysis/alarm client.

2 × RPi 4Distributed sensing / analysis
200 HzDesigned PPG sampling rate
EAR < 0.22Eye-closure threshold
2 sDrowsiness duration

01 · Architecture

Split real-time workloads

Node A focuses on MCP3204 PPG sampling and BPM packets. Node B combines webcam EAR, file IPC, LCD, LED, and buzzer control, reducing interference between acquisition timing and vision processing.

Two-Raspberry-Pi PPG EAR drowsiness monitoring architecture
PPG sensing server → TCP/IP → EAR analysis and alarm client
Node A

Sensing server

PPG front end, 12-bit ADC, HPF/LPF, peak/IBI/BPM calculation, and TCP transmission.

Node B

Analysis client

Reads webcam EAR state and BPM packets, updates the LCD, and makes the drowsiness decision.

Alarm

Non-blocking output

Timer-based LED and active-buzzer toggling avoids unnecessary blocking of communication and UI paths.

02 · Dual Signal Path

PPG monitors; EAR decides

BPM is an auxiliary display value. The primary drowsiness condition is EAR below 0.22 for approximately two seconds—a role boundary preserved in both code and documentation.

PPG ADC filter peak IBI BPM pipeline
PPG → filtered pulse → IBI/BPM
Camera facial landmark EAR drowsiness pipeline
Camera → eye landmarks → EAR → closed duration
PPG formula

BPM = 60,000 / IBIms

First-order HPF/LPF filtering precedes adaptive peak and refractory conditions.

EAR formula

Vertical eye distance / width

The geometric ratio falls with closure; a duration rule avoids treating a momentary crossing as drowsiness.

03 · Communication

TCP and IPC connect behavior

Node A sends SN-RPI-001,BPM,status over TCP port 5000. The EAR engine shares state with the C client through /tmp/ear_state.txt.

TCP sequence between sensing server and analysis alarm client
START/STOP, packet, display, and alarm sequence
Raspberry Pi GPIO SPI I2C buttons LED buzzer pin map
GPIO, SPI, I²C, and USB boundaries

04 · Prototype Evidence

A built system, not just diagrams

Repository photographs document the circuit, wearable sensor, Raspberry Pi, LCD, code, and demonstration. No public latency, sensitivity, or specificity dataset is present, so this page does not claim numerical performance.

Wearable PPG sensor prototypeRaspberry Pi circuit and LCD prototypeDrowsiness monitoring code and demonstration
Contact sheet of the built drowsiness monitoring system
Hardware and demonstration contact sheet
Validation axisCurrent evidenceInterpretation
Circuit and mechanicsPhoto evidenceWearable, PPG circuit, and RPi/LCD photographs
Software structureSource documentedC/C++/Bash, TCP, IPC, and GPIO paths included
Numerical performanceNot reportedNo public latency, sensitivity, or specificity table
Product/safety certificationPrototype onlyNot a certified driver-safety or medical device