Smart Lab

alert system for safe lab conditions

Smart Lab is an alert system prototype developed during the Programming and Physical Computing seminar. The system indicates whether the room is at the right temperature and whether toxic gases are escaping during experiments. A system of flashing lights alerts the people in the room. In additional, fans in the room regulate the temperature.

 

// concept

We are located in a laboratory. In the laboratory must be a certain temperature so that the experiments can be completed correctly and there is a lot of experimentation with different gases.

A temperature sensor measures the temperature in the room and when it is above 20°C, the fan turns on and a red lamp lights up. If the temperature is below 20°C, a green lamp lights up. There are also air quality control sensors in the room for the detection of gases. When the air sensor detects a gas, a red light turns on to alert everyone in the room. If no gas is detected, a green lamp lights up. A display shows the temperature and the air quality.

 

// schematic

 

// materials

Sensors

  • Air quality sensor – MG135
  • DHT11 temperature sensor

Actuators

  • DC motor (BJT transistor)
  • LEDs (2x red, 2x green) (resistor 220)

Display 

  • Interface 12C 16×2 LCD
  • 12C serial adapter

 

// video

 

 

// code

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

#include <SimpleDHT.h>

LiquidCrystal_I2C lcd(0x27,20,4);

int motor = 5;
int ledPinGreen1 = 8;
int ledPinRed1 = 10;
int ledPinGreen2 = 12;
int ledPinRed2 = 13;

int AirSensor = 2;

int pinDHT11 = 3;
SimpleDHT11 dht11(pinDHT11);

void setup() {
Serial.begin(9600);

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

pinMode(ledPinGreen1, OUTPUT);
pinMode(ledPinRed1, OUTPUT);
pinMode(ledPinGreen2, OUTPUT);
pinMode(ledPinRed2, OUTPUT);
pinMode (motor, OUTPUT);
pinMode(AirSensor, INPUT);

lcd.print(“Hello”);
}

void loop() {
// put your main code here, to run repeatedly:
Serial.println(“======================================”);
Serial.println(“Sensor:”);

byte temperature = 0;
byte humidity = 0;
int err = SimpleDHTErrSuccess;
if ((err = dht11.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
Serial.print(“Read DHT11 failed, err=”); Serial.print(SimpleDHTErrCode(err));
Serial.print(“,”); Serial.println(SimpleDHTErrDuration(err)); delay(1000);
return;
}

Serial.print(“Temperature: “);
Serial.print((int)temperature); Serial.println(” *C, “);

if ((int)temperature >=25) {
digitalWrite (motor, HIGH);
digitalWrite (ledPinRed1, HIGH);
digitalWrite (ledPinGreen1, LOW);
}else {
digitalWrite (motor, LOW);
digitalWrite (ledPinRed1, LOW);
digitalWrite (ledPinGreen1, HIGH);
}

lcd.backlight();
lcd.setCursor(0,0);
lcd.print(“Temp:”);
lcd.print((int)temperature); lcd.print(” *C”);

if(digitalRead(AirSensor) == HIGH){
Serial.println(“Air polluted”);
lcd.setCursor(0,1);
lcd.print(“Air polluted”);
digitalWrite (ledPinRed2, HIGH);
digitalWrite (ledPinGreen2, LOW);
}else{
Serial.println(“Air clean”);
lcd.setCursor(0,1);
lcd.print(“Air clean :)”);
digitalWrite (ledPinRed2, LOW);
digitalWrite (ledPinGreen2, HIGH);
;}

delay(1500);
}

 

 

smart lab is a project of IAAC, Institute for Advanced Architecture of Catalonia at Master in Advanced Architecture in 2021/2022 by Student: Mara Müller-de Ahna; Faculty:  Cristian Rizzuti; Faculty Assistant: Aman Najari