ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Multifunctional watch-thermostat with remote control on the microcontroller. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Microcontrollers I had a need for a desktop clock-thermometer, so that, in addition to time, I could find out the temperature in the street and in the house. There are many designs of this kind on the Internet, and even very advanced ones, but I have not made my choice in favor of any of them. Each lacked something that, as it seemed to me, was simply necessary for such devices. I just have a certain set of requirements, from which I could not remove anything in order to repeat any of these constructions. In my view, the clock should work on the principle of turn it on, set it and forget it, that is, resort to their maintenance as little as possible (for example, adjust the time due to its departure, set it again after power failures, switch to summer and winter time, etc.), the readings on the indicator should be visible from afar, but not illuminate the room at night, it is desirable to have a remote control. Further thinking about what else I would like to have in my watch resulted in a device with the following feature set: 1. Clock - calendar Counting and output to the indicator hours, minutes, seconds, day of the week, day, month, year.
2. Alarms 10 independent alarm clocks with the ability to set any day of the week or a combination of them. The ability to turn on the sound signal, turn on / off any of the four loads, or start thermal control when triggered. 3. Timer The maximum countdown time is 99h 59m 59s. Possibility at the end of the countdown to turn on the sound signal, turn on / off any of the four loads. 4. Two-channel thermometer-thermostat Measurement and indication of two temperatures, for example, at home and outside, in the range from -55 to 125 ° C with a resolution of 0,1 ° C. Two independent thermostats with the ability to set the upper and lower limits of the controlled temperature in the same range. Possibility of heating or cooling. Load capacity of control channels ~220V, 12A 5. Four channels of load control Load capacity of each channel: ~220V, 12A. Control: manual, from alarm clocks, by timer (the first two channels are connected with thermostats) 6. Additional functions of the device Battery backup, (when running on battery power, the device has a full functioning). Automatic (depending on external lighting) or manual adjustment of the indicator brightness. Full IR remote control on the RC-5 system, customizable for any remote control keys working in this system. Sound confirmation (switchable) of pressing the control buttons and accepting commands from the remote control. Non-volatile memory for all adjustable parameters. Cyclic indication allows you to display up to four parameters on the indicator with a programmable duration:
The scheme of the device is shown in Fig. 1. It consists of three blocks: A1, A2, A3 which are also structurally separated and assembled on three printed circuit boards. Central block A1 The main element is the ATmega8-16AI (DD1) microcontroller, in which the following nodes are involved: - timer T1 generates time intervals for real time clock, dynamic indication and brightness control;
The clock frequency of the MK is set by a ZQ1 quartz resonator at 7,3728 MHz. The MK is reset to its initial state (reset) by the R5C4VD1 circuit. L1C5 - power supply circuit of the ADC unit in the MK. The XP1 connector is intended for in-circuit programming of the MK. The device uses dynamic indication. The button scanning process is also associated with it. B1is used to receive commands from the remote control operating on the RC-5 system. In this case, five buttons on the remote control will be activated, which will correspond to five buttons of local control. Setting up the remote control is described in the user manual. Resistor R33 adjusts the brightness at medium or maximum illumination. Setting the accuracy of measuring the controlled voltages of the power supply and backup battery is carried out by resistors R35, R37, respectively. The DD2 chip is a driver that converts TTL RX / TX signals into a differential signal of the RS-485 standard for data exchange with a PC at a distance of up to 1200 meters.
Physically, they are located on the same line, so the sensors are addressed to read the temperature. The device only works with DS18B20 sensors The process of writing the serial numbers of two sensors into the non-volatile memory of the MC is performed as follows: 1. It is necessary to completely de-energize the device (take out the backup battery, turn off the AC adapter)
Now the device will work with these sensors. If it is necessary to replace any of them, then this procedure for the corresponding sensor must be repeated. If a second sensor is not required, then one sensor can be assigned to both channels.
Display unit A2 contains a five-digit seven-segment indicator with a common anode, five status LEDs, as well as the elements necessary to control it all. The purpose of the status LEDs is as follows: HL1 (yellow) - a sign of the inclusion of any of the alarms
Chip DD3 is a shift register with a latch and the ability to transfer outputs to the third state and is used to convert serially incoming data into parallel to display information on a digital indicator and status LEDs. VT1 - VT5 are designed to amplify the power supply of the common anodes of digital indicators. Load control unit A3 is intended for switching of any devices connected to a standard electrical network ~ 220V, 50 Hz. There are 4 control channels. Any of them can be turned on / off manually, by timer, from an alarm clock. The first and second channels are connected respectively to the first and second thermal control channels (which in turn are tied to the first and second alarms). Each channel includes an electromagnetic relay and a transistor switch to control it. The relay contacts switch the load. The unit implements economical relay control. Consider it on the example of the first channel. When the channel is off, transistor VT9 is closed, capacitor C16 is discharged, relay K1 is de-energized. When the channel is turned on, VT9 opens, capacitor C16, charging through the winding of relay K1, creates a current pulse sufficient to attract the armature of this relay. After the capacitor is charged, the armature of the relay is held by a smaller current flowing through resistor R27. Diode VD11 protects the transistor VT9 from impulse breakdown at the moment of its closing. LEDs HL6 - HL9 signal the on state of the corresponding channel. In my version, the internal battery is connected when connecting the A3 and A1 blocks through the XS4-XP4, since there is no external access to the battery compartment. To do this, the XP4 has a jumper between pins 6 and 7. This is done for ease of maintenance when replacing batteries or recording the numbers of thermal sensors in the MK memory, that is, when the circuit needs to be completely de-energized. If this is not required, then the minus of the battery is connected to the negative power bus directly. The voltage of the external power supply of the device is 11...13 V., the current is not less than 0,25A. As a backup battery, it is better to use 3 "AA" size alkaline cells connected in series. The current consumption of the device without block A3 at maximum brightness is about 120 mA. In the event of a mains power failure, the device switches to battery power, while it is fully functional (only the relays are de-energized), consumes a current of about 10 ..... 20 mA and can work for at least three days when fresh above-mentioned batteries are installed. The indicator is almost extinguished to zero, but the process of scanning the buttons does not stop, so it is barely highlighted. When you press any button on the local control or on the remote control, the indicator lights up again for 15 seconds so that you can view the information. When mains power is restored, the indicator lights up again. Design The device is assembled on three single-sided printed circuit boards made of foil fiberglass, the drawing and location of the details of which are in the attached files. The boards of the central unit and the display unit are interconnected by jumpers and placed in a case of a suitable size. The load control unit is structurally located inside the surge protector and is connected by a cable through a connector located on the back wall of the watch case. Replacing items Replace microcontroller DD1 with ATmega8-16AU, ATmega8L-8(AI)AU, RS-485 driver chip with SN75176BP, MAX485CPA, etc. 1, SFH36-1736, TFMS1836, but please note that the location of the outputs of photodetectors of different types may differ. As a sound emitter HA3, in addition to the indicated one, you can use another electrodynamic or piezoelectric one with a built-in generator for a voltage of 506 ... 36V, for example HCM5110X, HPM36A (X). Seven-segment LED indicators can be used from the same SA5360-XXXXX series or similar ones with a common anode (you may have to select current-limiting resistors R1-R5). Instead of DA6, you can use the domestic K1206EN14B stabilizer. The applied electromagnetic relays are designed for 08V winding supply and rated current 10mA. When using a relay with a high operating current, it is necessary to select resistors R17 - R1. Switching voltage ~142V, current 5A. Instead of the photoresistor SF12-30, you can use similar ones, the resistance of which in bright light is 24 .... 27 Ohm Possible device simplifications If control from a PC is not required, then you can not install the elements DD2, R1-R3, XP2. Due to the uselessness of IR control, B1, C1, R4 are not installed. You can exclude automatic brightness control without installing R33, and instead of the photoresistor R32, put a constant on 10k. If you do not need to manage loads, then block A3 is excluded, and a jumper must be installed on XS4 between 6 and 7 contacts. If there is no need for thermometers, then DD4 and DD5 are not connected and R6, HL4 are not installed. Assembly and adjustment of the device First, all elements except DD1 - DD3, B1 are soldered onto the board. Do not connect DD4 and DD5 yet. Turning on the power, measure the DC voltage at C10 and then at C1. In both cases, it should be around 5,3V. It is advisable to check the glow of all segments of the digital indicator and status LEDs by simultaneously supplying from the negative power bus to the left ones according to the output circuit of resistors R10-R18 (limiting the current of the segments) and R19 - R23 (in the base circuits VT1-VT5). If everything went well, then turn off the power, solder DD1 - DD3 and B1 and connect the programmer to the XP1 connector (a standard six-pin connector for AVR in-circuit programming). A demo firmware to test the device's performance is attached. The FUSE bits of the DD1 microcontroller must be programmed as follows: • CKSEL3...0 = 1111 - clocking from a high-frequency quartz resonator;
The rest of the FUSE - bits are better left untouched. The FUSE bit is programmed if set to "0". The demo firmware ensures the full operation of the device, but for a little less than two hours, which is quite enough to check the performance. For full-featured firmware, please contact the author, alexperm72@mail.ru. The control program for the computer is under development. Download HEX firmware, circuit board in LAY and GIF format, device photos Author: Alexey Batalov, alexperm72@mail.ru, ICQ#: 477022759; Publication: mcuprojects.narod.ru See other articles Section Microcontrollers. 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: ▪ The most powerful supercomputer center ▪ STSPIN233 - driver for low voltage BLDC motors ▪ AudioQuest NightHawk headphones with natural biocellulose cones ▪ Landing on the nucleus of a comet News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ site section Parameters of radio components. Article selection ▪ article by Edgar Allan Poe. Famous aphorisms ▪ article When was surgery first used? Detailed answer ▪ Akka feijoa article. Legends, cultivation, methods of application ▪ article Turkmen proverbs and sayings. Large selection
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |