Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Based Pulse Oximeter and Temperature Monitoring System with Wi-Fi Notification

View and Edit Project In Cirkit DesignerImage of Arduino UNO Based Pulse Oximeter and Temperature Monitoring System with Wi-Fi Notification

Circuit Documentation

Summary

This circuit is designed to monitor vital health parameters, specifically heart pulse rate and body temperature, and display the readings on an LCD. It also features an alert system that sends an SMS notification via the ESP8266 WiFi module if the temperature exceeds a certain threshold or if the pulse rate drops below a set limit. The Arduino UNO serves as the central microcontroller, interfacing with a heart pulse sensor, a temperature sensor (LM35), an ESP8266 WiFi module for communication, and an LCD display for real-time data output. An LED indicator is included to provide a visual alert.

Component List

Heart Pulse Sensor

Arduino UNO

Temperature Sensor (LM35)

ESP8266 ESP-01 WiFi Module

LED: Two Pin (green)

LCD Display 16x4 I2C

Resistor (1k Ohm)

Resistor (2k Ohm)

Wiring Details

Heart Pulse Sensor

Arduino UNO

Temperature Sensor (LM35)

ESP8266 ESP-01 WiFi Module

LED: Two Pin (green)

LCD Display 16x4 I2C

Resistor (1k Ohm)

Resistor (2k Ohm)

Documented Code

/*
 * Pulse Oximeter and Temperature Sensor with SMS Notification
 * This code reads data from a heart pulse sensor and a temperature sensor.
 * If the body temperature exceeds a threshold or the oxygen level drops
 * below a threshold, an SMS notification is sent via the ESP8266 WiFi module.
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>

// Pin definitions
const int pulsePin = A0;
const int tempPin = A1;
const int ledPin = 7;
const int espTx = 9;
const int espRx = 10;

// Thresholds
const float tempThreshold = 37.5; // Celsius
const int pulseThreshold = 60; // BPM

// LCD setup
LiquidCrystal_I2C lcd(0x27, 16, 4);

// ESP8266 setup
SoftwareSerial espSerial(espRx, espTx);

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  espSerial.begin(115200);

  // Initialize LCD
  lcd.begin();
  lcd.backlight();

  // Initialize LED pin
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);

  // Initialize ESP8266
  sendCommand("AT", 1000);
  sendCommand("AT+CWMODE=1", 1000);
  sendCommand("AT+CWJAP=\"yourSSID\",\"yourPASSWORD\"", 5000);
}

void loop() {
  // Read pulse sensor data
  int pulseValue = analogRead(pulsePin);
  int pulseBPM = map(pulseValue, 0, 1023, 0, 150); // Example mapping

  // Read temperature sensor data
  int tempValue = analogRead(tempPin);
  float temperature = (tempValue / 1024.0) * 5.0 * 100.0;

  // Display data on LCD
  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print(temperature);
  lcd.print(" C");
  lcd.setCursor(0, 1);
  lcd.print("Pulse: ");
  lcd.print(pulseBPM);
  lcd.print(" BPM");

  // Check thresholds and send SMS if needed
  if (temperature > tempThreshold || pulseBPM < pulseThreshold) {
    digitalWrite(ledPin, HIGH);
    sendSMS("Alert! Temp: " + String(temperature) + " C, Pulse: " + String(pulseBPM) + " BPM");
  } else {
    digitalWrite(ledPin, LOW);
  }

  delay(1000); // Wait for 1 second before next reading
}

void sendCommand(String command, int timeout) {
  espSerial.println(command);
  long int time = millis();
  while ((time + timeout) > millis()) {
    while (espSerial.available()) {
      char c = espSerial.read();
      Serial.print(c);
    }
  }
}

void sendSMS(String message) {
  sendCommand("AT+CMGF=1", 1000); // Set SMS mode
  sendCommand("AT+CMGS=\"+1234567890\"", 1000); // Replace with your phone number
  espSerial.print(message);
  espSerial.write(26); // ASCII code for CTRL+Z
}

This code is designed to be uploaded to the Arduino UNO microcontroller. It initializes the sensors, reads their data, displays the readings on the LCD, and sends an SMS alert if the readings are outside the set thresholds. The sendCommand function is used to communicate with the ESP8266 module, and the sendSMS function is used to send the SMS message.