This project uses a temperatur sensor (LM-35) Module that is controlled by an arduino uno board. The LM-35 Module connect to analog pin as reader input termperatur and LCD connected to arduino uno board serves as Output viewer media.
Arduino Uno - is a Atmega32-based microcontroller board.Having many digital and analog pins, the arduino can be easily programmed via a computer or laptop with USB and is designed to facilitate electronic users in various fields. As open source he comes with 2 products namely Hardware Arduino Board and Arduino IDE software.
LM-35 Module - LM35 is a sensor that can be used to measure temperature with output that is proportional to temperature (° C). Often used because it is more accurate than thermistor and easily combined with arduino board. The low price is also a major factor in the use of this tool. LM-35 has 3 pins "V (+)", "GND (-)" and signal (S).
Using the fritzing software, we will create our Circuit Architecture. Open The Fritzing Beta - choose BreadBoard
open fritzing and prepare all part you need to make the Circuit Architecture , you can make the circuit with another program , like proteus, Tinkercad etc.
After you Prepare all the part now connect the module (LCD & LM-35) on the breadBoard to the arduino board using the jumper wire. To add the wire just click the port and drag to another port.
Pin Connect LM-35
Pin Connect LCD
First you need to include the library for LCD , you can add here if don't have the library
#include
The explenation of the coding :
• #include <LiquidCrystal.h> the code to include library for LCD
Second,initialize Variable you can use #int . . , #float . . , #double . . and #char . . in the case we will use #int . .
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
int potPin = 0;
float suhu = 0;
long val = 0;
The explenation of the coding :
• LiquidCrystal lcd(7, 6, 5, 4, 3, 2); = 0; this code to initialize the all input pin from the LCD
• int potPin = 0; this code to initialize the input pin for the LM35
• float suhu = 0; this code to initialize ouput
• long val = 0; this code to initialize the value result from the LM35
After Define you Now Set Up the All PinMode void setup()
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
}
The explenation of the coding :
• Serial.begin(9600); to set up the serial monitor on the laptop Or Computer
• lcd.begin(16, 2); to set up the LCD's number of rows and columns
Last program is void loop() everything about the system can be run continuously.
void loop()
{
val = analogRead(potPin);
suhu = (5.0 * val * 100.0)/1024.0;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("current temp. ");
lcd.setCursor(0,1);
lcd.print((long)suhu);
lcd.print(" deg.C");
delay(1000);
}
The explenation of the coding :
• val = analogRead(potPin); to read the value from the sensor
• suhu = (5.0 * val * 100.0)/1024.0; to convert to Celcius
• lcd.clear(); to clear LCD screen
• lcd.setCursor(0,0); to set text to LCD row 1
• lcd.print("current temp. "); to some text to add meaning to the numbers
• lcd.setCursor(0,1); to set text to LCD row 2
• lcd.print((long)suhu); to writing temperature value
• lcd.print(" deg.C"); to writing in the celcius
• delay(1000); to make delay 1ms
After write codes, click the "Verify button" to save and compile the sketch. This will also check for any errors in the program.
If no errors is found , now you can click "Upload button" to start installing the program into the arduino uno board.