More PIC Applications:TEMCON2 Temperature Controller

TEMCON2 Temperature Controller

The 16F887 has a comprehensive set of peripheral features, including 14 analogue inputs, three timers, four ECCP (Enhanced Capture Compare PWM) channels, extended universal synchronous asynchronous receiver transmitter (EUSART), MSSP (Master Synchronous Serial Port) and in-circuit debugging (ICD). The ’887 is a pin-compatible replacement for the 16F877A, with some extra features such as additional analogue inputs, comparators and pulse width modulation (PtWM) outputs, an internal oscillator and local interconnect network (LIN) connectivity.

The temperature controller application board TEMCON2 uses most of the available I/O, matching the PIC selected to the application fairly closely. The 8k memory should be sufficient for most application programs that might be developed for this hardware. A demonstration program is provided which will exercise the simulation design and hardware for test purposes.

System Specification

A heating and ventilation system is required to control the environment in a space such as

a greenhouse where the temperature must be kept within set limits (0e50oC). A basic block diagram is shown in Figure 13.1.

The unit will be programmed to accept a maximum and minimum temperature, or a set temperature and operating range. The system will operate on the average temperature reading from four sensors, to give a more accurate representation of the overall temperature. Using more than one temperature sensor also allows the system to tolerate a fault in one sensor, if the application firmware includes a check to see if any sensor is out of range. The temperature is maintained by a relay switched heater and vent, and a fan which can be speed controlled via a field effect transistor (FET) output. The fan is fitted to the heater, so that it can be used for forced heating or cooling, depending on whether the heater is on. The FET interface allows speed control of the fan by PWM. The system should operate as specified in Table 13.1.

Figure 13.2 shows the interfacing requirements for the application. Four temperature sensors are used to monitor the temperature at different points in the target system. Fortunately, this

PIC Microcontrollers-1315

application does not need much analogue signal conditioning on the input side, other than capacitor decoupling to inhibit noise, and the temperature sensors can be connected directly to the PIC. Their readings can be averaged, or processed with a weighting factor for each, to give a representative value for the measured temperature.

The outputs are controlled via two different interfaces. Relays are used for the heater and vent, assuming that on/off control is suitable. These interfaces are implemented as normally open switched relays, so that an external power supply can be used. The fan output

demonstrates the alternative solid-state interface, using a general purpose power FET. This allows proportional control, but the external circuit must be operated at 5 V. This interface would need to be elaborated for a speed-controlled fan in a full-scale system, and the output could be reallocated to one of the PWM outputs on the 16F887.

PIC Microcontrollers-1316

Leave a comment

Your email address will not be published. Required fields are marked *