7 Segment Display DHT11 Temp Sensor

Hello world! Today i made a simple Temperature & Humidity Meter with the TM1637 7 Segment Display & DHT11 temp sensor.

This is very easy to build, I made it because i have no temperature meter at the attic. SO a simple cheap option is to build this simple device with arduino. Work pretty accurate!

Schematic:
TM1637, 7 Segment Display DHT11 Temp Sensor TM1637

Simply wire it up as the Schematic shows, and upload the code.
Make sure you have the below Libraries installed, click them to download.
#include “dht.h
#include “TM1637.h library

Parts list:
Arduino uno, I used the RobotDyn Uno. (has 8 analog pins)
TM1637 7 Segment 4 Digit Display.
DHT11 KY-015 Temperature sensor.
Jumper wires Set MM/MF/FF

Code:

#include <dht.h>
#include "TM1637.h"
 
//{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
//0~9,A,b,C,d,E,F
 
#define dht_pin 2 // Pin sensor is connected to
#define CLK 3//Pins for TM1637       
#define DIO 4
 
TM1637 tm1637(CLK,DIO);
dht DHT;
 
 
void setup(){
  
  tm1637.init();
  tm1637.set(BRIGHT_DARKEST); 
  //BRIGHT_TYPICAL = 2,BRIGHT_DARKEST = 0,BRIGHTEST = 7;
 
  delay(500);
 
 }
 
void loop(){
 
  DHT.read11(dht_pin);
 
 
 int temp = DHT.temperature;
 int humidity = DHT.humidity;
 
 int digitoneT = temp / 10;
 int digittwoT = temp % 10;
 
 int digitoneH = humidity / 10;
 int digittwoH = humidity % 10;
  
 
    tm1637.display(1,digitoneT); 
    tm1637.display(2,digittwoT);
    tm1637.display(3,12);  // put a C at the end
    
    delay (3000);
    
    tm1637.display(1,25); 
    tm1637.display(2,digitoneH); 
    tm1637.display(3,digittwoH);
 
    
  //Wait 3 seconds before accessing sensor again.
 
  //Fastest should be once every two seconds.
    delay(3000);
 
}// end loop() 
Danny van den Brande

http://www.arduinosensors.nl

Programmer, Game Designer, 3D Designer, Web Designer, Graphic Designer. Jup this website looks crappy.. :) But enjoy the projects! Everything you need is here.

Leave a Reply

Your email address will not be published. Required fields are marked *