IoT Based Patient Health Monitoring System using ESP8266 & Arduino

IoT Based Patient Health Monitoring System using ESP8266 & Arduino (Last Updated On: February 24, 2019)

Patient Health Monitoring System using ESP8266 & Arduino:

With tons of new healthcare technology start-ups, IoT is rapidly revolutionizing the healthcare industry. In this project we have designed IoT Based Patient Health Monitoring System using ESP8266 & Arduino. The IoT platform used in this project is ThingSpeak. 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. This IoT device could read pulse rate and measure surrounding temperature. It continuously monitors the pulse rate and surrounding temperature and updates them to an IoT platform.

The Arduino Sketch running over the device implements the various functionalities of the project like reading sensor data, converting them into strings, passing them to the IoT platform and displaying measured pulse rate and temperature on character LCD.

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. ECG Display using Pulse Sensor with OLED & Arduino.

Block Diagram:

IoT Based Patient Health Monitoring System using ESP8266 & Arduino

This is a simple block diagram that explains IoT Based Patient Health Monitoring System using ESP8266 & Arduino. Pulse Sensor and LM35 Temperature Sensors measures BPM & Environmental Temperature respectively. The Arduino processes the code and displays to 16*2 LCD Display. ESP8266 Wi-Fi module connects to Wi-Fi and sends the data to IoT device server. The IoT server used here is Thingspeak. Finally the data can be monitored from any part of the world by logging into Thingspeak channel.

Components Required:

1. Arduino UNO Board
2. ESP8266 Wi-Fi Module -  (Buy Online from Amazone)
3. Pulse Sensor -  (Buy Online from Amazone)
4. LM35 Temperature Sensor (Buy Online from Amazone)
5. 16*2 LCD Display (Buy Online from Amazone)
6. Resistor 2K
7. Resistor 1K
8. LED
9. Breadboard
10. Connecting Wires

Pulse Sensor:

IoT Based Patient Health Monitoring System using ESP8266 & 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.

IoT Based Patient Health Monitoring System using ESP8266 & 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.

LM35 Temperature Sensor:

The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly-proportional to the Centigrade temperature. The LM35 device has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from the output to obtain convenient Centigrade scaling. The LM35 device does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature range.

IoT Based Patient Health Monitoring System using ESP8266 & Arduino


The ESP8266 is a very user friendly and low cost device to provide internet connectivity to your projects. The module can work both as a Access point (can create hotspot) and as a station (can connect to Wi-Fi), hence it can easily fetch data and upload it to the internet making Internet of Things as easy as possible. It can also fetch data from internet using API’s hence your project could access any information that is available in the internet, thus making it smarter. Another exciting feature of this module is that it can be programmed using the Arduino IDE which makes it a lot more user friendly.

IoT Based Patient Health Monitoring System using ESP8266 & Arduino

The ESP8266 module works with 3.3V only, anything more than 3.7V would kill the module hence be cautions with your circuits. Here are 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 Based Patient Health Monitoring System using ESP8266 & Arduino, assemble the circuit as shown in the figure below.

IoT Based Patient Health Monitoring System Circuit Diagram

1. Connect Pulse Sensor output pin to A0 of Arduino and other two pins to VCC & GND.
2. Connect LM35 Temperature Sensor output pin to A1 of Arduino and other two pins to VCC & GND.
3. Connect the LED to Digital Pin 7 of Arduino via 220 ohm resistor.
4. Connect Pin 1,3,5,16 of LCD to GND.
5. Connect Pin 2,15 of LCD to VCC.
6. Connect Pin 4,6,11,12,13,14 of LCD to Digital Pin12,11,5,4,3,2 of Arduino.
7. The RX pin of ESP8266 works on 3.3V and 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 2.2K & 1K resistor. Thus the RX pin of the ESP8266 is connected to the pin 10 of Arduino through the resistors.
8. Connect the TX pin of the ESP8266 to the pin 9 of the Arduino.

Setting the ThingSpeak:

ThingSpeak provides very good tool for IoT based projects. By using 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 and create an account.
Thingspeak setup

Then create a new channel and set up what you want. The tutorial in the video below. Follow the video for more clearifications.

Then create the API keys. This key is required for programming modifications and setting your data.
Thingspeak setup

Then upload the code to the Arduino UNO by assembling the circuit shown above. Open serial monitor and it will automatically connect to Wi-Fi and set up everything.

Now cick on channels so that you can see the online data streaming, i.e IoT Based Patient Health Monitoring System using ESP8266 & Arduino as shown in figure here.

Thingspeak setup

IoT Based Patient Health Monitoring System using ESP8266 & Arduino

Source Code/Program:

The source code for the project IoT Based Patient Health Monitoring System using ESP8266 & Arduino is given below. Simply copy the code and paste it to your Arduino IDE, then compile it and upload to your Arduino UNO Board.

Video Tutorial & Explanation:

Watch this full video for full understanding and setting up things.

Recommended For You

About the Author: Alex Newton


  1. C:\Users\Muhammad\Documents\Arduino\sketch_jan01a\sketch_jan01a.ino: In function ‘void esp_8266()’:

    C:\Users\Muhammad\Documents\Arduino\sketch_jan01a\sketch_jan01a.ino:282:20: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]



      1. The same errors are coming for me too…. PLEASE HELP

        C:\Users\Abhishek Jaxson\Desktop\ESP8266\ESP8266.ino: In function ‘void esp_8266()’:

        C:\Users\Abhishek Jaxson\Desktop\ESP8266\ESP8266.ino:282:20: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]



  2. I did everything right and ı checked serial port monitor that is same as yours too but there is no plotting on thingspeak please help me

      1. I changed API key and ssıd password part with my connection name and password but ıt dıdnt work , and when the project is running there is no blink on blue led ESP8266 please help me could you give your mail adress or a contact maybe you can solve my problem ( ı am doing this project for my final project 🙁 ı need help

      2. without ssid and can we connect this esp8266 to thinkspeak.How can it connect automatically and how can we know to which network it connected.channels are not being updated and entries are not uploaded.
        please help us to solve this problem immediately.

        1. You need to modify the code by entering your wifi ssid and password. You also need api key from thingspeak server to upload data.

          Watch the video tutorial below. I have explained each and every step.

  3. Hello Alex. i am using this only for Temperature measurement. I have followed every steps. Getting the result on serial monitor

    GET /update?api_key=3K6P53DUDEUH8OFW&field1=72.43

    But unable to upload/see the result on “ThingSpeak”. Can you guide me ??

  4. Hello. The Esp8266 is supplied. The serial monitor works, everything works, exept the esp module. only the red led is on, the one who need to make the conection is not and do not blink. What can i do?

  5. I am doing the same project on arduino mega board but the data are not being sent, I read on arduino forum that for mega i have to remove softwareserial library, but then where should i connect the Rx and Tx pin of esp8266 also after removing “ser” is said to be not declared what should i write instead of “ser” please help.

    1. Every pin of Arduino mega doesn’t accept interrupt. Those pins which accept interrupt can only be used as software serial.

Ask A Question .......