This project is a heart rate simulator developed for the ESP32 and M5StickC Plus platforms. It is designed to mimic the rhythm of a human heartbeat using an LED. The simulation starts with a heartbeat rate of 120, 85, 70 beats per minute (BPM), representing a faster heartbeat, and gradually slows down to a resting rate of 65 BPM. This project can be used for relaxation assistance, psychological experiments, educational purposes, or simply as a technology demonstration.
- Heart Rate Simulation: Simulates a human heartbeat using an LED, starting at 120,85,70 BPM.
- Gradual Heart Rate Transition: Heart rate gradually decreases from high BPM to 65 BPM over a period, adjustable between 20 to 60 minutes.
- Time-Controlled Transition: Utilizes the
millis()function for timing the transition of the heart rate. - Hardware Compatibility: Specifically designed for M5StickC Plus but compatible with other ESP32 devices. M5StickC Plus features a built-in LED and a display for showing the heart rate.
- Display Functionality: Current heart rate (BPM) displayed on the M5StickC Plus screen for interactive user experience.
- Serial Logging: Outputs heart rate data to a connected computer for monitoring and debugging purposes.
This project was inspired by a Hacker News post, discussing a simple yet effective hack using a blinking LED to sync with one's heartbeat to induce focus and calmness.
- ESP32 or M5StickC Plus
- LED (if using a standard ESP32)
- Appropriate resistors and wiring (for ESP32)
- Arduino IDE
- ESP32/M5StickC Plus specific libraries
- Clone this repository to your local machine.
- Open the project in Arduino IDE.
- Install necessary libraries (details provided in the
Librariessection). - Connect your ESP32 or M5StickC Plus to your computer.
- Select the appropriate board and port in the Arduino IDE.
- Upload the code to your board.
- Power on the ESP32/M5StickC Plus.
- The LED will start blinking at high BPM and gradually slow down to 65 BPM.
- The current BPM is displayed on the M5StickC Plus screen (if using M5StickC Plus).
- Monitor the serial output for heart rate data (optional).
see the LICENSE.md file for details.