Introduction: DIY Arduino Digital Thermometer

About: Sourya Choudhury is a 15 year old student and a computer science enthusiast living in Kolkata, India.

Hello everyone ! Here, I will show you how to make a simple digital thermometer using Arduino.

Step 1: Parts Required.

The following parts will be required for this project:

1) Arduino Nano .

2) Nokia 5110 LCD display.

3)LM- 35 temperature sensor.

4) Jumper wires.

5) Arduino ide and u8glib library(Download from Git-hub.

Step 2: Connecting the LCD to the Arduino.

Connect the following Arduino pins to the LCD:

CLK=8, DIN=4, CE=7, DC=5, RST=6.

Connect the BL and Vcc pin on the LCD to 3.3v on the Arduino.

You may use resistors if you want, but in my case, connecting the LCD directly to the Arduino pins made no difference.

Step 3: Lm-35.

The Lm-35 is a low-cost temperature sensor which can be used with Arduino.

https://goo.gl/images/AymubD

Check the Lm-35 pinout diagram from here.

Connect the output pin of the Lm-35 to the A0 pin on the Arduino.

Connect the 5v and gnd pins too.

Step 4: Code:

#include "U8glib.h"

int a=0;

float x;

double m;

double s;

//Prepared by Sourya Choudhury

// Credits-Henry's Bench tutorials for lcd tutorial.

U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6);

// CLK=8, DIN=4, CE=7, DC=5, RST=6

void writer()

{

x= analogRead(a);

m=x/1024.0*5000;

s=m/10;

u8g.setFont(u8g_font_profont12);

u8g.setPrintPos(0,15);

u8g.print(s);

u8g.drawStr(35,15,"*C");

delay(100);

if (s>30)

{

u8g.drawStr(15,35,"So Hot!!");

}

else if (s<30 && s>20)

{

u8g.drawStr(15,35,"Nice!!");

}

else

{

u8g.drawStr(15,35,"Cool!!");

}

}

void setup()

{

Serial.begin(9600);

pinMode(a,INPUT);

}

void loop()

{

u8g.firstPage();

do{

writer();

} while( u8g.nextPage() );

}

Step 5: Your Arduino Digital Thermometer Is Ready!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!