loading
Simply create a digital thermometer with can tell you the current room temperature on a LCD screen. This is a beginners project.

Apparatus that you need:
1. Arduino UNO R3
2. DS18B20 temperature sensor.
3. 16X2 LCD display.
4. Connecting wires.
5. Project board. 

Now lets make digital thermometer.....


This is a Atmega168 pinouts for arduino. Just skip this if you wat to make this thermometer with your arduino.

Step 1: Make Arduino on Breadboard.

Creating arduino on a breaboard is very easy. Now step by step wiring procedure is given below:
1. Pin 7  -> +5V
2. Pin8   -> GND
3. Pin9 -> Crystal -> 22pF capacitor -> GND
4. Pin10-> Crystal -> 22pF capacitor -> GND
5. pin 22 -> GND
6. Pin21 & Pin20 -> +5V
7. Pin1-> 10K registor to GND + Push button to +5V

Now you are ready.................

Step 2: Connecting LCD

Step 3: Connecting DS1307 Temperature Sensor

Step 4: Preparing the Circuit.


Connect the LCD with the atmega or arduino according to the default LCD example on the arduino IDE.

Now connect DS1307 DATA bus to the DIGITAL PIN 7 (Atmega pin 13)

Step 5: Arduino CODE

#include <OneWireTempSensor.h>

#include <OneWire.h>
#include <LiquidCrystal.h>
int DS18S20_Pin = 7; //DS18S20 Signal pin on digital 7 by rahulmitra
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//Temperature chip i/o
OneWire ds(DS18S20_Pin); // on digital pin 7 by rahulmitra

void setup(void) {
Serial.begin(9600);
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Rahul Mitra");
}

void loop(void) {
float temperature = getTemp();
Serial.println(temperature);
  lcd.setCursor(0, 1);
    lcd.print("Temp : ");
    lcd.print(temperature);
    lcd.print(" *C");
delay(100); //just here to slow down the output so it is easier to read

}

float getTemp(){
//returns the temperature from one DS18S20 in DEG Celsius

byte data[12];
byte addr[8];

if ( !ds.search(addr)) {
//no more sensors on chain, reset search
ds.reset_search();
return -1000;
}

if ( OneWire::crc8( addr, 7) != addr[7]) {
Serial.println("CRC is not valid!");
return -1000;
}

if ( addr[0] != 0x10 && addr[0] != 0x28) {
Serial.print("Device is not recognized");
return -1000;
}

ds.reset();
ds.select(addr);
ds.write(0x44,1); // start conversion, with parasite power on at the end

byte present = ds.reset();
ds.select(addr);
ds.write(0xBE); // Read Scratchpad


for (int i = 0; i < 9; i++) { // we need 9 bytes
data[i] = ds.read();
}

ds.reset_search();

byte MSB = data[1];
byte LSB = data[0];

float tempRead = ((MSB << 8) | LSB); //using two's compliment
float TemperatureSum = tempRead / 16;

return TemperatureSum;

}

Step 6: Finally You Have Done

Step 7: See LIVE

