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

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system. 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

Устройство "Universal device" (Universal Device) contains the functions of several devices that make life easier for people by automating the living space. Since the device is rapidly improving, it has its own USB bootloader, so to update the firmware, you just need to connect Universal device to the computer, turn on the self-programming mode and run the firmware update program on the PC. At the same time, there is no danger of blocking the device "forever", as is sometimes the case when updating the firmware of mobile phones.

1. Brief description of device features

Universal device has the following functions:

  • Time display in the format "hh - mm - ss" (the time is automatically synchronized with the computer to which the device is connected via USB).
  • 5 alarm clocks with the ability to connect an external, louder signaling device (for example, a horn). All alarm settings can be stored in the built-in non-volatile memory, which has up to 1000000 write / erase cycles.
  • 2 thermometers (-55С ... +125С) with 8-channel thermostat (thermostats are not autonomous).
  • Control of 8 loads (lamps, chandeliers, pumps, electric motors and other electrical appliances) using a remote control (RC) or a computer.

Also, the device is connected to a computer via a USB interface, while, in addition to the above functions, the following are available:

  • Setting alarms (time, day of the week, signal source, call duration).
  • Display of the current temperature of both thermometers on the monitor. Wherein. You can view a graph of temperature change since the start of the program.
  • Load management. Set auto on/off time for each channel, thermostat function control.
  • At the same time, using the Remote Control, you can control the following functions:
    • Manage Windows features.
    • Mouse control.
    • Virtual keystrokes.
    • Controlling the Winamp player.
  • Ability to display a large message on top of all windows, for example, when switching a track in Winamp. Thus, it is possible to see the current track at the insistence of the monitor even more than 5 meters away.
  • There are options for displaying the program in the system tray (near the clock) and autoloading the program (along with loading Windows).
2. Scheme

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system
Rice. 2.1. Diagram of the device (click to enlarge)

The basis of the device is the ATmega16 microcontroller, it operates at a frequency of 16 MHz. Its power can be from a USB port or an external power supply (power selection by jumper J9).

The device has 2 displays: character 16x2, and segment (2 pieces of 4 segments). Segment is designed to display time and temperature. Symbolic - for the convenience of managing some device functions, but it is not necessary to set it at all.

Chip IC6 is a ROM AT24C64 designed to save alarm settings, ROM addresses of temperature sensors and some other settings.

TSOP1738 (it is better to install TSOP1736) - IR signal receiver from the remote control.

USB - connector for connecting the device to a computer.

BUZZER - a signaling device for an alarm clock. Mandatory with a built-in generator.

IR-Led - infrared LED. In the alarm settings, you can select it as an alarm. What is it for? If, for example, there are several people in the room, but only you need to wake up in the morning, then you can assemble a simple IR signal receiver that will vibrate when infrared rays appear, and attach it to your hand, then in the morning the device will activate the IR transmitter and your device will vibrate , waking you up.

4 shift registers 74HC595. Designed to control LEDs, segment display and loads.

8 LEDs (LED1 - LED8) - see their purpose in the instructions for the program.

ULN2003 is a Darlington build. The microcircuit is designed to control loads, so each output (except the eighth one) can be connected to a load of up to 500mA.

IRFZ44N (I accidentally put another on the diagram) - a field-effect transistor, controls the eighth load.

IC5 is a 5V linear regulator. I HIGHLY recommend replacing it with a switching regulator (for example, R-78xx), then the efficiency of the device will increase greatly.

Download scheme in *.sch format (Open via EAGLE)

PCB in Sprint Layout 5 format.

Universal device on the microcontroller: clock, thermometer, thermostat, alarm clock, remote control system. Printed circuit board
Rice. 2.2. PCB

Download board in *.lay format (in order to see the value of the component, hover over the component you are interested in).

As segment displays I took KW4-563ASA as it is very bright and costs about $1. And as a connector for connecting an external temperature sensor - an audio jack.

