Page 261 - Making PIC Microcontroller Instruments and Controllers
P. 261

A DUAL THERMOMETER  INSTRUMENT




















                    Fabrication of the dual  thermometer will be descfibed  in detail. Once the  basic tech
                    niques used in making this instrument have been demonstrated,  the  projects that follow
                    will  be described in somewhat  lesser detail. Later, we will  convert this instrument  into
                    a controller, and then in the last  project we will  tum it into a data logger
                      The  dual thennometer device (see Figure  18.1) is  based  on  the  National
                    Semiconductor  LM34  tempelature sensors.  These inexpensive three-wire integated
                    circuits provide a voltage signal t}Iat can be converted to degrees Fahrenheit  by multi-
                    plyiry  t}lat signal by  100. whal  could be simpler?  what  we must do is decide on the
                    circuitry for hooking  them up to the 16F877A PIC and  then settirg the appropriate  reg-
                    isters. Like all other programs  in this tutorial, the  program  will  be w  tten in PICBA-
                    SIC PRO. The temperature  readings are to be displayed on a 2line-by  16_character
                    display  about every 0.2 seconds.
                      The datasheets  for the LM34 and the I  6F877A  can be downloaded  from the lntemet.
                      The components shown  in Table 18.1 are  needed to make the dual thermometer.
                      See the circuit diagram  for this instrument in Figure 18.2.

                    '.ole   PC boaftls, designed  b! me, thdt dlloit) each of the rcla)ant ptujects to be built
                    onthemare  availablefrom e coderyeek.com.                     picturcs  and
                                                          See the suppon Web  site  Jbr
                    othet aletails.  This bodrds  fits  in a box  provkled by AII Electronics  for   a durabtu mount
                    inT  for  our prcjects. There is ample room in the box  for  pote  tiomete  rs, sl'titches, and
                    so on to wtke other instruments on these boaftls
                      The design of this instrument is an exercise  in reading analog voltages,  converting
                    them to aligital format,  prccessing  the information digitatly,  and displaying  it on an LCD
                    As such, these arc the basic  steps required to read  and display any analog signal  wilh a
                    PIC microprocessor, and are  thus the basic  processes for all oul hstruments.
                       There  are eight pins on thl3 16F877A  that can be used for analog input They are  dis-
                    tributed across  pofts A and E. Pin A.4 is excluded.
   256   257   258   259   260   261   262   263   264   265   266