niranjana ashoK and sreeja Menon
H
ere’s a standalone digital thermometer that also controls the temperature of the heating element of a device according to its re-quirement. Use of embedded technology makes this closed-loop feedback control system efficient and reliable. Microcontrol-ler (PIC16F73) allows dynamic and faster control. A temperature-controller knob and liquid crystal display (LCD) make the system user-friendly. The sensed and set temperature values are simultaneously displayed on the LCD panel in Kelvin scale.The circuit is programmed for ‘on’/‘off’
control. It is very compact using few components and can be implemented for
several applications including air-con-ditioners, water-heaters, snow-melters, ovens, heat-exchangers, mixers, furnaces, incubators, thermal baths and veterinary operating tables.
PIC16F73 microcontroller is the heart of the circuit as it controls all the func-tions. Fig. 1 shows the pin configuration of PIC16F73 microcontroller.
The circuit
Fig. 2 shows the functional block diagram of the PIC16F73-based dy-namic temperature controller. The temperature transducer (AD590) senses the temperature and converts it into an electrical signal, which is applied to the micro-controller. The analogue signal is converted into digital format by the inbuilt analogue-to-dig-ital converter (ADC) of the microcontroller. The sensed and set values of the temperature are dis-played on the 16x2-line LCD. The microcontrol-ler drives a transistor
to control the heating element with the help of an electromag-netic relay.
PIC16F73 is an 8-bit, low-cost, high-performance flash microcontroller. Its key features are 4k words of flash program memory, 192 bytes of data RAM, eleven interrupts, three I/O ports, 8-bit ADC and only 35 powerful single-cycle instructions (each 14-bit wide). The ADC simplifies the overall embedded system design by pro-viding a direct interface for temperature, pressure, motion and other sensors. The set temperature value can be varied from 253°K to 430°K using an external knob on the front panel of the cabinet.
Fig. 3 shows the circuit of PIC16F73 microcontroller-based dynamic tempera-ture controller. The temperatempera-ture sensor (AD590) outputs a current of 1 µA/°K.
ParTS lIST Semiconductors:
IC1 - 7812, 12V regulator IC2 - 7805, 5V regulator IC3 - PIC16F73 microcontroller T1 - SL100 npn transistor D1-D5 - 1N4007 rectifier diode AD590 - Temperature sensor LED1 - Red LED
LED2 - Green LED - 16×2-line LCD Resistors (all ¼-watt, ±5% carbon, unless stated otherwise):
R1, R8 - 1-kilo-ohm R2, R3, R6,
R7 - 10-kilo-ohm R4 - 3.9-kilo-ohm R5 - 15-kilo-ohm VR1 - 10-kilo-ohm potmeter VR2 - 10-kilo-ohm preset Capacitors:
C1 - 1000µF, 35V electrolytic C2 - 0.33µF ceramic C3-C6 - 0.33µF ceramic C7 - 100µF, 100V electrolytic Miscellaneous:
X1 - 230V AC primary to 7.5V-0-7.5V, 250mA secondary transformer
XTAL - 5MHz crystal
RL1 - 12V, 200-ohm, 1 C/O relay S1 - On/off switch
Fig. 2: Block diagram of the PIC16F73-based dynamic temperature controller Fig. 1: Pin configuration of PIC16F73 microcontroller
A high-impedance constant current is delivered for a supply voltage between 4V and 30V. The sensing range is linear from 218°K (–55°C) to 423°K (+150°C). A 10-kilo-ohm resistor is used to convert the
current from the sensor into voltage with a sensitivity of 1V/°K (1 µA/°K×1000).
Hence, the voltage range is 2.18V to 4.23V.
This voltage is fed to pin 3 (RA1) of the microcontroller.
PIC16F73 microcontroller is a 28-pin IC with three input/output ports: port A (RA0 through RA5), port B (RB0 through RB7) and port C (RC0 through RC7).
Port-A pins 3 (RA1) and 5 (RA3) are programmed as analogue inputs. The inbuilt 8-bit ADC converts the analogue input signal into 8-bit digital equivalent output. Its analogue reference voltage is software-selectable to either the positive supply voltage of the device (Vcc) or the voltage level of RA3 pin. Here, Vcc (5V) is selected as the analogue reference voltage.
Pins 3 (RA1) and 5 (RA3) are
pro-Fig. 3: Circuit of PIC16F73 microcontroller-based dynamic temperature controller Fig. 2: Block diagram of the PIC16F73-based dynamic temperature controller
grammed to sense the analogue voltages corresponding to the sensed and set tem-perature values, respectively. The voltage corresponding to the set temperature is obtained by means of a potential divider
Working of the circuit
The mains supply is stepped down by transformer X1 to deliver a secondary output of 7.5V-0-7.5V AC, 250 mA. The transformer output is rectified by a full-wave rectifier com-prising diodes D1 through D4 and fil-tered by capacitor C1. ICs 7812 (IC1) and 7805 (IC2) provide regulated 12V and 5V power supplies. Capaci-tors C2 and C4 bypass any ripple in the regulated outputs. LED1 gives power-‘on’ indication when current flows through resistor R1.
The 12V regulated supply is used for driving the temperature sensor (AD590). AD590 has three terminals, namely, ‘+’, ‘–’ and ‘CAN.’
The ‘+’ terminal is connected to the 12V power supply and the ‘CAN’
terminal is grounded. The current output obtained from the ‘–’ terminal is converted into voltage using resis-tor R2 (10 kilo-ohms). This voltage is applied to pin 3 (RA1) of the micro-controller.
The potential divider network comprising resistor R4 (4-kilo-ohm), potentiometer VR1 (10-kilo-ohm) and resistor R5 (15-kilo-ohm) is
con-nected across regulated 5V supply. The variable terminal of potentiometer VR1 is connected to pin 5 of the microcontroller.
Capacitors C5 through C7 filter out the noise.
A 5MHz crystal (XTAL) connected between pins 9 and 10 of the microcontroller pro-vides clock frequency.
Register-select pin 4, R/W pin 5 and Enable pin 6 of the LCD are connected to pins 4, 6 and 7 of the microcontroller, respectively, and data pins 7 through 14 are connected to pins 11 through 18, respec-tively. Pin 3 of the LCD is used to control the contrast by using preset VR2.
The relay is con-nected between +12V and the collector of transistor T1. When pin 22 of the micro-controller is high, tran-sistor T1 saturates and the relay energises to network comprising a potentiometer (VR1)
and two fixed resistors (R4 and R5). The variable terminal of the potentiometer is connected to pin 5 (RA3) of the microcon-troller and the shaft is rotated by the user to vary the set-point temperature that is visible on the LCD.
The microcontroller has been pro-grammed to sense the analogue voltages corresponding to the sensed and set tem-perature values. The sensed voltages are manipulated such that the corresponding temperature values are displayed on the LCD by sending out the corresponding data signals through pins 11 through 18 (RC0 through RC7) and control signals through pins 4, 6 and 7 (RA2, RA4 and RA5) of the microcontroller. Then the sensed temperature value is compared with the set-point temperature value. Pin 22 (RB1) of the microcontroller goes high if the set-point temperature is higher than the sensed temperature. This pin has been programmed as an output to control the relay through transistor T1.
The relay contacts are connected to the heating element.
Data is sent to the LCD’s data pins 7 through 14. Control signals required before each data transmission are sent to pins 4, 5 and 6 (RS, R/W and Enable) of the LCD.
Fig. 4: Flow-chart of the program
Fig. 5: Actual-size, single-side PCB layout for temperature
indicator using PIC16F73 Fig. 6: Component layout for the PCB
switch the device ‘on.’ When pin 22 is low, transistor T1 cuts off and the relay de-en-ergises to turn the device ‘off.’ Diode D5 is used here as a free-wheeling diode.