Iasonas Christoulakis
Published

Smart Hospital Room

The following project is an arduino based system that provides live monitoring on temperature in a hospital room

IntermediateProtip8 hours4
Smart Hospital Room

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
LED (generic)
LED (generic)
×1
LED, Blue
LED, Blue
×1
Jumper wires (generic)
Jumper wires (generic)
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Gravity: Analog LM35 Temperature Sensor For Arduino
DFRobot Gravity: Analog LM35 Temperature Sensor For Arduino
×1
Grove - I2C Touch Sensor(MPR121)
Seeed Grove - I2C Touch Sensor(MPR121)
×1
Buzzer
Buzzer
×1

Software apps and online services

Arduino IDE
Arduino IDE
Fritzing.org

Hand tools and fabrication machines

Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Custom parts and enclosures

Function

Schematics

Schematics

Code

Code of Project

C/C++
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F, 16, 2);
int buzzer = 9;
int led=13;
int ledy=8;
int ledg=7;
int button=2;
int val=0;
int old_val=0;
int state=0;
int tmp=0;
int tempPin = 1;
void setup ()

{
  
  Serial.begin(9600);
  
  lcd.init();
  lcd.backlight();
  
  pinMode(buzzer, OUTPUT);
  pinMode(led,OUTPUT);
  pinMode(button,INPUT);

}

void loop()
{

tmp = analogRead(tempPin);
float mv = ( tmp/1024.0)*5000;
float cel = mv/10;

/* Tranformation to Fahrenheit
/*float farh = (cel*9)/5 + 32;*/

Serial.print("TEMPRATURE = ");
Serial.print(cel);
Serial.print("*C");
Serial.println();
delay(100);
lcd.setCursor(2,0);
lcd.print("temp=");
lcd.print(cel);
lcd.print("*C");

/*Serial Port Simulation  */
Serial.print("TEMPRATURE = ");
Serial.print(farh);
Serial.print("*F");
Serial.println();

val=digitalRead(button);

if( (val==HIGH) && (old_val==LOW))
{
  state=1-state;
  
}
   old_val=val;
   
if (state==1)
{ 
  digitalWrite(led, HIGH);
    tone(buzzer, 1100);
 lcd.setCursor(9,1);
 lcd.print("ALARM");
    delay(1000);
  
}
else
{
  digitalWrite (led,LOW);
  noTone(buzzer);
    lcd.setCursor(9,1);
    lcd.print(" ");
  
}
if ((cel<17) || (cel>22)) 
{ 
  digitalWrite(ledy, HIGH);
    tone(buzzer, 1100);
  lcd.setCursor(2,1);
  lcd.print("ALARM "); 
  delay(100);}
else 
{
  digitalWrite (ledy,LOW);
  noTone(buzzer);
   delay(100);
  
}
if ((cel>17) && (cel<22)) 
{
    digitalWrite(ledg, HIGH);
  lcd.setCursor(2,1);
  lcd.println("NORMAL");
    delay(100);
  
}

else 
{
  digitalWrite (ledg,LOW);
lcd.setCursor(2,1);
lcd.println("ALARM ");
  delay(100);
  
}

Credits

Iasonas Christoulakis

Iasonas Christoulakis

1 project • 0 followers

Comments

Add projectSign up / Login