Here's what happened:

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system. Finished device
Rice. 2.3. Device photo

  1. Large segment indicator. It alternately displays time and temperature (on the left is an external thermometer, on the right is an internal one).
  2. Indicators. The two extreme ones (No. 1 and No. 8) are constantly lit so that in the dark it would be easier to understand where which indicator is. No. 2 - reception of commands from the remote control is enabled. No. 3 - the command from the remote control is intended for the computer. #4 reserved. No. 5 - reading from ROM. No. 6 - recording from ROM. #7 lights up when the device is responding to a request from the PC.
  3. Character LCD contrast control.
  4. Signaling device for an alarm clock.
  5. Liquid crystal indicator (LCD).
  6. Device control buttons.
  7. Connector for external temperature sensor DS18B20.
  8. RESET button. It is used for flashing and simply for restarting the device.
  9.  Built-in temperature sensor DS18B20.
  10. USB connector for connecting to a computer.
  11. Infra - red LED. In the alarm settings, you can select it as an alarm.
  12. Remote control signal receiver.
  13. External power supply health indicator.
  14. Jumper to select the power source. When the middle and left contacts are closed, power is supplied from the USB port, the middle and right contacts are powered by an external power supply unit. PSU can be AC ​​or DC voltage 8-20 V.
  15. Connecting an external power supply.
  16. Connecting loads. As you can see in the figure, on the right are the contacts for connecting 8 loads. The four VCC pins are common and connected together. The remaining contacts (O1 - O8) are the keys that turn on / off the loads. If, for example, you want to connect a horn, then "+" must be connected to VCC and "-" to one of the outputs (O1-O8).
3.Remote control

For a very long time I went shopping and the bazaar to find the most suitable remote control, there were different remote controls in different stores, but one remote control was in all the stores I visited. It will not be difficult for you to purchase this remote control, since it is very common and its cost is no more than $ 3. Here is his photo:

Universal device on the microcontroller: clock, thermometer, thermostat, alarm clock, remote control system. remote control
Rice. 3.1. Remote control

The remote control has 35 buttons. Red (Pon) turns on / off the command reception mode. If the second LED is NOT lit on the device, the device will only respond to the Pon button (red at the bottom). If the second LED is on, but the third one is off, then the commands will be processed by the device. The green button turns on / off the command receiving mode for the computer (when turned on, the third LED lights up).

4. Device management

This subsection will tell you how to control the device (you need to have the second LED on and NOT the third one).

Remote control button functions

In device control mode, 5 buttons are used for control:

  • BTN_MUTE - turn off the alarm signal.
  • BTN_0 … BTN9 - enable/disable the corresponding load.
  • BTN_TXT - Confirm menu item selection.
  • BTN_ChUp - Next menu item.
  • BTN_ChDown - Previous menu item.
  • BTN_VolInc - Next menu item.
  • BTN_VolDec - The previous menu item.
  • Pon - Disable receiving commands from the remote control.
  • Pst - enable/disable receiving commands for the computer.
Menu

The device menu is still underdeveloped, but will be developed in future firmware versions. Now it has only 2 points and several sub-points.

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system. Menu
Rice. 4.1. Device menu

In the first menu item (Alarms), you can view the schedule of alarm calls (there are 5 of them). If in subparagraphs "Alarm 1" - "Alarm 5" press BTN_TXT then the alarm will turn on or turn off. In subparagraphs "load timing" и "Save timing" you can save or load alarm settings from ROM.

In the second menu item, you can format the ROM chip. ATTENTION: after formatting, be sure to disconnect the external temperature sensor and press the RESET button, after that the device will determine the address of the internal temperature sensor and the display will show "Reset Device", press the RESET button, connect the external temperature sensor and press the RESET button again.

Also on the device in the lower left corner there are 4 buttons for moving through the menu items.

5. Communication with a computer. Working with the program "UD Control connection

"Universal device" has the ability to connect to a computer. A program has been created specifically for working with the device. "UD Control", this manual will describe how to work with version 1.0.2.2 of the program. The program runs on operating systems Windows Home Edition and higher (including Windows 7 and Windows Vista).