http://www.youtube.com/watch?v=7718FODdtio&list=UUY916I6z4Y3QQhzjHsIhR8w
<p>If you get an error trying to compile this code, remove the first line &quot;#include &lt;OneWireTempSensor.h&gt;&quot; because this isn't needed. #include &lt;OneWire.h&gt; does the very same thing.</p>
<p>hi.thanks very lot for this project.<br>I have a question:<br>how can i save the log for a month which data save per hour a day.<br>i mean save the log hour to hour for 1 month.and so i can draw the graph of these logs.<br>please help me.thanks a lot master.</p>
There are two ways to do that...<br>1. web server<br>2. SD Card.<br><br>To do this with Web server, you need a web server and Ethernet shield for the arduino. Arduino will send the data only and a server side script will process the data and post the data in MySQL data base with current time stamp. And the benefit of this method is you can monitor real time data in web browser also real time graph.<br><br>And to do this with SD card you need and micro sd card and card shield and a clock module. then you can find example code in Arduino IDE. Than edit it and save the file name as &quot;xxxx.csv&quot;. and write the data with (,) separated method. It will save an MS excel file in the sd card. And remove the card and connect it to pc with card reader. and open it in excel. and process it in excel.<br><br>*** Sorry for bad english.
<p>i have problems:</p><p>Arduino: 1.6.5 (Windows 7), Board: &quot;Arduino/Genuino Uno&quot;</p><p>In file included from sketch_aug29c.ino:1:0:</p><p>C:\Users\Maretic\Documents\Arduino\libraries\OneWireTempSensor/OneWireTempSensor.h:26:22: fatal error: WProgram.h: No such file or directory</p><p> #include &lt;WProgram.h&gt;</p><p> ^</p><p>compilation terminated.</p><p>Error compiling.</p><p> This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p><p>Can you help me?</p>
<div>To patch the problem, just open displayshield4d.cpp and replace <p>#include &quot;WProgram.h&quot; </p><p>by this :</p><p>#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100 <br>#include &quot;Arduino.h&quot; <br>#else <br>#include &quot;WProgram.h&quot; <br>#endif</p></div>
<p>hmm, how to open displayshield4d.cpp ?</p><p>im total noob :D</p>
<p><a href="http://www.mediafire.com/view/iw6yidmaqj4qd7w/LiquidCrystal.cpp" rel="nofollow">http://www.mediafire.com/view/iw6yidmaqj4qd7w/Liqu...</a></p><p><a href="http://www.mediafire.com/view/0afqt9wcyewjggs/LiquidCrystal.h" rel="nofollow">http://www.mediafire.com/view/0afqt9wcyewjggs/Liqu...</a></p><p>download this two files. Replace it with Arduino/libraries/liquidCristal/src/</p><p>Let me know if this works or not...</p>
<p>http://www.mediafire.com/view/pyhtnvnovrdx2dq/code.ino</p>
<p>Hi, Do you have a *.ino version to send me? Thanks.</p>
<p>please tell the EXACT TEMPERATURE SENSOR name... And please upload the circuit DIAGRAM of this project... </p>
​ds18b20.................<br>Circuit was given there .... Just connect the digital data pin to the PIN 7 of the arduino uno.................
<p>Is there a way to display Fahrenheit on the screen? I know that you can multiply the Celsius by 1.8 then add 32 to convert it. Can I apply this in the code?</p>
<p>******This is not tested.. So please let me know whether it works or not.</p><p>&gt;&gt;&gt;&gt; change little bit in this portion----------</p><p>-------------------------------------------------------------- </p><p>void loop(void) {</p><p>float temperature = getTemp();</p><p>float tempinf=(temperature*1.8+32);</p><p>Serial.println(temperature);<br>lcd.setCursor(0, 1);<br>lcd.print(&quot;Temp : &quot;);<br>lcd.print(tempinf);</p><p>lcd.print(&quot; *F&quot;);<br>delay(100); </p><p>-------------------------------------------------------------</p><p>******This is not tested.. So please let me know whether it works or not. </p>
Hmm you can.... Right now I can't test the code... I will try it then reply tomorrow. ..
<p>Great code! Had been tinkering all morning. This solved it!</p>
<p>You need to adjust your display brightness &amp; Contrast to make it more clear.....</p>
<p>Thanks MIKE.... </p>
<p>Rahul, Very nice project. I would like to know something if you can.</p><p>I have TAIE digital temperature controller which I am using for temperature controlling in a specified range say 30 +/- 2 C. I want to connect it with arduino to give an alarm if it gets out of range and even send or call on a phone number. I know, for that I would required Arduino UNO, GSM module and a buzzer but don't know the arrangement. Pls. help if possible.</p>
<p>it would be very easy if you tell me about TAIE. Its new to me.... Does it have any output pin that could be connected to arduino...????</p>
Thanks for comment.... Please give me some time, i will reply you as soon as possible. <br>Thanks again...
<p>can you please let me know how to convert to Fahrenheit ? and where should i include the code ?.</p>
<p>I am sorry that i didnt noticed your comment... Have u solved your problem? If not then let me know.. I will help you.</p>
<p>Why it's show Temp : -1000. 00 on the screen? I'm using Arduino uno R3</p>
<p>I dont know why its not working, Try this set up....</p><p>we will use the 2 wire method. Simply connect both the GND and VDD pins to 0V (yes both). Then connect the DQ pin to pin 2 on the Arduino board (can be any Arduino digital pin)</p><p>A 4K7 ohm pullup resistor is required on the DQ pin to pull it up to 5V</p>
<p>I had this error when i forgot to add the power to the sensor, Thanks for the tutorial</p>
<p>Great Instructable, thanks! Would it be possible to connect the display using an LCM1 602 controller, and If so, which pins on the Arduino would I hook it up to?</p>
Nice Work <br>can you help to add a Second DS18B20 Sensor ? <br>regards
Yes... I can.........
hy i havae already soved teh problem with the second Sensor <br> <br>thx
In order for me to learn everything that i can i would like to know how to get a temp reading out of an DS1307 Real Time Clock module. At one point you show an DS18B20 which is a temp sensor but it is not shown in the BOM. Looks like there might be 2 projects crossed with each other.
Sorry thats my fault. This is DS18B20 temperature sensor.
Very new to this, how easy would it be to add 2 or more DS18B20's and get them to display? <br>i already have them connected on the same 'wire'
Actually i didn`t try that, Because i have only 1 DS18B20 .... But I think it`s not so hard..

About This Instructable

71,844views

41favorites

License:

More by Rahul Mitra:Webcam As Night Vision Camera Anti-Theft Alarming System Homemade DVI-I to DVI-D converter 
Add instructable to: