Your shopping cart is empty!
Maker UNO DHT11 Alphanumeric Display
- Hussien Jawhar Sathik
- 08 Jan 2022
- Tutorial
- 894
Introduction
In this tutorial, it is demonstrated how to display the DHT11, temperature and humidity value on the alphanumeric display using Maker Uno.
Video
Hardware Preparation
This is the list of items used in the video.
Circuit
There is no additional circuit is required since we are using the grove sensor. The DHT11 is connected to port D2 and the alphanumeric display is connected to port i2C of the grove base V2.
Code
The code for this tutorial is as shown below
#include
#include "grove_alphanumeric_display.h"
#include "DHT.h"
#define DHTPIN 2 // what digital pin we're connected to
#define DHTTYPE DHT11 // DHT 11
Seeed_Digital_Tube tube;
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// put your setup code here, to run once:
Wire.begin();
dht.begin();
tube.setTubeType(TYPE_2,TYPE_2_DEFAULT_I2C_ADDR);
tube.setBrightness(10);
tube.setBlinkRate(BLINK_OFF);
}
void loop() {
// put your main code here, to run repeatedly:
welcome();
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
tube.displayString("Humidity: ",100);
tube.displayNum(h,100);
delay(500);
tube.displayString("Temperature: ", 100);
tube.displayNum(t,100);
delay(500);
tube.displayString("°C ", 100);
delay(500);
}
void welcome()
{
tube.displayString("MAKER UNO + DHT11 + ALPHA DISPLAY", 100);
delay(500);
}
Thank You
Thanks for reading this tutorial. If you have any technical inquiries, please post at Cytron Technical Forum.
"Please be reminded, this tutorial is prepared for you to try and learn.
You are encouraged to improve the code for a better application."