Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » ECG Display using Pulse Sensor with OLED & Arduino
Arduino Projects

ECG Display using Pulse Sensor with OLED & Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:May 26, 202310 Comments5 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
ECG Display using Pulse Sensor with OLED & Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

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 beginner:
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:



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:

S.N.Components NameQuantityPurchase Links
1Arduino Nano Board1Amazon | AliExpress
2Pulse Sensor1Amazon | AliExpress
40.96" I2C OLED Display1Amazon | AliExpress
5Buzzer 5V1Amazon | AliExpress
6Connecting Wires10Amazon | AliExpress
7Breadboard1Amazon | AliExpress

Pulse Sensor:

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. The essence is an integrated optical amplifying circuit and noise eliminating circuit sensor. Clip the Pulse Sensor to your earlobe or fingertip and plug it into your Arduino, you can ready to read heart rate. Also, it has an Arduino demo code that makes it easy to use.

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

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 that 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.

OLED Display

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 another pin to GND.


Working & Setup:

Pulse Sensor:

The pulse sensor works by emitting an Infra-Red signal from an IR-Diode onto the skin. Just underneath the skin, there are capillaries carrying blood. Every time heart pumps there is a 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 an ECG waveform plotter along with BPM on the OLED display. For this we need 2 different library, i.e SSD1306 Driver & GFX Library. Firstly ensure you’ve bought an 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 a particular device address. To find the I2C address first scan the OLED with the 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 the finger is placed the BPM value is displayed as well as the graph is drawn along with the 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 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 libraries. 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.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <Adafruit_SSD1306.h>
#define OLED_Address 0x3C // 0x3C device address of I2C OLED. Few other OLED has 0x3D
Adafruit_SSD1306 oled(128, 64); // create our screen object setting resolution to 128x64
 
int a=0;
int lasta=0;
int lastb=0;
int LastTime=0;
int ThisTime;
bool BPMTiming=false;
bool BeatComplete=false;
int BPM=0;
#define UpperThreshold 560
#define LowerThreshold 530
 
void setup() {
oled.begin(SSD1306_SWITCHCAPVCC, OLED_Address);
oled.clearDisplay();
oled.setTextSize(2);
}
 
void loop()
{
if(a>127)
{
oled.clearDisplay();
a=0;
lasta=a;
}
 
ThisTime=millis();
int value=analogRead(0);
oled.setTextColor(WHITE);
int b=60-(value/16);
oled.writeLine(lasta,lastb,a,b,WHITE);
lastb=b;
lasta=a;
 
if(value>UpperThreshold)
{
if(BeatComplete)
{
BPM=ThisTime-LastTime;
BPM=int(60/(float(BPM)/1000));
BPMTiming=false;
BeatComplete=false;
tone(8,1000,250);
}
if(BPMTiming==false)
{
LastTime=millis();
BPMTiming=true;
}
}
if((value<LowerThreshold)&(BPMTiming))
BeatComplete=true;
 
oled.writeFillRect(0,50,128,16,BLACK);
oled.setCursor(0,50);
oled.print("BPM:");
oled.print(BPM);
 
oled.display();
a++;
}


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.

ECG Display Using Pulse Sensor & OLED || Arduino with OLED & Pulse Sensor
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleDigital Thermometer Using Arduino & DS18B20 Temperature Sensor
Next Article Arduino Based Calculator using Keypad & LCD for Calculation

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 10 Comments

10 Comments

  1. Kristofer Valencio on March 30, 2019 10:43 PM

    if i was using 3.3 volt, which part of the code i need to change?

    Reply
    • Alex Newton on March 31, 2019 7:25 AM

      No

      Reply
  2. Daniel Puay on May 31, 2019 9:13 AM

    how to add in LED when pulse is detected and monitor tab code?

    Reply
  3. ohn than on June 18, 2019 12:31 PM

    It completes to understand the project,

    Reply
  4. antonio on October 22, 2019 12:04 AM

    HI, great poject
    for sh1106 how should i change the code?

    Reply
  5. Aleksandar Babić on May 5, 2020 10:52 PM

    Can anyone help me explain the code

    Reply
  6. Pontus on May 20, 2020 2:06 PM

    is the librarys compatible with mplabs using a pick it 3?

    Reply
  7. issam on June 8, 2020 3:10 AM

    hallo,
    please can you send a photo which explain what will be displayed on the LCD screen?
    (heart logo or BPM or sentence)

    Reply
  8. issam on June 25, 2020 7:20 PM

    please explain me if you are understand it

    Reply
  9. Siddhesh Bhagwat on May 3, 2023 2:26 AM

    I can get synopsis for this project

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 16, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • How to use ADS1115 16-Bit ADC Module with Arduino
    How to use ADS1115 16-Bit ADC Module with Arduino
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • Interfacing PN532 NFC RFID Module with Arduino
    Interfacing PN532 NFC RFID Module with Arduino
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.