| Fig. 1: LCD display for the temperature controller |
Circuit and working
Fig. 2 shows circuit diagram of the digital temperature controller. The circuit is built around microcontroller PIC16F877A (IC1), precision thermocouple amplifier AD8495 (IC2), K-type thermocouple (connected at CON3), 16×2 LCD (LCD1), single-changeover relay (RL1) and a few common components.
Sensor selection. There are basically two types of temperature-measurement systems—direct temperature-measurement systems for up to 1000ºC and indirect temperature-measurement systems for higher temperature range, wheretemperature sensors may get physically damaged due to the high temperatures. The selection of temperature sensor is dependent on the range of temperature you wish to check. There are different types of direct-measurement sensors, for different ranges of temperature (refer Table I).
| |
Microcontroller. The heart of the system is microcontroller PIC16F877A, which is a low-power, high-performance, CMOS 8-bit microcontroller. It includes 8kB Flash memory, 256-byte EEPROM, 368-byte RAM, 33 input/output (I/O) pins, 10-bit 8-channel analogue-to-digital converter (ADC), three timers, watchdog timer with its own on-chip crystal oscillator for reliable operation, and synchronous I2C interface.
Fig. 2: Circuit diagram of the digital temperature controller |
| |
A 4MHz crystal is connected between pins 13 and 14 of microcontroller IC1 to provide the basic clock frequency. Power-on reset is provided by the combination of resistor R2 and capacitor C1. Switch S1 is used for manual reset. IC2 is a precision instrumentation amplifier with thermocouple cold-junction-compensation circuit. The input signal for IC2 (approximately 42µV/°C) is generated by thermal effects of the thermocouple. IC2 produces output (5mV/°C) directly from a thermocouple signal. With a 5V supply, the 5mV/°C output allows the device to cover nearly 1000 degrees of a thermocouple temperature range. Output of IC2 is connected to ADC input pin RA0 of microcontroller IC1.
Fig. 3: Circuit diagram of the 5V power supply |
Fig. 4: Configuration bit |
Fig. 5: Combined actual-size, single-side PCB layout for the temperature controller and power supply circuits |
Fig. 6: Component layout for the PCB |
| |
Download source code: click here
The power supply circuit is shown in Fig. 3, where the mains supply is stepped down to 9V, 500mA by transformer X1. This stepped-down AC voltage is rectified by bridge rectifier BR1 and filtered by capacitor C10 before it is fed to IC3. Regulator IC3 provides regulated 5V DC supply. The glowing of LED1 indicates presence of power in the circuit.
Software
The program is written in ‘C’ language and compiled using Hi-Tech compiler along with MPLAB to generate hex code. The generated hex code is burnt into the microcontroller using a suitable programmer with configuration bit setting as shown in Fig. 4. The program is well commented and easy to understand.
Construction and testing
An actual-size, single-side PCB for the digital temperature controller is shown in Fig. 5 and its component layout in Fig. 6. Assemble the circuit on a PCB to save time and minimise assembly errors. Carefully assemble the components and double-check for any overlooked error. Use proper IC base for IC1. IC2 being an SMD chip, it needs to be soldered at the solder side of PCB. After assembling and wiring the circuit properly, connect 230V, 50Hz mains supply to primary winding of the transformer, and connect transformer secondary to the PCB at X1.
Set any minimum and maximum temperature with the help of LCD display, by pressing switches S2 and S3. The maximum temperature will start from minimum temperature +10 degrees. If the temperature being measured is more than the preset maximum temperature, relay RL1 de-energises and the heating element is switched off. Similarly, when the measured temperature goes below the preset minimum temperature, relay RL1 is energised and the heating element is turned on.
To check the circuit for proper functioning, verify 5V power supply at TP1 with respect to TP0. TP2 is ‘low’when temperature goes below minimum temperature and remains in that state until the maximum temperature is reached.
No comments:
Post a Comment