ESP8266/IoT B.Tech/Diploma Beginner

IoT BPM Monitoring on ThingSpeak using ESP8266 & Pulse Sensor

IoT Based Pulse Rate BPM Heart Rate Monitoring using ESP8266 Pulse Sensor & ESP8266 Code on Thingspeak Server. ESP8266 Pulse Sensor Code

  • Suitable forB.Tech/Diploma ESP8266/IoT students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview: IoT BPM Monitoring on ThingSpeak using ESP8266 & Pulse Sensor
In this project, we are going to make IoT BPM Monitoring on ThingSpeak using Pulse Sensor, ESP8266 & Arduino. The device will detect the pulse rate using the Pulse Sensor and will show the readings in BPM (Beats Per Minute) on the LCD display. It will send the readings to the ThingSpeak server via the Wi-Fi module ESP8266. This will help us to monitor the heartbeat via the Internet from any part of the world.
ThingSpeak is an open-source Internet of Things (IoT) application and API to store and retrieve data from things using the HTTP protocol over the Internet or via a Local Area Network.
Before moving ahead, you can check our earlier version of the project. You can learn about the basics of
Pulse Sensor
. This will clear your doubts about the Sensor working.
Bill of Materials:
Following is the list of components that you need for this project. You can purchase all the components easily from the Amazon.
S.N.
Components Name
Quantity
Purchase Links

Arduino Nano Board

Amazon
AliExpress

ESP8266-01 WiFi Module

Amazon
AliExpress

16x2 LCD Display

Amazon
AliExpress

Potentiometer 10K

Amazon
AliExpress

Pulse Sensor

Amazon
AliExpress

Resistor 2K

Amazon
AliExpress

Resistor 1K

Amazon
AliExpress

LED 5mm Any Color

Amazon
AliExpress

Connecting Wires
10-20
Amazon
AliExpress

Breadboard

Amazon
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 are now 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 an LED at the center of this sensor module which helps in detecting the
heartbeat
. Below the LED, there is a noise elimination circuitry that keeps away the noise from affecting the readings.
ESP8266:
The ESP8266 is a very user-friendly and low-cost device to provide internet connectivity to your projects. The module can easily fetch data and upload it to the internet. It can also fetch data from the internet using API’s hence your project could access any information that is available on the internet, thus making it smarter. Another exciting feature of this module is that you can program it using the Arduino IDE.
The ESP8266 module works with 3.3V only. Anything more than 3.7V would kill the module. Hence be cautious with your circuits. Here is its pins description.
Pin 1 : Ground :
Connected to the ground of the circuit
Pin 2 : Tx/GPIO – 1 :
Connected to Rx pin of programmer/uC to upload program
Pin 3 : GPIO – 2 :
General purpose Input/output pin
Pin 4 : CH_EN :
Chip Enable/Active high
Pin 5 : Flash/GPIO – 0 :
General purpose Input/output pin
Pin 6 : Reset :
Resets the module
Pin 7 : RX/GPIO – 3 :
General purpose Input/output pin
Pin 8 : Vcc :
Connect to +3.3V only
Circuit Diagram & Connections:
For designing IoT BPM Monitoring on ThingSpeak using ESP8266 & Pulse Sensor, assemble the circuit as shown in the figure below.
1. Connect Pulse Sensor output pin to A0 of Arduino and other two pins to VCC & GND.
2. Connect the LED to Digital Pin 7 of Arduino via a 220-ohm resistor.
3. Connect Pin 1,3,5,16 of LCD to GND.
4. Connect Pin 2,15 of LCD to VCC.
5. Connect Pin 4,6,11,12,13,14 of LCD to Digital Pin12,11,5,4,3,2 of Arduino.
6. The RX pin of ESP8266 works on 3.3V. Therefore, it will not communicate with the Arduino when we will connect it directly to the Arduino. So, we will have to make a voltage divider for it which will convert the 5V into 3.3V. This can be done by connecting the 2.2K & 1K resistor. Thus the RX pin of the ESP8266 is connected to pin 10 of Arduino through the resistors.
7. Connect the TX pin of the ESP8266 to pin 9 of the Arduino.
Setting the ThingSpeak:
ThingSpeak provides a very good tool for IoT based projects. By using the ThingSpeak site, we can monitor our data and control our system over the Internet, using the Channels and web pages provided by ThingSpeak. So first you need to sign up for ThingSpeak. So visit
https://thingspeak.com
and create an account.
Then create a new channel and set up what you want. The tutorial in the video below. Follow the video for more clarification.
Then create the
API keys
. This key is required for programming modifications and setting your data.
Then upload the code to the Arduino UNO by assembling the circuit shown above. Open the serial monitor and it will automatically connect to Wi-Fi and set up everything.
Now click on channels so that you can see the online data streaming, i.e Pulse Rate Monitoring over the Internet using ThingSpeak & ESP8266 with Arduino as shown in the figure here.
Source Code/Program:
The source code for the project PIoT BPM Monitoring on ThingSpeak using ESP8266 & Pulse Sensor is given below. Simply copy the code and paste it to your Arduino IDE. Then compile the code and upload it to your Arduino UNO Board.

#include <SoftwareSerial.h>
#define DEBUG true
SoftwareSerial
esp8266
(

)
;
#include <LiquidCrystal.h>
#include <stdlib.h>
LiquidCrystal
lcd
(

)
;
#define SSID "Alexahome" // "SSID-WiFiname"
#define PASS "98765432" // "password"
#define IP "184.106.153.149"// thingspeak.com ip
String
msg
=
"GET /update?key=W86OQNB83XEQIMN4"
;
//change it with your api key
//Variables
float
temp
;
int
hum
;
String
tempC
;
int
error
;
int
pulsePin
=

;
// Pulse Sensor connected to analog pin
int
blinkPin
=

;
// pin to blink led at each beat
int
fadePin
=

;
int
fadeRate
=

;
// Volatile Variables, used in the interrupt service routine!
volatile
int
BPM
;
// int that holds raw Analog in 0. updated every 2mS
volatile
int
Signal
;
// holds the incoming raw data
volatile
int
IBI
=

;
// int that holds the time interval between beats! Must be seeded!
volatile
boolean
Pulse
=
false
;
// "True" when heartbeat is detected. "False" when not a "live beat".
volatile
boolean
QS
=
false
;
// becomes true when Arduino finds a beat.
// Regards Serial OutPut -- Set This Up to your needs
static
boolean
serialVisual
=
true
;
// Set to 'false' by Default.
volatile
int
rate
[

]
;
// array to hold last ten IBI values
volatile
unsigned
long
sampleCounter
=

;
// used to determine pulse timing
volatile
unsigned
long
lastBeatTime
=

;
// used to find IBI
volatile
int
P
=

;
// used to find peak in pulse wave
volatile
int
T
=

;
// used to find trough in pulse wave
volatile
int
thresh
=

;
// used to find instant moment of heart beat
volatile
int
amp
=

;
// used to hold amplitude of pulse waveform
volatile
boolean
firstBeat
=
true
;
// used to seed rate array
volatile
boolean
secondBeat
=
false
;
// used to seed rate array
void
setup
(
)
{
lcd
begin
(

)
;
lcd
(
"Connecting..."
)
;
Serial
begin
(
9600
)
;
esp8266
begin
(
9600
)
;
Serial
println
(
"AT"
)
;
esp8266
println
(
"AT"
)
;
del

Technologies used

ESP8266ArduinoThingSpeakWiFiBLELCDArduino IDE

Hardware components

  • ESP8266
  • Arduino

Software & tools

  • Arduino IDE
  • ThingSpeak

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.