Digital Thermometer With Arduino

2,258

15

3

Introduction: Digital Thermometer With Arduino

This project uses an Arduino, a DS18B20 temp sensor, and a 16x2 LCD display to show the current air temperature. It can be made with or without a breadboard, but a breadboard makes it much easier to wire.

It shows the temperature in Fahrenheit, but can easily be changed to Celcius.

Feel free to comment your thoughts on this project, I'm open to new ideas.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Materials

The materials needed for this build are:

  • Arduino
  • Breadboard
  • DS18B20 Temperature Sensor
  • 16x2 LCD Display (I used this one)
  • 4.7k Ohm Variable Resistor
  • Potentiometer
  • Box or Container
  • 6v or more Battery Pack or AC to DC Adapter (or some other way of powering it)
  • 1 Button
  • 1 Switch

The breadboard, container, button, and switch are all optional, and if you know what you're doing (I don't), you could make your own Arduino to run the thermometer.

Step 2: Circuitry

The button is not necessary, it just reloads the program.

The switch also isn't necessary, it turns the back light on or off. If you want to remove it, just connect the far right pin on the LCD screen to negative.

If you want to change the wiring a bit, go ahead. A few things that I would try if I redid this are having a switch to toggle the whole setup on or off, and possibly a toggle between Celsius and Fahrenheit without having to change your code.

Step 3: Code

Here's the code to run the Arduino:

Copy/Pasting should work.

//Libraires
#include <LiquidCrystal.h>
#include <DallasTemperature.h>
#include <OneWire.h>

//Pinout lcd(RS, E, D4, D5, D6, DlcdLight)
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//DS18B20 signal pin to Arduino pin 6
#define ONE_WIRE_BUS 6
OneWire oneWire(ONE_WIRE_BUS); 
DallasTemperature sensors(&oneWire);

//Character for small "C", for Celcius, remove "/*"'s and delete the "F"
/*byte customChar[8] = {
  0b11100,
  0b10000,
  0b11100,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};
*/


//Custom character for small "F"
byte customChar[8] = {
  0b11100,
  0b10000,
  0b11000,
  0b10000,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};

const int lcdLight=7; 

void setup() {
    pinMode(lcdLight,OUTPUT);
    //Init sensor and lcd
    sensors.begin();
    lcd.createChar(1,customChar);
    lcd.begin(16, 2);
    lcd.print("Temperature:");
    lcd.setCursor(9,1);
    lcd.print("\337");
    lcd.write(1);
}

void loop() {
    digitalWrite(lcdLight,HIGH);
    sensors.requestTemperatures();   
    lcd.setCursor(5,1);

//Change the "F" to a "C" to switch to Celcius instead
    lcd.print(sensors.getTempFByIndex(0),1);
  delay(1000);
  
}

Step 4: The Finished Product

There you go! Now you should have a working digital thermometer. I put mine in a fairly cheap box and didn't do much special work in that field, but you can put it in whatever you want, just make sure that the temp sensor is open to air outside of your container so it's more accurate. If you have any recommendations or ideas, put them in the comments.

Credit to Ardumotive_com and Bagus Prehan, this project was created with help from their own Instructables.

Sensors Contest 2016

Participated in the
Sensors Contest 2016

First Time Author Contest 2016

Participated in the
First Time Author Contest 2016

Be the First to Share

    Recommendations

    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020

    3 Discussions

    0
    WesMak
    WesMak

    3 years ago

    I would like to be positive, If you follow the wiring diagram, it might not work.

    this may be because of different LCD Modules wiring's,

    VSS = GND VDD = +5V RW = GND ALL Others are correct.

    0
    Eric Brouwer
    Eric Brouwer

    4 years ago

    I like the finer details of your own defined characters for the "Degrees F"

    0
    seamster
    seamster

    4 years ago

    Nicely done, this looks like a good thermometer! Thanks for sharing how you made this :)