Skip to content

3.8. Smart Hospital Patient Monitoring System

Description This project combines a Temperature Sensor, LCD Display, LEDs, and Buzzer to create a simplified patient monitoring system. The system continuously monitors body temperature and alerts medical personnel when abnormal readings occur.
Use case This project is connected to real-world uses such as: This project demonstrates health-monitoring systems used in hospitals, clinics, and patient-care environments.

Components (Things You will need)

Arduino Uno Arduino USB Cable Bread Board Jumper Wires LCD Display Resistor LED Buzzer Temperature Sensor

Building the circuit

Things Needed:

  • Arduino Uno
  • Temperature Sensor (LM35)
  • LCD Display
  • Green LED
  • Red LED
  • Buzzer
  • Ω Resistors
  • Breadboard
  • Jumper Wires
  • Arduino USB Cable

Mounting the component on the breadboard and wiring the circuit

Step 1: Connect the Arduino 5V pin to the breadboard’s red (+) power rail.

Step 2: Connect the Arduino GND pin to the breadboard’s blue/black (−) ground rail.

Step 3: Connect the LM35 temperature sensor’s VCC pin to the 5V power rail.

Step 4: Connect the LM35 temperature sensor’s GND pin to the GND rail.

Step 5: Connect the LM35 temperature sensor’s OUT pin to Arduino analog pin A0.

Step 6: Connect the I2C LCD Display’s VCC pin to the 5V power rail.

Step 7: Connect the I2C LCD Display’s GND pin to the GND rail.

Step 8: Connect the I2C LCD Display’s SDA pin to Arduino analog pin A4.

Step 9: Connect the I2C LCD Display’s SCL pin to Arduino analog pin A5.

Step 10: Insert the green LED into the breadboard.

Step 11: Connect the green LED’s anode (longer leg) to Arduino digital pin 6 through a 220 Ω resistor.

Step 12: Connect the green LED’s cathode (shorter leg) to the GND rail.

Step 13: Insert the red LED into the breadboard.

Step 14: Connect the red LED’s anode (longer leg) to Arduino digital pin 7 through a 220 Ω resistor.

Step 15: Connect the red LED’s cathode (shorter leg) to the GND rail.

Step 16: Connect the Buzzer’s positive (+) terminal to Arduino digital pin 8.

Step 17: Connect the Buzzer’s negative (−) terminal to the GND rail.

Step 18: Check all connections carefully to ensure that the power, ground, sensors, LCD, LEDs, resistors, and buzzer are connected correctly before powering the Arduino.

Components on breadboard

Make sure to connect the Arduino USB cable to the Arduino board.

PROGRAMMING

Step 1: Open your Arduino IDE. See how to set up here: Getting Started.

Step 2: Write the complete program implementing the system logic with appropriate pin definitions, setup configuration, and the main control loop.


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

LiquidCrystal_I2C lcd(0x27, 16, 2);

const int tempPin = A0;
const int greenLED = 6;
const int redLED = 7;
const int buzzerPin = 8;

void setup() {

  lcd.init();
  lcd.backlight();

  pinMode(greenLED, OUTPUT);
  pinMode(redLED, OUTPUT);
  pinMode(buzzerPin, OUTPUT);

}

void loop() {

  // Read LM35 sensor
  int sensorValue = analogRead(tempPin);

  // Convert to voltage
  float voltage = sensorValue * (5.0 / 1023.0);

  // Convert voltage to temperature (°C)
  float temperature = voltage * 100.0;

  // Display temperature
  lcd.setCursor(0, 0);
  lcd.print("Temp:");
  lcd.print(temperature, 1);
  lcd.print((char)223);   // Degree symbol
  lcd.print("C ");

  // Check temperature
  if (temperature < 37.5) {

    digitalWrite(greenLED, HIGH);
    digitalWrite(redLED, LOW);
    digitalWrite(buzzerPin, LOW);

    lcd.setCursor(0, 1);
    lcd.print("Normal        ");

  }
  else {

    digitalWrite(greenLED, LOW);
    digitalWrite(redLED, HIGH);
    digitalWrite(buzzerPin, HIGH);

    lcd.setCursor(0, 1);
    lcd.print("High Temp!    ");

  }

  delay(500);
}

Step 3: Save your code. See the Getting Started section

Step 4: Select the arduino board and port _See the Getting Started.

Step 5: Upload your code.

CONCLUSION

When the program is running, the Smart Hospital Patient Monitoring System continuously measures the patient's temperature and displays the reading on the LCD. If the temperature remains within the normal range, the green LED stays on and the buzzer remains off. When the temperature exceeds the preset threshold, the red LED lights up, the buzzer sounds, and the LCD displays a high-temperature warning, providing an immediate visual and audible alert.