Back to Arduino Step By Step Course

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

If you don't like to see ads while video is being played you can purchase this course for $200 from Udemy or purchase YouTube premium Here

Please download required files for this code

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 thumb up the video and subscribe to my channel. I appriciate that. .I have spent months making these lectures and writing code. You don't lose anything by subscribging to my channel. Your subscription is stamp of approval to my videos and more people can find them and in it turn it helps 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.