This Arduino sketch provides real-time feedback for CPR training. It uses various sensors and an LCD display to guide the user on compression depth, rate, and release quality, and also monitors for signs of breathing.
- Compression Count: Tracks the number of chest compressions performed.
- Compression Rate (BPM): Calculates and displays the beats per minute (BPM) for your compressions, ensuring you're within recommended guidelines.
- Compression Depth Feedback: Utilizes an ultrasonic sensor to measure compression depth. An audible buzzer alert sounds if the depth isn't sufficient.
- Compression Release Feedback: A pressure sensor helps assess if you're fully releasing after each compression, indicated by a white LED for "good" release and a red LED for "bad" (incomplete) release.
- Pulse Detection: Includes a pulse sensor, though its primary use in CPR is typically post-resuscitation.
- Breathing Detection: A DHT11 humidity sensor monitors for changes in humidity, suggesting the presence of breathing.
- LCD Display: A 16x2 LCD screen provides real-time visual feedback on your compression count, rate, and the total time taken for a CPR cycle.
Components | Use | no. |
---|---|---|
LCD | display the cpr and any warnings | 1 |
LEDS | warning and to know if it was good or bad cpr | 3 |
Buzzer | warning | 1 |
DHT | measuring the humidity to know if the patient start breathung | 1 |
Pulse sensor | to observe the heartbeat | 1 |
Ultrasonic sensor | measuring the depth while doing CPR to protect the patient from breaking his chest | 1 |
Pressure sensor | to meassure the pressue of the hand | 1 |
Push button | to count the number of cpr | 1 |
The sketch continuously reads sensor data and updates the LCD to provide immediate feedback:
- Pressing the button increments
cprCount
. - After 30 compressions, total time is recorded.
- BPM (beats per minute) is calculated based on the compression count and elapsed time.
- Between 5 and 30 compressions, the LCD shows if the compression rate is within the AHA recommended 100-120 CPM ("Good") or not ("----").
- Reads the pressure sensor on A0.
- If pressure reading < 500, white LED (
pressGood
) lights indicating good release. - If pressure reading > 501, red LED (
pressBad
) lights indicating incomplete release.
- Ultrasonic sensor measures distance to simulate chest compression depth.
- If depth (distance) is less than 3 units (e.g., cm), buzzer sounds to indicate insufficient depth.
- DHT11 measures humidity.
- If humidity > 50 (threshold may need calibration), green LED (
start_breath
) lights up indicating possible breathing.
Reference