hixel
Published

Easy Thermometer v1

An easy to build thermometer using Arduino, digital temperature sensor, and LCD display.

BeginnerFull instructions provided2,157
Easy Thermometer v1

Things used in this project

Story

Read more

Schematics

Mounting Plate in Fritzing

Code

Code

Arduino
WARNING: It works only on USB power
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>

#define ONE_WIRE_BUS 7

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

double x;

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Dallas Temperature Sensor");
  lcd.begin(16, 2);
  sensors.begin();
}

void loop(void)
{
  sensors.requestTemperatures();
  serial();
  x = (sensors.getTempCByIndex(0));
  delay(500);
  lcd.setCursor(0, 1);
  lcd.print(" ");
  lcd.print(x);
  lcd.print("*C");
}

void serial(){
  Serial.print("Requesting temperatures...");
  Serial.println("DONE");
  Serial.println(sensors.getTempCByIndex(0));
}

Credits

hixel

hixel

2 projects • 3 followers

Comments