IOT based ECG monitoring system using node MCU
IOT based ECG monitoring system using node MCU
node MCU
Description
In recent years, heart disease is becoming a major health concern issue.
As per studies of WHO (World Health Organization), many people die out of heart
disease. So, designing an health monitoring device which will enable doctors with
quicker, smarter and effective methods for diagnosis. Here, Our main aim is to
monitor the heart rate using AD8232 ECG sensor. This sensor helps in measuring
the electrical activity of the heart and the analog output of node MCU is sent to the
IOT cloud (Thing Speak) through ESP8266 (WiFi module) for further processing
of data in the cloud.
Hardware Required:
Software Required:
Arduino IDE
Procedure:
1. Connect the 3.3v and GND pin of AD8232 ECG sensor to the node MCU 3v
and GND pin respectively and also power up your node MCU using the
cable.
2. Connect the output pin of AD8232 ECG sensor to Analog pin A0 of node
MCU.
3. Connect the L0- (Leads off detect-) and the L0+ (Leads off detect+) to the
digital pins D7 and D8.
4. Place the 3 electrodes of which one electrode on left hand, other is on right
hand and the final one in left leg.
5. Once the hardware is set up is over, our next aim is to upload the sensor data
to Thing speak channel by creating the channel ID and API key.
9. Now you can see the channels. Click on the ‘API Keys’ tab. Here you will
get the Channel ID and API Keys. Note this down.
10.Next step is to Open Arduino IDE and Install the ThingSpeak Library. To do
this go to Sketch>Include Library>Manage Libraries. Search for
ThingSpeak and install the library.
11. Now we need to modify the code with your corresponding credentials. In the
below code you need to change your Network SSID, Password and your
ThingSpeak Channel and API Keys. Replace the following content in the code,
CODE:
#include <ESP8266WiFi.h>;
#include <WiFiClient.h>;
#include <ThingSpeak.h>;
int val;
int ECGpin = A0; //ECG Pin Connected at A0 Pin of node MCU
WiFiClient client;
void setup()
Serial.begin(9600);
delay(10);
WiFi.begin(ssid, password);
ThingSpeak.begin(client);
void loop()
delay(1000);
12.Upload the code. Once it is connected to Wi-Fi the sensor data from A0 pin
of node MCU will start uploading to the ThingSpeak Channel. You can now
open your Channel and see the data changes plotted on the ThingSpeak IOT
platform.