ECG Display using Pulse Sensor with OLED & Arduino

ECG Display using Pulse Sensor with OLED & Arduino (Last Updated On: February 22, 2019)

ECG Display using Pulse Sensor with OLED & Arduino:

With tons of new healthcare technology start-ups, Arduino along with IoT and Embedded System is rapidly revolutionizing the healthcare industry. In this project we will learn how to design ECG Display using Pulse Sensor with OLED & Arduino. We will use 0.96″ OLED Display with 128×64 resolution for BPM & ECG waveform display. The I2C OLED uses only 2 wire, i.e SDA & SCK for serial communication.

The Arduino Sketch running over the device implements the various functionalities of the project. These functions are reading sensor data, converting them into strings, passing them to I2C communication and displaying measured pulse rate in I2C OLED Display.

Before starting, you can check our previous projects related to Pulse Sensor if you are a begineer:
1. Heartbeat/Pulse/BPM Rate Monitor using Arduino & Pulse Sensor.
2. Pulse Rate Monitoring over Internet using ThingSpeak & ESP8266.
3. IoT Based Patient Health Monitoring System using ESP8266 & Arduino.


Block Diagram:

ECG Display using Pulse Sensor with OLED & Arduino


We need 2 different power Supply, each for OLED & Pulse Sensor. We can get these supplies from Arduino UNO Board as it has 3.3 V & 5V output voltage. OLED can be connected to 3.3V & Pulse Sensor to 5V.

Similarly Arduino acts as a processor and converts code into predefined output. The OLED Display works on the principle of I2C Communication. It requires only 2 wires for displaying the defined output.


Components Required:

1. Arduino UNO Board
2. 0.96" I2C OLED Display - (Buy Online from Amazon)
3. Pulse Sensor -  (Buy Online from Amazone)
4. Buzzer
5. Breadboard
6. Connecting Wires

Pulse Sensor:

ECG Display using Pulse Sensor with OLED & Arduino

The Pulse Sensor is a plug-and-play heart-rate sensor for Arduino. It can be used by students, artists, athletes, makers, and game & mobile developers who want to easily incorporate live heart-rate data into their projects.Essence it is an integrated optical amplifying circuit and noise eliminating circuit sensor. Clip the Pulse Sensor to your earlobe or finger tip and plug it into your Arduino ,you can ready to read heart rate. Also it have an Arduino demo code that make it easy to use.

The pulse sensor has three pins: VCC, GND & Analog Pin.

ECG Display using Pulse Sensor with OLED & Arduino



There is also a LED in the center of this sensor module which helps in detecting the heartbeat. Below the LED, there is a noise elimination circuitry which is supposed to keep away the noise from affecting the readings.


0.96″ I2C OLED Display:

This is a 0.96 inch blue OLED display module. The display module can be interfaced with any microcontroller using SPI/IIC protocols. It is having a resolution of 128×64. The package includes display board, display,4 pin male header pre-soldered to board.

ECG Display using Pulse Sensor with OLED & Arduino

OLED (Organic Light-Emitting Diode) is a self light-emitting technology composed of a thin, multi-layered organic film placed between an anode and cathode. In contrast to LCD technology, OLED does not require a backlight. OLED possesses high application potential for virtually all types of displays and is regarded as the ultimate technology for the next generation of flat-panel displays.


Circuit Diagram & Connections:

To design ECG Display using Pulse Sensor with OLED & Arduino, assemble the components as shown in the figure below.

ECG Display using Pulse Sensor with OLED & Arduino

Connect pulse sensor VCC pin to Arduino 5V Pin and GND to GND. Connects its signal pin to Arduino Analog pin A0.

Similarly connect the VCC Pin of OLED Display to Arduino 3.3V pin and GND to GND. Connect its SDA & SCK pins to Arduino A4 & A5 pins respectively.

Connect a buzzer to Arduino digital pin 8 and other pin to GND.


Working & Setup:

Pulse Sensor:

The pulse sensor works by emitting an Infra-Red signal from an IR-Diode onto skin. Just underneath the skin there are capillaries carrying blood. Every time heart pumps there is an small increase in blood flow/pressure. This swells the capillaries slightly, this slightly more filled capillary reflects more infra-red than at times when the heart is not giving your blood a “push”. An Infra-detector on the device senses the different reflected IR levels. Some simple comparator circuitry converts this into a voltage signal which we can read with the Arduino Analog inputs.


OLED 128×64 (SSD1306 Driver) display:

In this project we’re adding ECG waveform plotter along with BPM on OLED display. For this we need 2 different library, i.e SSD1306 Driver & GFX Library. Firstly ensure you’ve bought a OLED 128×68 I²C display (SSD1306 driver) display. It should have four connections, i.e 5V, GND, SDA and SCK.

OLED Address:

Since the OLED used here is an I2C OLED, so it has particular device address. To find the I2C address first scan the OLED with I2C Scanner program. Normally the OLED Display has a device address of 0x3C or 0X3D.

Final Displayed Output:

After code is uploaded to Arduino Board, at first no graph or waveform is seen. But when finger is placed the BPM value is displayed as well as graph is drawn along with beep sound from Buzzer. The value may be irregular or unstable at starting for few seconds but later the value becomes stables. The sensor is not too much accurate as it is cheap. So do not use it for medical purposes.

ECG Display using Pulse Sensor with OLED & Arduino

ECG Display using Pulse Sensor with OLED & Arduino

Note: For some OLED there is a problem with the trace being at the bottom and the BPM being missing then this is caused by the following lines in the Adafruit_SSD1306.h file in your libraries folder :

#define SSD1306_128_64
// #define SSD1306_128_32
// #define SSD1306_96_16

Source Code/Program:

For the project ECG Display using Pulse Sensor with OLED & Arduino you need to add 2 library. So first download the library from here.
1. Adafruit SSD1306 Library




2. Adafruit GFX Library

Now compile and upload this code to your Arduino IDE.


Video Tutorial & Explanation:

The video tutorial for ECG Display using Pulse Sensor with OLED & Arduino is given below. Watch the fulll video for setup & understanding.

Recommended For You

About the Author: Alex Newton

2 Comments

Ask A Question .......

Close