Monitor ECG and Heartrate on Your Mobile Phone

by Upside Down Labs in Circuits > Sensors

28 Views, 0 Favorites, 0 Comments

Monitor ECG and Heartrate on Your Mobile Phone

ecg monitor.png

Ever wondered what your heartbeat looks like in real time?

Today, we will help you build this portable ECG monitor using Neuro PlayGround(NPG) Lite. This demo focuses on capturing electrocardiogram (ECG) signals to calculate heart rate using Neuro PlayGround Lite and displaying them in a Chrome-based browser on a mobile phone in real time via a Bluetooth LE connection.

Kudos to Krishnanshu Mittal for building this project.

Now, before moving forward, let’s understand some of the basics of ECG.


What is Electrocardiography (ECG)?

It is a technique for recording the electrical activity of your heart. Each part of the waveform represents a specific phase of your heartbeat—the P wave shows atrial contraction, the QRS complex reflects the contraction of the ventricles, and the T wave represents the relaxation of the ventricles. ECG monitoring can help identify irregular heart patterns and provide valuable health insights.


Supplies

Hardware:

  1. 1 x NPG Lite
  2. 1 x Vibz Playmate
  3. 7 x BioAmp Snap Cables
  4. 7 x Gel electrodes
  5. 1 x Nuprep skin preparation gel
  6. 2 x Alcohol swabs
  7. 1 x Mobile
  8. 1 x Laptop


Software:

  1. Arduino IDE: https://www.arduino.cc/en/software
  2. ECG monitor Web Interface:


About Neuro PlayGround (NPG) Lite:

Neuro PlayGround (NPG) Lite is a compact Adafruit Feather form factor, a 3-channel wireless biopotential signal amplifier designed for EMG, ECG, EOG, and EEG recording.

It offers Wi-Fi, Bluetooth, Zigbee, and Thread connectivity, along with patient protection, LEDs (User LED, charging LED, six addressable RGB LEDs), buttons (Reset and user button), LiPo battery charging, and USB-C with ESD protection. Its lightweight and user-friendly design makes it perfect for research, education, and wearable applications.

Neuro PlayGround Lite will be launched soon on CrowdSupply. Subscribe now to never miss out on any updates.

Skin Preparation

1.gif

Start by applying Nuprep Skin Preparation Gel to the areas where the electrodes will be placed. The Nuprep Gel gently exfoliates the top layer of the skin, removing dead cells and oils that can interfere with signal transmission.

After rubbing the gel in a circular motion for a few seconds, clean the area using an alcohol swab or wet wipe. This step ensures that your skin is ready for the best possible electrode contact—think of it as polishing the lens before taking a photo!

What is Nuprep Gel?

Nuprep is a mildly abrasive, highly conductive gel that improves electrode contact by reducing skin impedance. It's safe, effective, and causes minimal skin irritation.

Connecting BioAmp Cables

3.gif

Once your skin is prepared, it’s time to connect BioAmp Snap Cables.

Connect 3 BioAmp Snap Cables to

  1. Positive of Channel 1 to A0P
  2. Negative of Channel 1 to A0N
  3. Reference cable to REF

Electrode Placements

2.gif

Now connect these BioAmp Snap Cables to gel electrodes, peel the plastic backing, and place them on targeted muscles.

Place the negative cable on the left side of your chest, the positive cable just to its right, and the reference cable on the right side of your chest, as shown above.

Uploading the Firmware

To get your NPG-Lite ready for action, upload the latest firmware using the Arduino IDE, to do this:

  1. Power up the Neuro PlayGround Lite (NPG Lite) by flipping the ON/OFF switch and connecting your NPG device to your laptop/PC with a Type-C Cable.
  2. Open the Chords Arduino Firmware folder on Github: https://raw.githubusercontent.com/upsidedownlabs/Chords-Arduino-Firmware/refs/heads/main/NPG-LITE-BLE/NPG-LITE-BLE.ino
  3. Copy your board's firmware sketch from the GitHub folder - this ensures you're always working with the latest version as updates roll out frequently.
  4. Launch the Arduino IDE and directly paste it into a new Arduino sketch window.
  5. Install the esp32 board from the boards menu. (Note: You don’t need to install Arduino-ESP32 just install esp32)
  6. Install the required libraries, such as Adafruit NeoPixel. The IDE will usually prompt you to install any missing ones — just click “Install” when prompted.
  7. In the Arduino IDE:
  8. Go to Tools → Board and select ESP32 → ESP32C6 Dev Module
  9. Once your board is selected and libraries are installed, click the Upload button.

After the upload completes, remove the cable as your NPG Lite is ready to send EOG and other biopotential data wirelessly.

Running the Web Interface

4.gif

Now, it’s time to visualize the ECG signals on your mobile phone. To do this, open the web interface.

  1. On the top of the screen, you can see your heart rate in beats per minute.
  2. At the bottom of the screen, you will see two buttons,
  3. Connect button lets you pair your NPG Lite to the mobile phone via Bluetooth
  4. The hide peaks button lets you hide the peak markers, which will be on by default.
  5. There is also an option to switch to a full-screen mode by clicking on maximize icon.
  6. You can switch to a light or dark mode using the theme toggle button given at the top right corner.

Now, to visualize the ECG signals in real-time,

  1. Enable Bluetooth on your mobile phone.
  2. Click on Connect.
  3. Connect to the NPG Lite from the available options.

When you’re done, you can click on disconnect.

The web interface is simple and intuitive. In just three steps, you can visualize ECG signals and BPM.

Troubleshooting

Getting an accurate EMG signal is very crucial for this project to work properly. Please check the link below for the tips for best signal acquisition: https://docs.upsidedownlabs.tech/guides/troubleshoot/tips/index.html

In case a weak EMG signal is detected, then ensure there is good electrode contact with the skin surface and you have prepared the skin using nuprep skin preparation gel properly.

If you face any issues with bluetooth connection, then restart NPG Lite and try to reconnect.

Conclusion

This portable ECG monitor is perfect for students, researchers, and hobbyists alike who want to learn about ECG signals and their patterns, monitor heart rate during workouts, and more.

The possibilities are endless. Drop your feedback in the comments.

Need help? Reach out at support@upsidedownlabs.tech