Skip to main content

[Arduino project - 4] -- Calibrated Temperature Censor Displayed in LCD

Good Day all,
I didn't realize today is today, haha, because today is the time to do something awesome again with Arduino.
In the last talk, we made a temperature censor using Arduino which was displayed in our PC screen, it was pretty simple to do and i hope you could follow my instructions clearly because it was just to plug the censor into some pins, wrote some lines of simple code which you can copy and paste from my post, and did some clicks to show it in the monitor.
And now, since we have an LCD screen, we want our temperature to be displayed in it, not in our PC screen. What do we do now? here it is.

You're gonna need these stuffs (you can click on each stuff to see their pic. as I don't want to put their pics):
  1. Arduino Uno R3
  2. A temperature censor (LM35)
  3. Some (or maybe a lot of) jumper cables
  4. A bread board
  5. A potentiometer
  6. and of course, An LCD screen.
Then, if they've been prepared, we're gonna need to connect our Arduino with LCD like this:

The reason of why we need a bread-board is to give them a bridge since it's difficult to connect them directly. You can see in the picture above there is a resistor of 220 ohm needed. It is used to adjust the brightness of the backlight, but actually I did it without any resistor involved (although I cannot adjust the brightness, but it doesn't really matter). So, don't worry if you don't have any resistor.
Now we got to check whether our devices are connected correctly or not by displaying the text 'Hello world' into the LCD.
Connect Arduino to our PC which has arduino application installed.
Then write these lines of code below:

#include <liquidcrystal .h> // include the library code</liquidcrystal>
//constants for the number of rows and columns in the LCD
const int numRows = 2;
const int numCols = 16;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(numCols, numRows);
lcd.print("hello, world!"); // Print a message to the LCD.
}
void loop()
{
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}


And paste them into the Arduino Application which is installed in your PC. Then, press the  verify button and next press the upload button.

We can see the text said 'Hello world' in our LCD. If you don't, you need to adjust the text brightness by turning the potentiometer switch. This is my work:



Ok. we did it.
Now, what we need is to put the temperature censor. It will do exactly like my last post. Connect the censor to arduino like this.
And then, we got to make a little change inside our recent code to be like this:


Then, verify and upload the code. We're gonna see the temperature in our LCD.

Honestly, we're done. We have our censor is working, and displaying the temperature in our LCD. But, one thing we do need to do is to calibrate our censor so that it will show the temperature correctly, well almost correctly.
How do we calibrate our censor?
We need to see the room termometer or any kind of termometer will work. You need to compare the temperature displayed in the termometer with the result in our LCD. In my experience, I got the temperature in my LCD is higher than the real (than what was seen in the termometer) with the deviation of 0.18 degree celsius. To fix this, we need to add or subtract the result of our censor which is shown in this line 19th in the above code.
float celsius = (millivolts / 10)-0.18;  // sensor output is 10mV per degree Celsius
And here it is. Our result will be like this:
Image:


Image: The termometer to calibrated the temperature

Video:


Ok, we're done. I hope this will be useful...
Thanks for visiting my blog.

Comments

Popular posts from this blog

Visiting Animals with My Family

Big day, big day, big day.... /XD Yup, this is a very big day, for me. Why? Because, my parents, and my brother, are coming. I'm pretty excited, but also nervous. You know how it feels when you have a very messy room, and you got your parents are coming? Or you don't know what to do with your family as you have a tiny sized room? Arrhg /shock, it's complicated. But very exciting too. X-D First time of our journey, we were arriving at Sabuga. One of the lovely building style in here (ITB) is the classical stone that covers almost in all the part of the building... Oho, what is this? :P I was not using a professional camera, and I'm not a photographer too, so I couldn't make a good one. hehe. Bye the way, this is under the ground pipe.. Some places in ITB are unique (people said that), and one of them are 'echo point'. This place, if you speak up loud enough, will be able to spread out into all around of ITB and everyone's gonna...

Lakukan Apapun yang Menjadi Renjana-mu Meskipun Hidupmu Semenjana

Judul di atas mungkin sedikit sulit diartikan atau bahkan membingungkan bagi kita. Mungkin ada juga yang mengira kalau aku menyisipkan kata-kata asing atau apa. Padahal sebenarnya, semua deretan kata dalam judul diatas murni bahasa kita tercinta, Bahasa Indonesia. Ya, semuanya kata asli Indonesia. Hanya saja kita tidak terbiasa menggunakannya yang membuat kita merasa asing. Padahal jika aku ganti dengan kata asing, kalimat itu justru tidak asing. Ini nih: "Lakukan Apapun yang Menjadi Passion -Mu Meskipun Hidupmu Biasa-biasa Saja ". Sekarang jauh lebih mudah dimengerti kan? Terlepas apakah kalimat itu punya makna atau tidak, akan tetapi, kita lebih mudah mencerna setiap kata dalam kalimat itu. Hal ini memang miris mengingat kita lebih kenal dan lebih dekat dengan bahasa asing dari pada bahasa asli sendiri yang membuat kita merasa asing dengan bahasa sendiri dan bahasa asing malah tidak terasa asing karena sering kita gunakan. #mbulet-mbulet kalimatnya Sis: "Bro, ...

Ramadhan 1435H & Silaturahmi keluarga

Baju baru alhamdulillah, tuk dipakai di hari raya, Tak punya pun tak apa-apa, masih ada baju yang lama. Sepatu baru alhamdulillah, tuk dipakai di hari raya, Tak punya pun tak apa-apa, masih ada sepatu yang lama. Kue baru alhamdulillah, tuk dimakan di hari raya, Tak punya pun tak apa-apa, masih ada kue yang lama. /wahaha Alhamdulillah, tidak terasa ramadhan telah berlalu. Rasa syukur ku kepada Allah SWT. karena telah diberi kesempatan untuk bisa bertemu ramadhan tahun ini sampai selesai. Meskipun Ramadhan udah selesai, semoga hati dan jiwa tetap fitri dan selalu terjaga. Ramadhan kali ini sangat menyenangkan meskipun setengahnya aku jalanin tanpa keluarga, tanpa sanak saudara yang menemani jerih payah puasa. /sweat Tapi ngga papa, yang penting inti dari ibadah bulan ramadhan tetep didapat. #intinya apa ya? Seperti ramadhan-ramadhan sebelumnya, setiap satu minggu sebelum lebaran ibu (dan aku) pasti bikin kue-kue penghias meja. Kali ini pun sama. Aksi bikin kue pun terjadi...