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

ESP8266 and Arduino Uno Health Monitor with Wi-Fi and Battery-Powered Features

View and Edit Project In Cirkit DesignerImage of ESP8266 and Arduino Uno Health Monitor with Wi-Fi and Battery-Powered Features

Circuit Documentation

Summary

This circuit is a health monitoring system that uses an ESP8266 NodeMCU and an Arduino Uno R3 to monitor a patient's presence on a bed using an IR sensor. The system also includes a heart rate monitor, a relay to control a DC motor, and a buzzer for alerts. The status is displayed on a 16x2 I2C LCD.

Component List

  1. ESP8266 NodeMCU

    • Description: A low-cost Wi-Fi microcontroller.
    • Pins: D0, D1, D2, D3, D4, 3V3, GND, D5, D6, D7, D8, RX, TX, A0, RSV, SD3, SD2, SD1, CMD, SD0, CLK, EN, RST, VIN
  2. 1 Channel Relay 5V

    • Description: A relay module to control high voltage devices.
    • Pins: VCC, GND, IN, NC, COM, NO
  3. AD8232 Heart Rate Monitor

    • Description: A heart rate monitor sensor.
    • Pins: GND, 3.3v, OUTPUT, LO-, LO+, SDN, RA, LA, RL
  4. IR Sensor

    • Description: An infrared sensor to detect presence.
    • Pins: out, gnd, vcc
  5. Buzzer

    • Description: A simple buzzer for audio alerts.
    • Pins: GND, IN
  6. 16x2 I2C LCD

    • Description: A 16x2 character LCD with I2C interface.
    • Pins: GND, VCC, SDA, SCL
  7. Arduino Uno R3

    • Description: A popular microcontroller board.
    • Pins: D8, D9, D10, D11, D12, D13, GND, AREF, SDA, SCL, D0/RX, D1/Tx, D2, D3, D4, D5, 6, D7, A5/SCL, A4/SDA, A3, A2, A1, A0, Vin, 5V, 3.3V, RESET, IOREF, NONE, USB Jack, Power Jack
  8. Battery 18650

    • Description: A rechargeable lithium-ion battery.
    • Pins: +, -
  9. LED: Two Pin (yellow)

    • Description: A yellow LED.
    • Pins: cathode, anode
  10. Resistor

    • Description: A resistor with various resistance values.
    • Pins: pin1, pin2
    • Properties: 1000 Ohms, 2000 Ohms, 3000 Ohms
  11. DC Motor

    • Description: A simple DC motor.
    • Pins: pin 1, pin 2
  12. Rocker Switch

    • Description: A simple on/off switch.
    • Pins: output, input

Wiring Details

ESP8266 NodeMCU

1 Channel Relay 5V

AD8232 Heart Rate Monitor

IR Sensor

Buzzer

16x2 I2C LCD

Arduino Uno R3

Battery 18650

LED: Two Pin (yellow)

Resistor

DC Motor

Rocker Switch

Documented Code

ESP8266 NodeMCU Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Arduino Uno R3 Code

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

// Initialize the LCD with I2C address 0x27 and dimensions 16x2
LiquidCrystal_I2C lcd(0x27, 16, 2);

#define IR_PIN 2       // IR sensor input pin
#define BUZZER_PIN 3   // Buzzer output pin

void setup() {
  // Initialize the LCD
  lcd.begin();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Health Monitor");

  // Initialize IR sensor and buzzer
  pinMode(IR_PIN, INPUT);
  pinMode(BUZZER_PIN, OUTPUT);

  // Display initial status
  lcd.setCursor(0, 1);
  lcd.print("Initializing...");
  delay(2000);
  lcd.clear();
}

void loop() {
  // Read IR sensor status
  int irStatus = digitalRead(IR_PIN);

  // Adjusted logic for active-low sensors
  if (irStatus == LOW) { // Patient detected
    lcd.setCursor(0, 0);
    lcd.print("Patient on Bed   "); // Clear extra characters
    lcd.setCursor(0, 1);
    lcd.print("Status: Safe     ");
    digitalWrite(BUZZER_PIN, LOW); // Turn off buzzer
  } else { // Patient not detected
    lcd.setCursor(0, 0);
    lcd.print("Patient not on   ");
    lcd.setCursor(0, 1);
    lcd.print("Bed! Alert!      ");
    digitalWrite(BUZZER_PIN, HIGH); // Turn on buzzer
  }

  delay(500);
}