Publicat la data

Termometru UNO cu ceas și data – Sandu Ilie Cristian

Termometru cu ceas și data – Sandu Ilie Cristian

1      crystisandu3@gmail.com

Componente necesare :
    -I2C 16x2 LCD
    -DHT11 Temperature and humidity sensor
    -MH -Real-Time-Clock Modules - 2 
    -Arduino UNO

termometru-ceas-data-sandu-ilie-cristian-1
pin component -> pin placa
RTC
    VCC -> 5V
    GND -> GND
    CLK -> /6
    DAT -> 7
    RST -> 8

SENZOR TEMPERATURA

    DATA -> 4
    VCC -> 3,3V
    GND -> GND

DISPLAY

    GND -> GND
    VCC -> 5V
    SDA -> A4 
    SCL -> A5

//--------------------------------
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <dht.h>
#include <virtuabotixRTC.h>

dht DHT;
#define DHT11_PIN 4
int tmp;
int hum;

LiquidCrystal_I2C lcd (0x27, 2 ,1,0,4,5,6,7,3,POSITIVE);
virtuabotixRTC myRTC(6, 7, 8);

byte temp[] = {
 B00100,
 B01010,
 B01010,
 B01110,
 B01110,
 B11111,
 B11111,
 B01110
};

byte humi[] = {
 B00100,
 B00100,
 B01010,
 B01010,
 B10001,
 B10001,
 B10001,
 B01110
};


void setup(){
 lcd.begin(16,2);
 lcd.createChar(0, temp);
 lcd.createChar(1, humi);
 lcd.clear ();
 pinMode(4,INPUT);
 Serial.begin(9600);
}

void loop()
{
 int d = DHT.read11(DHT11_PIN);
 myRTC.updateTime();
 lcd.setCursor ( 0, 0 );// prima linie
 lcd.print(char(0));
 lcd.print(DHT.temperature);
 lcd.print("C");
 lcd.print(" ");
 lcd.print(char(1));
 lcd.print(DHT.humidity);
 lcd.print("%");
 lcd.setCursor ( 0, 1 );// a doua linie 
 lcd.print(myRTC.hours);
 lcd.print(":");
 lcd.print(myRTC.minutes);
 lcd.print(" ");
 lcd.print(myRTC.dayofmonth);
 lcd.print("/");
 lcd.print(myRTC.month);
 lcd.print("/");
 lcd.print(myRTC.year);
 
 delay(1000);
}
//--------------------------------
termometru-ceas-data-sandu-ilie-cristian-4
termometru-ceas-data-sandu-ilie-cristian-2
termometru-ceas-data-sandu-ilie-cristian-3

Lasă un răspuns

Adresa ta de email nu va fi publicată. Câmpurile necesare sunt marcate *