The implementation of the temperature control circuit basically consists of the following parts: Microcontroller, Communication Interface, Dual-direction Current Control Driver, Peltier Module (the actuating part), 5V-voltage Regulator, and the displaying module. To integrate all the parts, one major thing to take into consideration is how to reduce the noise that might distort and impede its functioning. Therefore, ground plane, separate power supply, analog and digital disparity, and decoupling capacitors are put into use. In the following part of this chapter, the functioning of different parts of the system will be discussed into details, and the techniques to reduce noise will be illustrated.


 4.1 Noise Reduction

a)      High Power and Low Power Components Disparity

Isolation of high power from the low power components can reduce the interference from high power components to low power ones. This is because high power components normally involve with more noise. In the circuit design, two 5V voltage regulators are applied to supply power separately for low power components (microcontroller, communication driver, etc), and high power components (dual-direction current driver). The voltage regulator also provides a degree of isolation between the circuit and external power supply.               


b)      Minimize the Current Loop Area

A current flows out the power supply, through the system and back to the power supply again. Ground thus forms the return path for the current flowing within the system. Current flowing through a wire generates a magnetic field around that wire. Such a magnetic field can be a source of electromagnetic interference (EMI). If the wires carrying current out and in are located close enough, the magnetic fields generated by the currents in the wires cancel out within a short distance of the wires. In this case a common ground plane is created. The objective is to keep all current-out paths and current-in paths close together and as short as possible.

c)      Decoupling Capacitors

The principle of keeping the loops small to reduce EMI applies same to the power paths. However it is difficult to draw a small power supply loop effectively in the circuit design. The power paths can therefore be susceptible to noise, and this can cause major problems to the circuit.

The solution is to provide a path to ground for any noise present in the power supply. This may be done locally for each component in the circuit, achieved by adding a decoupling capacitor between power and ground for each integrated circuit. The decoupling capacitors should be placed as close as possible to the power pins of the devices.

d)      Analog and Digital Disparity

The segmentation of the grounding plane for the different components also separated the analog part of the circuit from the digital part. As the analog components were highly sensitive to the noise influence of the digital counterparts, it was essential to ensure their isolation from each other.


4.2 Power Supply

The selected integrated chips chosen for the circuit (PIC18F2620, L298, MAX232, TMP04) all operates at 5V. The LM7805 regulator is used to regulate 5V. Two LM7805 regulators are used. One is to supply 5V to power up microcontroller (PIC18F2620), communication driver (MAX232), temperature sensor (TMP04) and dual-direction current driver (L298). The other is to supply substantial current to the Peltier Module which is controlled by the dual-direction current driver.


4.3 Microcontroller

Microcontroller PIC18F2620 is chosen for the circuit. PIC18F2620 operates at 5V. Flexible Oscillator Structure allows four crystal modes and up to 40MHz. 20MHz crystal resonator is applied. This microcontroller was considered to be lot more power efficient with its nanowatt power management modules that provide run, idle and sleep modes, based on the microcontroller’s state of activity. The idle mode consumed a mere 5.8uA current, thus saving heavily on the power consumed and the sleep mode powered down to 0.1uA, making it an ideal choice for our system. Moreover, to build an integrated system and to operate more compartments in the same time, I2C Master and Slave mode is chosen. So it is important to ensure the compatibility to I2C by the microcontroller. The CCP ports are used to send the PWM signal to the dual direction current driver that controls the Peltier Module.  Two inputs ports are connected to the TMP04 to record the reading of the temperature sensors. And LEDs are connected to the digital output ports to indicate the operation states of the microcontroller and they also serve as visual debugging signals.


The major features of PIC18F2620 that will be used in the circuit and algorithm design is highlighted as followed

1.    Digital Inputs and outputs

2.    10-Bit Analog-to-Digital Converter

3.    Timer0 Module

4.    Capture/Compare/PWM (CCP) modules

5.    RS-232 operation using internal oscillator block

6.    Mater Synchronous Serial Port(MSSP) Module


4.4 In-Circuit Serial Programming

In microcontroller PIC18F2620, PGC (Pin27 - RB6) is In-Circuit Debugger and ICSP programming clock pin and PGD (Pin28 - RB7) is In-Circuit Debugger and ICSP programming data pin.

Using Standard High Voltage Programming, VIHH is applied to MCLR through the connection to the programmable board to power on the microcontroller. PGM is not used and becomes a normal I/O pin. VDD and GND of the microcontroller also connect to the programmable board to serve as the power and ground.


4.5 Dual Direction Current Driver

The Peltier Module operates at heating or cooling mode according to the direction of current applied.  To control the direction of current, we can utilize the method of motor control. Therefore L298 Dual Full-Bridge Diver (dual direction drive) is applied. It operates at 5V and drives the module at a max 55V. The PWM signal is sent to the ENABLE pin of the driver from the microcontroller to control the rate of temperature change.



4.6 Temperature Sensor

The temperature sensor TMP04 is used to detect the ambient temperature that was prevailing directly on the thermochromic ink. The sensors operate at 5V and provide a digital PWM output. The temperature can be calculated in the following way as indicated in the datasheet.


Note that TMP04 has self-heating effects due to quiescent dissipation and power dissipation by the digital output, which might leads to degraded results. Moreover, the accuracy of TMP04 is variable at different temperature. The relationship between accuracy and ambient temperature is illustrated below:


Another major problem involved with the temperature sensor TMP04 is the Hysteresis phenomenon and Non-repeatability problem, which will lead to significant error in the temperature measurement. The details of this problem will be discussed further in Chapter 7.