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

[Arduino Project-1] -- PushButton Lamp

Apa sih Arduino? Salam, Pada posting kali ini akan menjelaskan tentang tugas kuliah Interaksi Manusia dengan Komputer dan Antar Muka, yaitu membuat lampu push button menggunakan Arduino. Saya anggap pembaca telah mengetahui apa itu arduino. Jika belum tahu, akan saya jelaskan sedikit. Arduino bisa dikatakan sebagai alat untuk membuat sebuah prototye. Kita bisa  membuat apapun (hampir apapun) dengan menggunakan arduino. Seperti membuat sensor panas/dingin,bahkan hingga membuat robot. Arduino sebenarnya diperuntukkan bagi para artist maupun designer yang memerlukan kemudahan dalam merancang produk yang hendak mereka buat. Jadi, untuk menggunakannya tidak diperlukan keterampilan khusus yang tinggi karena di design untuk kemudahan (tentunya setelah tahu dasar-dasarnya). Seperti apa sih Arduino itu? Di bawah ini gambarnya Image Source: https://dlnmh9ip6v2uc.cloudfront.net//images/products/1/1/0/2/1/11021-01a.jpg Arduino ada banyak jenisnya yang bisa dilihat...

Fight

You've been here all along You gotta hear what I said Who are you fooling right now? Never mind what I saw You gotta tell what are you doing here anyway? You mumble and mutter and murmur, speak indistinctly Fine! Don't tell me, don't speak! I don't want to speak to you anyway!

My Blog's Template (Is it beautiful enough?)

Choosing template for our blog is a little bit difficult because we need to make sure it has a nice structure, easily used and perhaps fit in our style or our soul or our wish. Some blogs I found have sooo good in arranging their view so that I can easily browse its contents and also have an eye catching style which makes my eyes keep open. But some blogs also have (if I can say) terrible design which I won't be able to see it twice. It has a lot of ads here and there, it has awful structures like: "I don't know where to begin with" and "I don't know what function is this button for" or "it has bad color choosing", it has so many pictures and some gifs and our cursor is changed into something gross, and so on. Choosing template or theme or our blog's design no needs to be very beautiful (even I don't say that mine is), but at least it has a 'good' design that allows reader to read it easily. I've tried to create template...