We all use weather applications to know the current temperature. This requires the Internet. So if I say you can know your area temperature without the Internet, how it will be?

In this post, I will share how to get local area temperature using LM35 Temperature Sensor with TM1637 4 Digit 7 segment Display in Arduino UNO.

LM35 Sensor with TM1637 Display in ESP8266 NodeMCU

Components Used: (Click to Buy)

What is LM35 Temperature Sensor?

LM35 is an integrated analogue temperature sensor whose electrical output is proportional to Degree Centigrade. LM35 Sensor does not require any external calibration or trimming to provide typical accuracies.

It has 3 pins – two pins are 5V and Ground. The middle pin is Voltage out. We use the reading of this pin to determine the temperature using some arithmetic calculation.
Because this is a single sensor, it does not give an accurate temperature. If you want accurate temperature, you can you DHT22 Sensor.

How to Connect LM35?

If you do not know how to connect LM35 with Arduino UNO, then follow this post.

LM35 Temperature Sensor with Arduino UNO

How to Connect TM1637 Display?

Following Connection Diagram you can see how to connect TM1637 Display & LM35 Sensor with Arduino UNO.

LM35 Sensor with TM1637 Display in Arduino UNO

Here we connected A5 & A4 pins of Arduino UNO to SCL & SDA pin of TM1637.

LM35 Sensor with TM1637 Display in Arduino UNO

Code Explain

As discussed in the previous post, we calculated Temperature in Celcius.
After that, we are displaying it in the 4 Digit Display using TM1637Display library functions.
We will show temperature in the first two digits of the display, and the rest two digits will show Degree Centrigrade icon using setsegments function.

Arduino Sketch

/*<br>https://somtips.com<br>https://youtube.com/somtips<br>*/
#include <Arduino.h>
#include <TM1637Display.h>
// Module connection pins (Digital Pins)
#define CLK 5 //A5
#define DIO 4 //A4
TM1637Display display(CLK, DIO);

const int sensor=A0;
float tempc;
float vout;
const uint8_t C[] = {
  SEG_B | SEG_A | SEG_F | SEG_G,
  SEG_A | SEG_D | SEG_E | SEG_F
  };

void setup()
{
  pinMode(sensor,INPUT);
}

void loop()
{

  display.setBrightness(0xff);
  vout=analogRead(sensor);
  vout=(vout*500)/1024;
  tempc=vout;
  display.showNumberDecEx(tempc, (0x80 >> 0), false,2,0);
  display.setSegments(C,2,2);
  delay(1000);

    
}

Output

LM35 Sensor with TM1637 Display in Arduino UNO

httpv://www.youtube.com/watch?v=oDOj7-Dd7L4

5 COMMENTS

  1. Your code shows TM1637 library but the hardware diagram shows the HT16K33 backpack. Are the libraries interchangeable for these two devices? Thank you.

  2. Hi, I have a problem with this circuit, it measures me badly, the temperature always measures 1 degree less with the current temperature and the lm35 sensor tested with a tester gives you the correct temperature and something else does not stay the fixed temperature always measures 27.28, 29, can you help me I leave my email [email protected] greetings

Comment Box