Environmental Monitor Station — Arduino Uno simulation

An interactive Arduino Uno circuit simulation you can run free in your browser on Velxio, by ishaksefta55.

Components

Sketch code

// Arduino Blink Example
#include <LiquidCrystal_I2C.h>
#include <HCSR04.h>
#include <DHT.h>
#include <Arduino.h>
#include <Keypad.h>
#include <Wire.h>

#define echo 12
#define trig 13

#define sda 1

#define scl_lcd A1
#define sda_lcd A0
#define NAME value
#define NAME value
#define NAME value
#define NAME value
#define NAME value
#define NAME value


const byte ROWS=4;
const byte COLS=3;  

byte rowPins[ROWS]={5,6,7,8};
byte colPins[COLS]={9,10,11};


char keys[ROWS][COLS]={
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}

};



LiquidCrystal_I2C lcd(0x27, 16, 2);


Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

HCSR04 hc(trig  , echo );

DHT dht(1, DHT22);







void setup() {
Serial.begin(115200);
lcd.begin(COLS,ROWS);
lcd.clear();
dht.begin();

}

void loop() {






  char key = keypad.getKey();
 float T=dht.readTemperature();
float h=dht.readHumidity();
float distance=hc.dist();


if (key) {
   if (key=='1') {
lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("distanse is:");
   lcd.print(distance);
 
    
  }else if (key=='2') {
    lcd.clear();
lcd.print("tempurture= ");
   lcd.print(T);

     lcd.setCursor(0, 1);
lcd.print("humidity= ");
   lcd.print(h);
  }
 
}
 

   Serial.println(hc.dist());
   Serial.println(T);
   Serial.println(h);

  
}

More projects by ishaksefta55