Good Day all,
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:
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.
Image:
Video:
Ok, we're done. I hope this will be useful...
Thanks for visiting my blog.
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):
- Arduino Uno R3
- A temperature censor (LM35)
- Some (or maybe a lot of) jumper cables
- A bread board
- A potentiometer
- and of course, An LCD screen.
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 CelsiusAnd 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
Post a Comment