Back to Step by Step Course by Robojax

Lesson 28: DHT11 Temperature Sensor with TM1637 Display | Arduino Step by Step Course

Related or required files and link to this lesson

Part 3: Temperature Sensor

In this lesson we learn how to use DHT11 to measure temperature and display it on TM1637 LED display.

 * Robojax Arduino Step By Step Course 
  * Lesson 28 DHT11 with TM1637
 * This is the Arduino code for TM1637 4 digits display.
 *  * 
   Please watch video instruction here
 This code is available at
with over 100 lectures Free On  YouTube Watch it here
Get the code for the course: 

 * Date: Dec 06, 2017, in Ajax, Ontario, Canada
 * Original code from
 * Modified for Robojax video on Dec 06, 2017

#include <dht11.h>

dht11 DHT11; // create object of DHT11
#define dhtpin 2 // set the pin to connect to DHT11

 // start of settings of TM1637 LED display
#include <Arduino.h>
#include <TM1637Display.h>

// Module connection pins (Digital Pins)
#define CLK 2
#define DIO 3

TM1637Display display(CLK, DIO);
uint8_t blank[] = { 0x0, 0x0, 0x0, 0x0 };// blank value for all digits
// The amount of time (in milliseconds) between tests
#define TEST_DELAY   2000
// start of settings of TM1637 LED display

void setup()
	//Robojax Step By Step Arduono Course YouTube Watch it here
 Serial.begin(9600);// setting up serial monitor

void loop()
	//Robojax Step By Step Arduono Course YouTube Watch it here;// initialize the reading
  int humidity = DHT11.humidity;// get humidity
//code for video
   Serial.print("C ");
   Serial.print("F ");
   Serial.print("K ");
   Serial.print(" humidity:");
   Serial.print (humidity);
   Serial.print("% ");

  display.showNumberDec(23, false, 2,1);
  display.showNumberDec(153, false, 3, 1);

  for(int i=0; i<=500; i++)



The least I expect from you is to give the video a thumbs up and subscribe to my channel. I appreciate it. I have spent hundreds of hours making these lectures and writing code. You don't lose anything by subscribing to my channel. Your subscription is a stamp of approval for my videos, helping more people find them and, in turn, helping me. Thank you!

If you found this tutorial helpful, please support me so I can continue creating content like this. support me via PayPal

**** AFFILIATE PROGRAM **** We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to and affiliated sites.

Right Side