To install the program, run the UDC_Setup.exe file and specify the folder (C:\Program Files\Universal Device\UD Control by default). After that, connect the device to the PC, Windows will find new hardware and ask for drivers, specify the folder with the driver (c:\Program Files\Universal Device\UD Control\windows-driver\ ). After successfully installing the driver, run the program "UD Control" from desktop. If "Device not connected" is written in the lower left corner of the program, then check the reliability of the USB cable connection and the correct installation of the drivers, it is also advisable to restart the PC.

UD Control

Program UD Control created by the author of this project (that is, me). For convenience, it has several tabs to quickly navigate. The program settings are stored in the system registry.

When you first run the program, it may show an error warning, just click OK and restart the program.

This article will describe how to work with version 1.0.2.2 of the program.

Setting

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system
Rice. 5.1. Settings tab

Polling frequency. The delay with which the program polls the device. The recommended value is 50 ms.

Show big message. When switching tracks in Winamp or selecting a managed program, a large message appears on the monitor with two lines.

Update device firmware. Firmware of the device, if at the start of the program a message appears about the incompatibility of the current version of the program with the current version of the firmware, then click this button and follow the further instructions of the program. Thus, the device firmware will be updated to the latest firmware supported by the current version of the program.

The functions that are located in the third frame, I think, are clear to everyone.

Alarm clock

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system
Rice. 5.2. Alarm tab

Timing. The duration of the call signal.

repetition. Signal and pause length.

Source. You can choose the built-in buzzer, IR LED or any of the eight outputs to which the alarm is connected as an alarm.

Set the alarm parameters, then click "Record" and the call schedule will be transferred to the device, if you check the box next to "Record to ROM", then the schedule will be saved to the ROM (non-volatile memory) of the device.

Temperature

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system
Rice. 5.3. Temperature tab

On this tab, you can see the temperature of both thermal sensors, on the left - external, on the right - internal. Below is a temperature graph. Every minute the graph is updated and the number below increases by 1.

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control systemUniversal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system

If you move the cursor to the temperature mark, a window will appear in which the time and date of the program start, the minimum and maximum temperatures on the selected temperature sensor and the time + date when it was recorded are written.

The names of the sensors (those that are now Inside and Outside) can be changed. To do this, click on the temperature mark, a window will pop up with an input form, enter a new name in it and click OK.

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system

Load management

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system
Rice. 5.3. Loads tab

Loads can be controlled not only with the remote control, but also with the help of a computer (when connected to a computer, loads can also be controlled from the remote control).

Buttons for controlling loads are placed on top, if a green marker is near the button - the output is active, red - is not active. To turn on / off the load, you just need to press the appropriate button. The button for each load can be renamed, to do this, click on the corresponding button, before that, holding down the left "Shift", the same window will appear as when renaming the temperature mark.

Automatic load management

The PC program is able to independently manage loads, that is, in automatic mode. For each load, you can set your own control method, the program has 4 algorithms:

  • Manual - normal control with remote control or program buttons.
  • By time - management of loads based on the time values ​​specified by the user.
  • By Inside temperature - load control based on the temperature values ​​of the internal temperature sensor set by the user.
  • By Outside temperature - load control based on the temperature values ​​of the internal temperature sensor set by the user.

You also need to set the control condition, the program has six conditions:

  1. Within Value 1 and Value 2 - The load is turned on when the current temperature or time is between Value 1 and Value 2. With a temporary method, it can be used, for example, when you need to turn on an electrical appliance at a certain time and then turn it off. For example, Value 1 = 7:30:00, Value 2 = 7:35:00, as a load - an electric kettle, in this case, when you are still sleeping, it will turn on, heat the water and turn off.
  2. Outside Value 1 and Value 2 - Similar to the first case, only the load is turned on within Value 1 and Value 2.
  3. Higher than Value 1.
  4. Lower than Value 1.
  5. Turn on above Value 1, turn off below Value 2.
  6. Turn on below Value 1, turn off above Value 2 - If you have an electric heater that does not have a thermostat function, you can add this function to it using universal device. Connect this heater as one of the loads. Select control method "By Inside Temperature", Value 1 = 25, Value 2 = 30. And press "Save". Now, when the temperature in the room falls below 25C, the heater will turn on and heat the temperature in the room to 30C, after which the heater will turn itself off. And all this is done automatically, without your participation, you just need to set the desired algorithm, and Universal Device take care of it yourself!

