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

206                          8. INTERMEDIATE LEVEL PROJECTS

                 output and activates the buzzer when an alarm condition occurs. The following changes are
                 required in the main program:

                      DigitalOut Buzzer(PC_0);
                      …………………………..
                      …………………………..
                      if(T < MaxTemp && T > MinTemp)
                      {
                            MyPC.printf("NORMAL TEMPERATURE         ¼ ");
                            Buzzer ¼ 0;
                      }
                      else if(T >¼ MaxTemp)
                      {
                            MyPC.printf("ALARM-HIGH TEMPERATURE ¼ ");
                            Buzzer ¼ 1;
                      }
                      else if(T <¼ MinTemp)
                      {
                            MyPC.printf("ALARM-LOW TEMPERATURE ¼ ");
                            Buzzer ¼ 1;
                      }


                 8.22.8 Suggestions for Additional Work

                   Modify the circuit given in Fig. 8.71 by replacing the buzzer with a relay so that the relay is
                 activated when an alarm condition occurs.


                       8.23 PROJECT 19—ON/OFF TEMPERATURE CONTROLLER

                 8.23.1 Description
                   This is an ON/OFF temperature controller project. The ambient temperature in a room, or
                 the temperature of an oven, or of a liquid can be controlled using two methods: ON/OFF-type
                 control and continuous control (e.g., using PID, Proportional+Integral+Derivative algorithm
                 or a similar algorithm). In both methods, the temperature is measured using a sensor and neg-
                 ative feedback is applied to bring the temperature to the desired set point.
                   In this project, ON/OFF-type control is used where the desired set-point temperature is com-
                 pared with the actual measured temperature. A heater is connected to a relay where the relay is
                 turned ON or OFF accordingly so that the desired temperature is achieved and maintained.
                   In practice, ON/OFF-type controller is the simplest form of feedback control, but it has
                 some drawbacks. First, the actuator (e.g., relay) is turned ON and OFF so many times that
                 this may shorten its life time. Second, it is not possible to achieve precision control with
                 the ON/OFF-type controller. Usually, in this type of control, the desired temperature fluctu-
                 ates around the desired set point as the relay is turned ON and OFF. But, ON/OFF-type con-
                 trol is still used in many simple temperature control applications where a few degrees change
                 from the set point can be tolerated.
   215   216   217   218   219   220   221   222   223   224   225