Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Multifunctional watch-thermostat with remote control on the microcontroller. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

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.
The presence of automatic adjustment of the current time, which is performed once a day (maximum values ​​+/-99,98 sec. in steps of 0,02 sec).
Calculate the day of the week from a date (for the current century).
Automatic changeover to summer and winter time.
Leap years count.

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:
1. Current time in hours - minutes
2. day of the week - number
3. temperature of the first channel (indoor)
4. temperature of the second channel (outdoors)
The presence of an RS-485 interface for communication with a PC via the MODBUS-RTU protocol for further integration into the "Smart Home" system

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.

Multifunctional clock-thermostat with remote control on the microcontroller
(click to enlarge)

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;
- external interrupt INT1 and timer T2 serve the infrared receiver B1.
- ADC converts into digital form the analog signals of the light sensor, voltage values ​​from the power supply unit and the built-in battery.
- USART module communicates with the computer (9600 baud, 8 data and 1 stop bits without parity);
- timer T0 generates time intervals of delays when receiving / transmitting packets via the "MODBUS-RTU" protocol
- the watchdog timer in case of "hanging" MK provides its restart;

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.
DS18B20 temperature sensors have a digital output, are connected in a three-wire circuit and operate using the 1-Wire protocol. The first sensor measures the temperature in the room (internal), the second - outside (external).

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)
2. Connect one DS18B20 sensor (room temperature measurement)
3. Holding down the button "UP", turn on the AC adapter. (the serial number of the sensor will be written to the memory of the MC, a beep will sound)
4. Turn off the AC adapter.
5. Turn off the sensor.
6. Connect another sensor (outside temperature measurement)
7. Holding down the button "DN", turn on the mains power supply (the serial number of the sensor will be written to the memory of the MK, an audible signal will sound)
8. Turn off the AC adapter
9. Connect both sensors
10. Power on

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.
The temperature is displayed on the indicator with a resolution of 0,1°C. The measurement takes place at intervals of 1 second.

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
HL2 (red) - low output voltage of the AC adapter or battery
HL3 (yellow) - a sign of a running timer
HL4 (red) - thermometer(s) errors
HL5 (yellow) - thermal control enabled

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.

Device photo

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;
• SUT1...0 =11 - Start-up time: 16K CK + 64 ms;
• CKOUT = 1 - Output Clock on CKOUT disabled;
• BODLEVEL = 1 - threshold level for the 2,7V supply voltage control circuit;
• BODEN = 0 power monitor enabled
• EESAVE = 0 - erasing EEPROM during chip programming is disabled;
• WDTON = 1 - No permanent activation of Watchdog Timer;

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.

User Guide (PDF, 500 KB)

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.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

mushroom exchange 22.06.2016

Trees redistribute the products of photosynthesis throughout the forest.

The fact that some plants are friends with each other, while others cannot stand the neighborhood, is known to many gardeners. What is the matter here, it is not clear; usually indicate the release of some volatile substances. Perhaps, in fact, you need to look at the root, which was done by researchers from the University of Basel, led by Professor Tamir Klein. They studied the redistribution of carbon between trees in a forest.

At the height of the crown of old - 120-year-old - firs, networks of thin tubules were stretched. Carbon dioxide, purified from the heavy isotope C13, was supplied through them, and using an atomic mass spectrometer, it was possible to trace the path of carbon after the plant had utilized it as a result of photosynthesis. This path turned out to be strange: soon enough, traces of such depleted carbon appeared in the roots not only of the experimental tree, but also of its neighbors, including birches, pines and larches.

The volume of carbon pumped was significant - up to 40% content in thin roots or 250 kg of interchange of substances per hectare of plantings per year. It is obvious that carbon did not travel by itself, but as part of some compounds. Only mushrooms could help him in this, the mycelium of which entangles the roots of plants. But each plant has its own companion mushrooms. This means that the forest community is an integral system, between the parts of which there is a very dynamic exchange of substances.

Other interesting news:

▪ The most powerful supercomputer center

▪ STSPIN233 - driver for low voltage BLDC motors

▪ amoeba in amber

▪ 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 How to connect a button and LEDs to one pin of the microcontroller. Encyclopedia of radio electronics and electrical engineering

▪ article Turkmen proverbs and sayings. Large selection

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024