Attention! In order to control a more powerful load than 500mA, you need to assemble a key on a triac, thyristor or electromagnetic relay.

Here is the relay diagram:

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system. KeyUniversal device on the microcontroller: clock, thermometer, thermostat, alarm clock, remote control system. Printed circuit board

PCB for relay 943-1C-xD in *.lay

Universal device on the microcontroller: clock, thermometer, thermostat, alarm clock, remote control system. Board with two relays
Rice. 5.4. Board with two relays

Remote control (RC)

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system
Rice. 5.5. "Remote" tab

The remote control can control many computer functions. On the right is a listing with accepted commands, a little lower is the last accepted command, even if it is not intended for a computer!
The remote control can control the following functions:

  • MS Windows commands - Turn on, turn off, open CD-ROM, etc.
  • Manipulator Mouse - move the cursor, press buttons. You can choose the speed of movement and acceleration. For convenience, it is possible to simulate a double click of the mouse button.
  • Keyboard - Pressing keyboard keys with the joystick.
  • Winamp - Management of the most popular player.

And another very nice feature. UD Control - displaying a large message.
For each item there is a plate in which you need to set the values ​​of the buttons.
In order to choose what we will control from the remote control, you need to press the BTN_MENU button on the remote control. After that, a large message will appear on the screen:

Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system

After that, you need to press the number button on the remote to select the application:

  1. Windows

  2. Mouse

  3. Keyboard

  4. Winamp

After that, the same message will appear, only the bottom line will be "Winamp selected".
Now, when you click the Winamp open button, Winamp will open accordingly. If you press a button on the remote control that sends the Play command according to the table in the program, then a large message will appear and, if it does not fit in the area allocated for it, it scrolls (like a creeping line):
Universal device on a microcontroller: clock, thermometer, thermostat, alarm clock, remote control system

The message is scrolling

Download the file with the installation archive UD Control 1.0.2.2.

Download the archive with help for working with the device in *.chm.

Completion

I will support the project, so the UD Control program, and accordingly, the firmware of the device will improve, all updates will be available on the website unidev.ho.ua/.

For a flashed microcontroller (in the future, the device, as mentioned above, can be flashed directly from the program), as well as for all questions related to the device (including the purchase of a finished device), please contact the email: univdevice {dog} ya.ru (replace "{dog}" with @) .

Attention! The author of the project accepts orders for the development of devices on microcontrollers, for development, please contact devices2000 {dog} ya.ru.

Author: Brazhnikov Mikhail; Publication: cxem.net

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

SAA6734AHL - controller for liquid crystal displays 28.03.2004

PHILIPS SEMICONDUCTOR announced the release of the SAA6734AHL controller for thin film transistor liquid crystal displays (TFT LCD).

The controller is designed for display resolutions up to UXGA (1600x1200 pixels) and supports pixel switching frequency up to 165 MHz.

Other interesting news:

▪ Emotions differ by complexion

▪ A new way to chemically convert plastic into fuel

▪ Healthy sleep eliminates sugar cravings

▪ Honor Earbuds 3i Wireless Headphones

▪ 500 terabits per square inch

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Measuring equipment. Article selection

▪ article England has no eternal allies and permanent enemies - her interests are eternal and constant. Popular expression

▪ article How does a turtle breathe underwater? Detailed answer

▪ article Office cleaner. Job description

▪ article Antenna QUAD for three bands. Encyclopedia of radio electronics and electrical engineering

▪ article Transformation of three cards. Focus secret

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