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 -- 5] -- Using Keypad and LCD Screen at Once to make simple Calculator

Good day. This is my fifth times of my post about Arduino. We've learned about how to create something using Arduino from the very beginning that was just make a simple push button, till we made something more difficult which was creating a temperature censor and displaying the result in the LCD screen. And now, i'm gonna show you how to use a keypad and LCD Screen at once. With these two devices are combined with our Arduino, we are able to make something like a little application. And now, i'm gonna make a simple calculator using them. Stuffs: These are stuffs you are gonna need to prepare An Arduino Uno A BreadBoard Jumper Cables A Keypad A PC which has Arduino App Installed A Potensiometer A Resistor What do we do? First thing we gotta do is to wire our Arduino and keypad as shown below: Actually we dont need the speaker and the led. But I put them when i wired them. And here is my work: It was a little bit confusing i thought. And aft

[Arduino Project-2] -- Lampu Fade in - Fade out dengan PWM

Good Day, Semoga hari-hari selalu menjadi hari baik bagi kita semua. Masih kesengsem sama Arduino, pada postingan kali ini saya akan menjelaskan (kalau bisa disebut) mempraktikan cara membuat lampu LED yang bisa nyala terang dan gelap (fade-in / fade-out ) dengan PWM. Yang akan kita lakukan adalah membuat lampu LED berubah tingkat terangnya (brightness). Sebelumnya kita perlu tahu apa itu PWM. PWM atau Pulse Width Modulation adalah teknik yang dilakukan untuk mengubah tingkat ke terang an (brightness) LED dengan cara mengatur waktu delay. Jika kita memberikan delay pada LED dengan Arduino maka lampu tersebut akan berkedip. Akan tetapi jika delay sangat cepat, maka lampu tersebut terlihat tidak berkedip lagi, melainkan kita bisa mengatur tingkat terang (brightness) lampu tersebut. Jika delay yang sangat cepat tersebut diturunkan kecepatannya sedikit, maka yang terlihat adalah brightness lampu yang turun. Begitu pula sebaliknya. Jika membingungkan, Anda tidak perlu mengingatnya. Baiklah

[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 di