Hackster is hosting Hackster Holidays, Ep. 4: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Wednesday!Stream Hackster Holidays, Ep. 4 on Wednesday!
Silícios LabPCBWay
Published © GPL3+

Temperature Indicator with Arduino

Learn how to build a temperature gauge thermometer with Arduino, DS18B20 sensor and TM1637 module.

BeginnerFull instructions provided30 minutes10,303
Temperature Indicator with Arduino

Things used in this project

Hardware components

PCBWay Custom PCB
PCBWay Custom PCB
×1
Breadboard - UTSOURCE
×1
Arduino UNO - UTSOURCE
×1
DS18B20 Temperature Sensor - UTSOURCE
×1
TM1637 Module - UTSOURCE
×1

Story

Read more

Custom parts and enclosures

Electronic Schematic

Code

Thermometer Code

Arduino
#include <OneWire.h>
#include <DallasTemperature.h>
#include <TM1637Display.h>

#define ONE_WIRE_BUS 8 //Digital Pin to connect the DS18B20 Sensor

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);
DeviceAddress sensor1;

TM1637Display display(2,3);

const uint8_t DEGREES[] = {
   0x0, 0x0,
   SEG_A | SEG_B | SEG_G | SEG_F,    // Degree Symbol
   SEG_A | SEG_F | SEG_E | SEG_D,    // C
   };

unsigned int temperature = 0;
byte PreviousValue = 0;

void setup()
{
       sensors.begin();
       display.setBrightness(7);      // set display to maximum brightness

       if (!sensors.getAddress(sensor1, 0))
       {                 
         Serial.println("Sensor not found!");
       }
}

void loop()
{
        //Request sensor data
        sensors.requestTemperatures();
        int tempC = sensors.getTempC(sensor1); //Read temperature of DS18B20 Sensor
            
             if(tempC != PreviousValue)
             {
               PreviousValue = tempC;
               display.setSegments(DEGREES); //Display the Variable value
               display.showNumberDec(tempC,false,2,0);
               delay(2000);
             }                       
}

Credits

Silícios Lab

Silícios Lab

73 projects • 177 followers
Hello, I love program microcontrollers and works with electronic projects.
PCBWay

PCBWay

94 projects • 149 followers
We are a PCB and assembly manufacturer, As low as $5/10pcs and 24 hours delivery time. We are committed to helping creators build project.

Comments