Arduino Lcd keypad sheild
One can mount the arduino lcd keypad shield on any arduino board and export its library in arduino sketch to use the predefined functions in library. Almost every function that character lcd offers their soft code is present in LiquidCrystal.h library. We just need to know about each function present in the library. One can see the library documentation on arduino website for each function(https://www.arduino.cc/en/Reference/LiquidCrystal).
Arduino lcd shield is interfaced with arduino boards in 4 bit mode(Difference between 4 bit and 8 bit mode). Arduino lcd display shield has a variable resistor mounted on it. One can rotate it to adjust the contrast of lcd display. It also has some push buttons on it which performs different functions like moving the cursor forward, backward, up and down. To learn more about power requirements and internal circuit of arduino lcd shield visit https://www.freetronics.com
Ds18b20 Temperature Sensor
DS18B20 has three pins. Two are power pins. Vcc which is connected to +ve of power supply and GND which is connected to -ve of power supply. The third and the middle pin is data pin(DQ). Data pin connected to an external controller for data fetching from sensor and for addressing the sensor. When used in circuits data pin must be pulled high for proper configuration of the sensor. Pulled up resistor value can be between 1 k ohm to 10 k ohm. DS18B20 is available in market in two packages. First package has its metal legs exposed much like a transistor and in the second package legs are connected to wires and sensor is enclosed in a metal casing to protect it from over heating.
Project circuit diagram
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // Arduino lcd sheild pins defined
After temperature fetching cursor is set on 16×2 lcd screen. First on first line temperature in centigrade is displayed then the cursor is moved to second line of 16×2 lcd and temperature in Fahrenheit is displayed on second line of 16×2 lcd. Last statement of the code is delay function. The delay function is halting the temperature reading for 5 seconds. I other words we can say that after every 5 seconds the temperature reading are updated on lcd.
I connected only one ds18b20 sensor on one wire. For future enhancement to project one can insert multiple sensors one one wire and read data from multiple sensors. Check if the readings among all the sensors is same or their is some difference. One can monitor room, garden, garage and kitchen temperature with the above diy project.
Filed Under: Arduino, Microcontroller Projects