Page 210 - ARM Based Microcontroller Projects Using MBED
P. 210

196                          8. INTERMEDIATE LEVEL PROJECTS

                         while(1)                                 // Do forever
                         {
                             mV = 3300.0f * ain.read();           // Voltage in mV
                             gotoscr('4', '0');                   // Goto line 4 col 0
                             MyPC.printf("Voltage = ");
                             MyPC.printf("%f", mV);               // Display voltage
                             wait(1.0);                           // Wait 1 second
                         }
                      }
                 FIG. 8.57,  CONT’D













                 FIG. 8.58  Typical output from the program.


                          8.21 PROJECT 17—ANALOG TEMPERATURE SENSOR
                                         (DIGITAL THERMOMETER)

                 8.21.1 Description

                   In this project, the ambient temperature is measured using an analog temperature sensor
                 chip, and is then displayed on the PC screen every second.



                 8.21.2 Aim
                   The aim of this project is to show how the ambient temperature can be measured using a
                 temperature sensor chip.


                 8.21.3 Block Diagram

                   Fig. 8.59 shows the block diagram of the project. In this project, a TMP36-type analog tem-
                 perature chip is used. This is a low-voltage precision temperature sensor (see Fig. 8.60) having
                 the following features:

                 • Voltage input: 2.7V–5.5VDC
                 •10mV/°C scale factor
                 •  2°C accuracy over temperature
                 •  0.5°C linearity
                 • Operating range:  40°C to +125°C
                 • Less than 50μA quiescent current
   205   206   207   208   209   210   211   212   213   214   215