0% found this document useful (0 votes)
30 views7 pages

IOT Patient Health Monitoring Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views7 pages

IOT Patient Health Monitoring Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

IOT Patient Health Monitoring Project

Youtube
 https://www.youtube.com/watch?v=6OxiD91PYXo

Hardware Specifications
 Atmega Microcontroller
 ESP8266 Wifi Module
 Heartbeat Sensor
 Temperature Sensor
 LCD Display
 Resistors
 Capacitors
 Transistors
 Cables and Connectors
 Diodes
 PCB and Breadboards
 LED
 Transformer/Adapter
 Push Buttons
 Switch
 IC
 IC Sockets

Software Specifications
 Arduino Compiler
 MC Programming Language: C
 IOTGecko

Code for Arduino


#include <LiquidCrystal.h>

#include <SoftwareSerial.h>

#include <OneWire.h>

#include <DallasTemperature.h>

#define USE_ARDUINO_INTERRUPTS true

#include <PulseSensorPlayground.h>

SoftwareSerial esp(10, 11);

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);


#define ONE_WIRE_BUS 9

#define TEMPERATURE_PRECISION 12

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

DeviceAddress tempDeviceAddress;

int numberOfDevices, temp, buzzer = 8;

const int PulseWire = A0;

int myBPM, Threshold = 550;

PulseSensorPlayground pulseSensor;

unsigned long previousMillis = 0;

const long interval = 5000;

void setup()

lcd.begin(16, 2);

Serial.begin(9600);

esp.begin(115200);

sensors.begin();

numberOfDevices = sensors.getDeviceCount();

pulseSensor.analogInput(PulseWire);

pulseSensor.setThreshold(Threshold);

pulseSensor.begin();

pinMode(buzzer, OUTPUT);

digitalWrite(buzzer, HIGH);

lcd.setCursor(0, 0);

lcd.print(" IoT Patient");

lcd.setCursor(0, 1);

lcd.print(" Monitor System");

delay(1500);

digitalWrite(buzzer, LOW);

lcd.clear();

}
void loop()

myBPM = pulseSensor.getBeatsPerMinute();

if (pulseSensor.sawStartOfBeat())

beep();

lcd.setCursor(0, 1);

lcd.print("HEART:");

lcd.print(myBPM);

lcd.setCursor(9, 1);

lcd.print(" BPM");

delay(20);

sensors.requestTemperatures();

for (int i = 0; i < numberOfDevices; i++)

if (sensors.getAddress(tempDeviceAddress, i))

temp = printTemperature(tempDeviceAddress);

lcd.setCursor(0, 0);

lcd.print("BODY:");

lcd.print(temp);

lcd.print(" *C");

upload();

int printTemperature(DeviceAddress deviceAddress)

{
int tempC = sensors.getTempC(deviceAddress);

return tempC;

void beep()

digitalWrite(buzzer, HIGH);

delay(150);

digitalWrite(buzzer, LOW);

void upload()

unsigned long currentMillis = millis();

if (currentMillis - previousMillis >= interval)

previousMillis = currentMillis;

esp.print('*');

esp.print(myBPM);

esp.print(temp);

esp.println('#');

Code for ESP


#include "ThingSpeak.h"

#include <ESP8266WiFi.h>

//------- WI-FI details ----------//

char ssid[] = "XXXXXXXXXXX"; // SSID here

char pass[] = "YYYYYYYYYYY"; // Passowrd here


//--------------------------------//

//----------- Channel details ----------------//

unsigned long Channel_ID = 123456; // Channel ID

const char * myWriteAPIKey = "ABCDEFG1234"; //Your write API key

//-------------------------------------------//

const int Field_Number_1 = 1;

const int Field_Number_2 = 2;

String value = "";

int value_1 = 0, value_2 = 0;

int x, y;

WiFiClient client;

void setup()

Serial.begin(115200);

WiFi.mode(WIFI_STA);

ThingSpeak.begin(client);

internet();

void loop()

internet();

if (Serial.available() > 0)

delay(100);

while (Serial.available() > 0)

value = Serial.readString();
if (value[0] == '*')

if (value[5] == '#')

value_1 = ((value[1] - 0x30) * 10 + (value[2] - 0x30));

value_2 = ((value[3] - 0x30) * 10 + (value[4] - 0x30));

else if (value[6] == '#')

value_1 = ((value[1] - 0x30) * 100 + (value[2] - 0x30) * 10 + (value[3] - 0x30));

value_2 = ((value[4] - 0x30) * 10 + (value[5] - 0x30));

upload();

void internet()

if (WiFi.status() != WL_CONNECTED)

while (WiFi.status() != WL_CONNECTED)

WiFi.begin(ssid, pass);

delay(5000);

void upload()
{

ThingSpeak.writeField(Channel_ID, Field_Number_1, value_1, myWriteAPIKey);

delay(15000);

ThingSpeak.writeField(Channel_ID, Field_Number_2, value_2, myWriteAPIKey);

delay(15000);

value = "";

You might also like