Heartrate on OLED Display in Real Time
by Upside Down Labs in Circuits > Sensors
1267 Views, 12 Favorites, 0 Comments
Heartrate on OLED Display in Real Time
In this project we will be using DIY Neuroscience Kit Pro to visualize heart rate on the OLED display.
But before moving forward let's understand heart rate.
The heart rate is the number of times the heart beats in 1 minute or 60 seconds. For most adults, a target resting heart rate is between 60–100 beats per minute.
Supplies
DIY Neuroscience Kit Pro (Upside Down Labs Store | Amazon India | Robu India | Tindie | DigiKey)
The kit includes:
- BioAmp EXG Pill (Assembled)
- Arduino Uno with USB Cable
- BioAmp Cable (100cm)
- 3 x Jumper Cables
- NuPrep Skin Preparation Gel (25g)
- Wet Wipes x 10
- Repositionable Gel Electrodes x 3
- Boxy Gel Electrodes x 100
- Gel Electrodes (4 variants, 6pcs each)
- Muscle BioAmp Band (EMG Band)
- Brain BioAmp Band (EEG Band)
- Heart BioAmp Band (ECG)
- Electrode Gel (30ml)
- Servo Claw
- Muscle BioAmp Shield Kit
- Muscle BioAmp Shield v0.3 (Assembled)
- BioAmp Cable (100cm)
- Muscle BioAmp Band (EMG Band)
- BioAmp AUX Cable
- Gel Electrodes (4 variants, 6pcs each)
- STEMMA Cables x 6
- 9V Snap Cable
1 x OLED display
SOFTWARE:
Arduino IDE v1.8.X (Legacy IDE)
About DIY Neuroscience Kit Pro:
It is like your Neuroscience Lab in a Box which lets you explore the world of neuroscience by recording various biopotential signals of your body (EEG, EMG, ECG, EOG) and making amazing HCI and BCI projects.
Configuration for ECG
BioAmp EXG Pill is by default configured for recording EEG or EOG but if you want to record good quality ECG or EMG, then it is recommended to configure it by making a solder joint as shown in the image above.
Note: Even without making the solder joint the BioAmp EXG Pill is capable of recording ECG or EMG as well but the signals would be more accurate if you configure it.
Stacking Muscle BioAmp Shield on Arduino Uno
Stack the Muscle BioAmp Shield on top of Arduino Uno properly.
Connecting BioAmp EXG Pill to Muscle BioAmp Shield
Now it's time to connect the BioAmp EXG Pill to Muscle BioAmp Shield using the 3 pin STEMMA Cable.
Connect the JST Ph 2.0 connector of STEMMA cable to the STEMMA Analog port of Muscle BioAmp Shield as shown in the video above.
Now connect the female jumpers of the same STEMMA cable to BioAmp EXG Pill as described below:
The connections should be as per the following:
GND to GND
VCC to VCC
A2 to OUT
Note: BE VERY CAREFUL and while making the connections between your BioAmp EXG Pill & Muscle BioAmp Shield, especially the GND and VCC else it may damage the sensor.
Connecting Electrode Cable
Connect the BioAmp Cable to BioAmp EXG Pill
Skin Preparation
Apply Nuprep Skin Preparation Gel on the skin surface where electrodes would be placed to remove dead skin cells and clean the skin from dirt. After rubbing the skin surface thoroughly, clean it with a wet wipe.
About Nuprep Gel:
Nuprep skin preparation gel is a mildly abrasive, highly conductive gel that should be applied before placing the electrodes on the skin to improve measurements. When applied gently, it strips away the top layer of skin and moistens the underlying skin layer which reduces the skin impedance with minimal skin irritation and discomfort.
Electrode Placements
So now we have 2 options to measure the ECG signals, either using the gel electrodes or using dry electrode based ECG band. You can try both of them one by one.
Option 1 - Measuring ECG using Gel electrodes:
- Connect the BioAmp Cable to gel electrodes,
- Peel the plastic backing from electrodes
- Place the IN- cable on the left side, IN+ in the middle and REF (reference) on the far right side as shown above.
Option 2 - Measuring ECG using Heart BioAmp Band, a dry electrode based ECG band:
- Place the IN- cable on the left side, IN+ in the middle and REF (reference) on the far right side as shown above.
- Now put a small drop of electrode gel on the dry electrodes between the skin and metallic part of BioAmp Cable to get the best results.
Connect OLED Display
Connect the OLED Display to any one of the I2C ports of Muscle BioAmp Shield using the 4 pin STEMMA cable as per the following:
VCC to VCC
GND to GND
SCL to SCL
SDA to SDA
Download Arduino IDE
Download the Arduino IDE from the link given below:
https://www.arduino.cc/en/software
(We have used Arduino IDE version 1.8.19 for this project)
After downloading, connect the Arduino Uno to your laptop using the USB Cable
Note: Make sure your laptop is not connected to a charger and sit 5m away from any AC appliances for best signal acquisition.
Coding Time!
Copy paste the Arduino Sketch given below in Arduino IDE and upload it.
Visualize heart rate on OLED: https://github.com/upsidedownlabs/Heart-BioAmp-Arduino-Firmware/blob/main/7_OLED_BPM/OLED_BPM.ino
After uploading the code successfully, the red LED on Muscle BioAmp Shield will start blinking indicating the heartbeats. Now open the serial monitor to check your heart rate.
Note: The values of heart rate on serial monitor as well as on OLED will appear after 30-40 seconds.
Enjoy
The project is finally complete!!
Let us know your feedback in the comments and feel free to ask any questions.
You can also mail us at support@upsidedownlabs.tech for any kind of support while you are making this project.