ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Two-channel thermometer-thermostat 5-95 °С. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Power regulators, thermometers, heat stabilizers This device, built on the ATmega8 microcontroller, can be configured as a thermometer or as a thermostat independently for each of the two channels. It is possible to set the heater switch-off temperature within the range from +5 to +95 °C, the difference between the heater switch-off and switch-on temperatures from 0 to 4 °С, and to compensate for the systematic error of the temperature sensors from -2 to +2 °С. The diagram of the thermometer-thermostat is shown in the figure. Two DS18B20 sensors are connected to connectors X1 and X2, and the numbers of the sockets correspond to the numbers of their outputs. A three-wire connection scheme was used. I have been convinced many times that this is the only way to achieve the maximum length of the connecting wires, and wherever possible, I try to avoid parasitic power supply to the sensors. With copper wires with a cross section of 0,5 mm2, it was possible to provide a stable connection at a distance of up to 40 m. The readings of the sensors are displayed on HG1 - a three-digit LED indicator with common anodes of the LEDs of each category. Two-color LEDs HL1 and HL2 display the status of each channel. Control signals for heaters in thermostat mode are generated at the microcontroller outputs РВ6 (first channel) and РВ7 (second channel). Two-position control; the heater is on or off. Optocouplers U1 and U2 are installed for galvanic isolation of the device from actuators. In my version, the control circuits of two BT4 triacs that switch the heating elements are connected to the X5 and X139 connectors. If necessary, optocouplers can be replaced by transistors by including electromagnetic relay windings in their collector circuits. Within 4...5 s after power is supplied to the device, the sensors are initialized and their readings are initially collected. At this time, all elements of the HG1 indicator flash alternately. Next, the temperature measurement and display mode is set. In this mode, the heaters are off. The readings of the sensors on the indicator alternate with a period of 5 s. If the temperature is measured by the sensor connected to the X1 connector, the HL1 LED lights up, and the one connected to the X2 connector - HL2. In this case, if the corresponding channel is configured as a thermometer, the glow color is yellow, if as a thermostat, then when the command to turn on the heater is given, it is red, and in its absence - green. After pressing the SB2 button, the readings of only the first sensor are displayed, and after pressing the SB3 - only the second. If any sensor is not connected, its circuit has an open circuit, a short circuit, or the temperature has gone beyond 0,1 ... 99,9 °С, the indicator displays "Err" instead of the temperature value, and the corresponding heater is turned off. If, while displaying the temperature measured, for example, by the first sensor, you press the SB2 button several times, then with each press the corresponding channel will switch from thermostat mode to thermometer mode and vice versa. With a short press on the SB1 button, the mode of alternately displaying the temperature in two channels is restored. But if you keep the SB1 button pressed for a long time, the thermometer-thermostat will enter the setting mode of that channel, during the display of the temperature of which the button was pressed. In this mode, buttons SB2 and SB3 select the desired parameter: ut1 (ut2) - setting the heater switch-off temperature in channel 1 (2);
For example, if the switch-off temperature is set to 35 °С and the difference is 1,5 °С, the heating will occur until the temperature reaches 35 °С, when it is reached, the heater will be switched off and switched on again when the temperature drops to 33,5 °С. The optimal choice of the difference is achieved by a compromise between the accuracy of maintaining the temperature and the frequency of switching on the heater. co1 (co2) - correction of sensor 1 (2) readings. The entered value is added (signed) to these readings before they are sent for further processing. This allows you to compensate for the possible error of the sensor. In the case of repeated short-term pressing of the SB1 button, the value of the selected parameter stored in the microcontroller memory is displayed on the indicator, after which the SB2 and SB3 buttons (respectively, decrease and increase by 0,1 ° C) set its new value. If you keep holding these buttons for a long time, the parameter change starts to happen faster (approximately 10 times per second). 5 seconds after the last pressing of any button, the set value is stored in the non-volatile memory of the microcontroller, and the current temperature is displayed on the indicator. The program codes from the Termo2ch.hex file are written to the program (FLASH) memory of the microcontroller, and the information from the Termo2ch.epp file is written to its EEPROM. The bits of the microcontroller configuration are programmed in accordance with the table.
A watchdog timer must be enabled in the microcontroller to prevent the program from freezing. Since the 1-Wire interface used by the sensors is critical to the microcontroller's clock speed, it is necessary to fine-tune its internal clock generator to 8 MHz. To do this, by connecting the used instance of the microcontroller to the programmer, read the calibration constant located in the high byte of the word located at address 0x0003 of the microcontroller signature. After loading the Termo2ch.epp file into the programmer, but before programming, this constant is written to the zero cell of the EEPROM buffer of the programmer. The ATmega8 microcontroller can be replaced by the ATmega8L. When replacing the CPD-05211SR2/A indicator with a similar one of a different type, it may be necessary to select resistors R8-R15 to ensure acceptable brightness. Download microcontroller programs Author: I. Kotov, Krasnoarmeysk, Donetsk region, Ukraine; Publication: cxem.net See other articles Section Power regulators, thermometers, heat stabilizers. Read and write useful comments on this article. Latest news of science and technology, new electronics: Machine for thinning flowers in gardens
02.05.2024 Advanced Infrared Microscope
02.05.2024 Air trap for insects
01.05.2024
Other interesting news: ▪ Best time of day to get vaccinated News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ section of the site Mobile communications. Article selection ▪ article by Charles Warner. Famous aphorisms ▪ article What is the difference between a broker, a dealer, a broker? Detailed answer ▪ article Foxglove rusty. Legends, cultivation, methods of application
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |