Atingedebonga David AweBailo Ousman SaidyHarry AkligohIsaac Atia-AbugbillaEvans Djangbah
Created May 25, 2019

Smart Safety Cabinet

Displaying, storing of data on a LCD I2C 16X2 and SD card from a sterilized hood using Arduino.

AdvancedFull instructions provided2 hours1,160
Smart Safety Cabinet

Things used in this project

Hardware components

Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
Displaying of data
×1
Jumper wires (generic)
Jumper wires (generic)
serves as the conductors
×30
Flash Memory Card, SD Card
Flash Memory Card, SD Card
Use to store the data
×1
Micro SD card deck
Bitcraze Micro SD card deck
Holds the SD card
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
Used to measure the temperature and humidity of the hood
×2
NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
Microcontroller
×1
Buzzer
Buzzer
alarm
×1

Software apps and online services

Arduino IDE
used to sketching of the code
ThingSpeak API
ThingSpeak API
internet cloud
SmartThings service
IFTTT SmartThings service
send notification to phone

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

Circuit Diagram using Fritzing

shows the wire connections

Data Stored on SD-Card

temperature and humidity of hood and Lab reading saved on a SD-card for future use or transfer

Data Uploaded Online to thingSpeak

Records temperature and humidity values online, easy access of data away from the lab

Notifications Sent to Phone

The user receives notifications on their phone when the temperatures are low or high.

Notification on smart phone

Code

Smart Cabinet

Arduino
#include <ESP8266WiFi.h>
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <SD.h>
#include <SPI.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);
#include <DHT.h>
#define DHTPIN D3     
#define DHTPIN1 D4  
#define DHTTYPE DHT11  

DHT dht(DHTPIN, DHTTYPE);
DHT dht1(DHTPIN1, DHTTYPE);

const char* ssid="AWEA";
const char* password = "12346784";
const char* server = "api.thingspeak.com";
String apiKey = "9U711HBZS2FFHP48";
int ledPin = 13;
const int chipSelect = 8;
float Temperature;
float Humidity;
float LabTemperature;
float LabHumidity;
const int buzzerPin = 0;
WiFiClient client;

void setup() {
  pinMode(buzzerPin, OUTPUT);
   pinMode(ledPin,OUTPUT);
  digitalWrite(ledPin,LOW);
  
  Serial.begin(115200);
  dht. begin();
  dht1.begin();
  delay(10);
  lcd.begin();
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("Welcome To");
  lcd.setCursor(1,1);
  lcd.print("Bio LAB");
  delay(1000);
  
  Serial.println();
  Serial.print("Wifi connecting to ");
  Serial.println( ssid );
  WiFi.begin(ssid,password);

  Serial.println();
  Serial.print("Connecting");

  while( WiFi.status() != WL_CONNECTED ){
      delay(500);
      Serial.print(".");        
  }
  Serial.println("Wifi Connected Success!");
  //Serial.print("NodeMCU IP Address : ");
  //Serial.println(WiFi.localIP() );

  

}

void loop() {
 Temperature = dht.readTemperature();  
 Humidity = dht.readHumidity();  
 LabTemperature = dht1.readTemperature();  
 LabHumidity = dht1.readHumidity();  
  Serial.print("Temperature :");  
  Serial.print(Temperature);  
  Serial.println("C");  
  Serial.print("LabTemperature :");  
  Serial.print(LabTemperature);  
  Serial.println("C");  
  Serial.print("Humidity:");  
  Serial.print(Humidity);  
  Serial.println("%");  
  Serial.print("LabHumidity:");  
  Serial.print(LabHumidity);  
  Serial.println("%");  
  delay(3000);

  lcd.setCursor(0, 0);
  lcd.print("Tp=");
  lcd.print(Temperature);
  lcd.setCursor(7, 0);
  lcd.print(" LTp=");
  lcd.print(LabTemperature);
  lcd.setCursor(0,1);
  lcd.print("Hm=");
  lcd.print(Humidity);
  lcd.setCursor(9,1);
  lcd.print("Hm=");
  lcd.print(LabHumidity);
  
  delay(3000);
   if (client.connect(server,80))   //   "184.106.153.149" or api.thingspeak.com
                      {  
                            
                             String postStr = apiKey;
                             postStr +="&field1=";
                             postStr += String(Temperature);
                             postStr +="&field2=";
                             postStr += String(Humidity);
                             postStr +="&field3=";
                             postStr += String(LabTemperature);
                             postStr +="&field4=";
                             postStr += String(LabHumidity);
                             postStr += "\r\n\r\n";
 
                             client.print("POST /update HTTP/1.1\n");
                             client.print("Host: api.thingspeak.com\n");
                             client.print("Connection: close\n");
                             client.print("X-THINGSPEAKAPIKEY: "+apiKey+"\n");
                             client.print("Content-Type: application/x-www-form-urlencoded\n");
                             client.print("Content-Length: ");
                             client.print(postStr.length());
                             client.print("\n\n");
                             client.print(postStr);
 

                             Serial.println("%. Send to Thingspeak.");
                        }
          client.stop();
 
          Serial.println("Waiting...");
  
  // thingspeak needs minimum 15 sec delay between updates
  delay(1000);
    if (LabTemperature >= 30)
    {
    tone(buzzerPin, 2000);
    delay(1000);
 
    noTone(buzzerPin);
    delay(100);
 
    Serial.print(" ALARM ACTIVATED "); 
    }
     else {
 
    noTone(buzzerPin);
    digitalWrite(ledPin, LOW);
 
    Serial.print("ALARM DEACTIVATED");
    delay(1000);
}
     if(Humidity >=91)
  {
    tone(buzzerPin, 1500);
    delay(1000);
    noTone(buzzerPin);
    delay(10);
    }
  
  else {
 
    noTone(buzzerPin);
 
    Serial.print("ALARM DEACTIVATED");
    
    
    delay(1000);
  }
  if (Temperature >= 28)
    {
   tone(buzzerPin, 1000);
   delay(1000);
 
    noTone(buzzerPin);
    delay(100);
  }
  else {
 
    noTone(buzzerPin);
 
    Serial.print("ALARM DEACTIVATED");
    
    
    delay(1000);
  }

}

Credits

Atingedebonga David Awe
2 projects • 4 followers
I'm a mechanical engineering undergraduate.I started developing about a year now. Had love ICT very much and decided to put into practice.
Contact
Bailo Ousman Saidy
2 projects • 2 followers
Contact
Harry Akligoh
4 projects • 11 followers
Harry enjoys tinkering with electronics and biology in other to make tools for biology research and education easily accessible.
Contact
Isaac Atia-Abugbilla
5 projects • 11 followers
Hardware tinkerer, IoT and AI/ML engineer, PCB designer
Contact
Evans Djangbah
5 projects • 6 followers
Contact

Comments

Please log in or sign up to comment.