Hardware Reference
In-Depth Information
CODE AND DIGITAL CONTENT FOR THIS CHAPTER
Code downloads, video, and other digital content for this chapter can be found
at www.exploringarduino.com/content/ch10 .
In addition, all code can be found at www.wiley.com/go/exploringarduino on
the Download Code tab. The code is in the chapter 10 download and individually
named according to the names throughout the chapter.
One of the best things about designing embedded systems is the fact that they
can operate independently of a computer. Up until now, you've been tethered to
the computer if you want to display any kind of information more complicated
than an illuminated LED. By adding a liquid crystal display (LCD) to your
Arduino, you can more easily display complex information (sensor values, tim-
ing information, settings, progress bars, etc.) directly on your Arduino project
without having to interface with the serial monitor through the computer.
In this chapter, you learn how to connect an LCD to your Arduino, and you
learn how to use the Arduino LiquidCrystal library to write text and arbitrary
custom characters to your LCD. After you have the basics down, you add some
components from previous chapters to make a simple thermostat capable of
obtaining local temperature data, reporting it to you, and controlling a fan to
compensate for heat. An LCD will give you live information, a speaker will
alert you when the temperature is getting too hot, and the fan will turn on to
automatically cool you down.
NOTE TowatchavideotutorialaboutinterfacingtoanLCD,checkout
www.jeremyblum.com/2011/07/31/tutorial-13-for-arduino-liquid-
crystal-displays .YoucanalsofindthisvideoontheWileywebsiteshownat
thebeginningofthischapter.
SettingUptheLCD
To complete the examples in this chapter, you use a parallel LCD screen. These
are extremely common and come in all kinds of shapes and sizes. The most
common is a 16n2 character display with a single row of 16 pins (14 if it does not
have a backlight). In this chapter, you use a 16-pin LCD display that can show
a total of 32 characters (16 columns and 2 rows).
If your display didn't come with a 16-pin header already soldered on, you
need to solder one on so that you can easily install it in your breadboard. With
the header successfully soldered on, your LCD should look like the one shown
in FigureĀ 10-1, and you can insert it into your breadboard.
Next, you wire up your LCD to a breadboard and to your Arduino. All of these
parallel LCD modules have the same pin-out and can be wired in one of two
modes: 4-pin or 8-pin mode. You can accomplish everything you might want to
do using just 4 pins for communication; that's how you'll wire it up. There are also
 
Search WWH ::




Custom Search