![circuit xdiagram with heating elements circuit xdiagram with heating elements](https://i.pinimg.com/474x/97/d5/36/97d536ba400e2c62f7f00f1f009e61aa.jpg)
Now subtract the conversion result for boiling water from the ice-water result and divide by 100: substitute the answer for the value 2.460 in line 87 of the source code. Replace the number 546 in line 86 of the source code with the conversion result for the ice-water mixture. Now immerse the sensor in boiling water and repeat the procedure. Note down the conversion result (or take a number of results and average them for better accuracy). Immerse the sensor in a mixture of ice and water and wait until the reading stabilizes. The display will now show the conversion results from the A/D converter in the ATmega48. Remove the comment characters (‘) from lines 105 to 107 of the program, and comment out lines 108 to 110 by adding a single inverted comma at the start of each. Calibration of the temperature measurement, as mentioned above, is done by directly modifying the software. However, for many one-off applications it will be sufficient to determine the upper and lower switching thresholds experimentally, including compensation for any error in the temperature measurement.ĭetails of the control process can be found by inspecting the BASCOM source code. It will then not be possible to calibrate the temperature reading, as this can only be done in the software using the ISP interface. ISP connector K1 is optional and can be dispensed with if a ready-programmed microcontroller is used (see ‘Downloads and products’). The circuit diagram shows this as LED D3, which is intended to represent the LED in the optocoupler in the SSR. The author used this to drive a solid state relay (SSR) in his application which in turn controlled the heating element in the laminator. The output of the controller is the logic level on pin 27 (PC4). Since at least one LED is always lit there is no need for a power indicator LED.
![circuit xdiagram with heating elements circuit xdiagram with heating elements](https://i.stack.imgur.com/MoSqb.jpg)
If the blue LED (D2) is lit, the temperature is too low (below the lower switching threshold) if the red LED (D1) is lit, the temperature is too high (above the upper switching threshold) and if both LEDs are lit the temperature is just right (between the lower and upper switching thresholds). The two LEDs show the state of the controller at a glance. The upper line of the LCD shows the measured temperature and the lower line shows the current set point (upper and lower temperature switching thresholds). The display consists of the LCD panel and two LEDs. If the rotary encoder has a pushbutton function, this can be used to select between setting the upper and lower thresholds if not, a separate button must be fitted. It is possible to set upper and lower thresholds for switching. Turn the encoder to the right to increase the set point, to the left to decrease it. The set point for temperature control is entered using the rotary encoder in one degree steps. Not all AVR-series microcontrollers have the 1.1 V internal reference for the A/D converter, which should be borne in mind if modifying the design to use a different microcontroller. A point to note is that we can use the 1.1 V internal reference voltage to obtain good precision when converting the diode voltage drop, which is around 0.6 V.
![circuit xdiagram with heating elements circuit xdiagram with heating elements](http://www.tpub.com/ceb/11038_files/image556.jpg)
The voltage is measured using the ATmega48’s internal A/D converter using input ADC5 on pin 28. The voltage across the diode has a reasonably constant negative temperature coefficient of around –2 mV/K, and so the plot of voltage against temperature is reasonably straight. A current of approximately 1 mA therefore flows through the diode. The BD243C is wired as a diode by connecting its collector and base together and powered from the 5 V rail via a 4.7 kΩ resistor. Note that the heatsink is electrically connected to the collector of the transistor, so it may be necessary to use an insulating washer. The approach has the advantage of wide linear temperature range from –50 ☌ to +150 ☌ and the TO220 package is particularly convenient because it has a handy fixing hole and heatsink to allow good thermal contact. The base-emitter junction of an ordinary NPN power transistor in a TO220 package is used as the temperature sensor.Īlthough this technique is not often seen, it is far from new: decades ago Elektor published a digital thermometer design with an NPN transistor pressed into service as the sensor. The result (see circuit diagram) is based around an ATmega48 microcontroller with a 2-by-16 LCD panel and a rotary encoder. The laminator does include its own temperature controller, but it was not suitable for the author‘s purposes (making printed circuit boards using a thermal transfer method ). The circuit described here and its accompanying BASCOM software arose from the need to control the temperature in a laminator.