Temperature 🌡️Monitor Using Arduino Uno ||Nokia 5110 Display ||DHT11 Sensor.
Video Link: https://youtu.be/1s2k-kMjk2Q
👉 Subscribe Our YouTube Channel For Latest Project Videos.
Program Code :-
#include <SPI.h> // include SPI library
#include <Adafruit_GFX.h> // include adafruit graphics library
#include <Adafruit_PCD8544.h> // include adafruit PCD8544 (Nokia 5110) library
#include <DHT.h> // include DHT library code
// Nokia 5110 LCD module connections (CLK, DIN, D/C, CS, RST)
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
#define DHTPIN A0 // DHT11 data pin is connected to Arduino analog pin 0
#define DHTTYPE DHT11 // DHT11 sensor is used
DHT dht11(DHTPIN, DHTTYPE); // configure DHT library
char temperature[] = "00.0 C";
char humidity[] = "00.0 %";
void setup()
{
delay(1000); // wait 1 second
// initialize the display
display.begin();
// initialize the DHT library
dht11.begin();
// you can change the contrast around to adapt the display
// for the best viewing!
display.setContrast(50);
display.clearDisplay(); // clear the screen and buffer
display.drawFastHLine(0, 23, display.width(), BLACK);
display.setTextSize(1);
display.setTextColor(BLACK, WHITE);
display.setCursor(6, 0);
display.print("TEMPERATURE:");
display.setCursor(15, 28);
display.print("HUMIDITY:");
display.display();
}
// main loop
void loop()
{
// read humidity
byte RH = dht11.readHumidity();
// read temperature in degree Celsius
byte Temp = dht11.readTemperature();
// update temperature and humidity arrays
temperature[0] = Temp / 10 + '0';
temperature[1] = Temp % 10 + '0';
humidity[0] = RH / 10 + '0';
humidity[1] = RH % 10 + '0';
// print temperature
display.setCursor(24, 12);
display.print(temperature);
// print humidity
display.setCursor(24, 40);
display.print(humidity);
// print degree symbol ( ° )
display.drawRect(50, 12, 3, 3, BLACK);
// now update the display
display.display();
delay(1000); // wait 1 second
}



I really liked your blog post.Much thanks again. Awesome.
ReplyDeleteIot online training
Iot training
Java online training
Java training
Machine learning online training
Machine learning training
Magento online training
Magento training
MySql Admin online training
cool
ReplyDelete