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

An improved version of the control system software. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Radio amateur designer

Comments on the article Comments on the article

The changes and additions that the author of the article made to the software of the "amateur" smart home control system described by him in [L] are described.

First of all, bugs affecting the stability of the ihsc.exe module have been fixed. To increase the stability of the entire system, a controlling process (module ihsc_guard.exe) was created, which starts working automatically when ihsc.exe is launched. If the main module fails, it will automatically restart.

In the new version of the software, the web server has learned to accept information from the browser. The "action" attribute of the web form must contain a script that will be passed to the server and executed when the screen button on the html page is clicked. Access to the system via the Internet is made using an android smartphone with the Mozilla Firefox browser.

The microcontroller program for UD universal devices has also been updated. The changes affected the system component "Single output control line". Now this component can have a sensor that controls the actual supply of voltage to the load, which can be assembled, for example, according to the circuit shown in the figure. With it, you can control the health of the power part of the device or the fusible link. When creating a device configuration, the value of the "Voltage sensor: Anti-bounce 0,1 s * per..." field for this sensor must be set to 30 (3 s) to avoid false alarms.

Advanced version of the control system software
Fig 1. Sensor circuit

An exit statement has been added to the scripting language, which stops the execution of the current script.

I will give an example of how you can expand the capabilities of device No. 12 described in [L] by changing the set of scripts. It can be loaded into a working device by opening the menu item "Tools→Script Editor..." on the graphical terminal.

Let's teach device No. 12 to turn on the lamp if the motion sensor is triggered within a minute after it was automatically turned off. This will make it possible to turn on the lighting again, for example, by waving his hand, if before that he had not been noticed by a motion sensor for more than 15 minutes, which turned off the lighting, considering that there was no one in the room. A set of scripts that solve this problem is given in Table. 1.

Table 1

Advanced version of the control system software

I note that it is not necessary to check the current state of the motion sensor. Usually, the pulse of this sensor lasts only a few seconds - any difference in its level is taken as the presence of movement.

Consider two more examples using a motion sensor. Suppose there are two doors installed at the entrance to the house - external and internal. They are located at a short distance from one another, so when entering or leaving the house there is a period of time during which both doors are open at the same time. A street lamp is installed above the outer door. Ceiling lights are installed in the hallway, controlled by some device No. 4.

It is necessary to make sure that in the dark, when leaving the house, a street lamp is turned on for several minutes, and when entering the house, the lighting in the hallway is turned on. This task is solved by a set of scripts given in Table. 2.

Table 2

Advanced version of the control system software

Device No. 10, a home weather station equipped with a light sensor, owns information about the current illumination. The illumination thresholds at which you need to turn on or off the lamps will be different for the street and the hallway, since the natural illumination inside the room is always lower than outside.

Ordinary luminaires with built-in motion sensors are unsuitable in this case, because the configuration of the room and the possible locations of the luminaires do not allow their sensors to work when the door is opened. Because of this, discomfort arises: the first step has to be taken in the dark, only after that the motion sensor will turn on the light. And you need to ensure that it turns on even when the door is opened.

We will assign the number 3 to the created device. We will connect two reed switches to it - these are open door sensors (outer and inner), hidden inside the door frame. Let's add a call button. The device will be controlled by an external lamp and a bell.

The step variable is set to 1 when the device assumes the person is leaving the house, or 2 when the person enters the house.

The variable still is intended to block the automatic switching on of lighting. For example, if you want to look out the window at dusk or not open the door to unwanted guests.

The dark variable contains the ambient light level expressed in conventional units. The higher it is, the lower the value of this variable. Since the necessary illumination threshold is chosen experimentally, there is no need to express it in standard units. The sensor itself is a photoresistor connected to the ADC.

2 minutes after the device is started, the dark variable is assigned the value of the current illumination level received from device No. 10 (weather station). In the future, the value of this variable is updated every 15 minutes. Local storage of a slowly changing parameter allows you to speed up the execution of the script, since you do not have to waste time every time polling a neighboring device. And a two-minute delay is needed so that the weather station has time to measure the illumination, if power is supplied to all devices of the system at the same time.

Script 1 is executed by the device when the state of the reed switches of the outer and inner doors changes. The direction of movement is determined based on which door is open first. The disadvantage of this method is that if the door is forgotten to close, then the decision will be wrong and the lighting will not turn on automatically.

Script 2 is executed by the device when the call button is pressed.

In conclusion, consider the task of automating lighting in a bathroom, toilet or other utility room. A set of scripts for solving it is given in Table. 3. For the reasons described above, motion sensors alone could not be dispensed with. It was also necessary to install open door sensors.

Table 3

Advanced version of the control system software

The variable t takes on the value 0 if the door to the room is closed and no one is there; value 1 - if the door is opened and a person enters the room; value 2 - if he entered the room and closed the door behind him; value 3 - if the door opens and the person leaves the room.

The algorithm works correctly if the entire cycle is performed without errors, i.e. the door is not forgotten to be opened and closed. If the person leaves the room and the lights are off after 6 minutes, the variable t will remain equal to 3 in anticipation that the door will be closed. If after some time a person enters the open door, the motion sensor will work, and the required value of 1 will be assigned to the variable t.

You can improve this algorithm by resetting the variable t if no movement was detected in the room for several minutes after the door was closed. This will restore normal operation of the device after a person leaves the door open when entering the room, and after a while leaves and closes the door behind him.

Thanks to the open door sensor, the lighting turns on immediately when the door is opened. But since the motion sensor only responds to the presence of a person inside the room, the lighting does not turn on when passing by the door, if for some reason it is left open.

When using standard fixtures with built-in motion sensors, this effect could not be achieved. Especially in the bathroom and toilet. The fact is that it is very difficult to set the optimal duration of the lamp. If it is too small, a person has to constantly move in order to prolong his work, and if it is too large, then after leaving the room, the lighting remains useless for a long time.

To check scripts for syntax errors when loading into the controller, you can use the built-in script editor in the graphical terminal ("Tools→Script Editor..."). It must be remembered that variables are created the first time they are used in an assignment statement. Therefore, before checking the operation of a conditional statement, which contains variables, they must be created.And when using the values ​​of the parameters of the system components of neighboring devices, the program will prompt you to enter the value manually, simulating sending a request and receiving the value of the desired parameter.

The program also has features that have not yet been used in practice, but are available for testing:

- the ability to run a third-party application for sound synthesis. To do this, in the field where you previously indicated the name of the wav file to play, you need to enter a command line that launches a third-party application;
- The TCP server provides access to messages exchanged between devices over the system bus. You can select a port in the menu item "Service→Settings". When connecting to the TCP server, the Administrator password will be requested (default 1234).

The modified software can be downloaded from ftp://ftp.radio.ru/pub/2017/02/ihsc.zip.

Literature

  1. Antonov M. "Amateur" control system "smart home". - Radio, 2016, No. 6, p. 31-35; No. 7, p. 33-37.

Author: M. Antonov

See other articles Section Radio amateur designer.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

A New Way to Control and Manipulate Optical Signals 05.05.2024

The modern world of science and technology is developing rapidly, and every day new methods and technologies appear that open up new prospects for us in various fields. One such innovation is the development by German scientists of a new way to control optical signals, which could lead to significant progress in the field of photonics. Recent research has allowed German scientists to create a tunable waveplate inside a fused silica waveguide. This method, based on the use of a liquid crystal layer, allows one to effectively change the polarization of light passing through a waveguide. This technological breakthrough opens up new prospects for the development of compact and efficient photonic devices capable of processing large volumes of data. The electro-optical control of polarization provided by the new method could provide the basis for a new class of integrated photonic devices. This opens up great opportunities for ... >>

Primium Seneca keyboard 05.05.2024

Keyboards are an integral part of our daily computer work. However, one of the main problems that users face is noise, especially in the case of premium models. But with the new Seneca keyboard from Norbauer & Co, that may change. Seneca is not just a keyboard, it is the result of five years of development work to create the ideal device. Every aspect of this keyboard, from acoustic properties to mechanical characteristics, has been carefully considered and balanced. One of the key features of Seneca is its silent stabilizers, which solve the noise problem common to many keyboards. In addition, the keyboard supports various key widths, making it convenient for any user. Although Seneca is not yet available for purchase, it is scheduled for release in late summer. Norbauer & Co's Seneca represents new standards in keyboard design. Her ... >>

The world's tallest astronomical observatory opened 04.05.2024

Exploring space and its mysteries is a task that attracts the attention of astronomers from all over the world. In the fresh air of the high mountains, far from city light pollution, the stars and planets reveal their secrets with greater clarity. A new page is opening in the history of astronomy with the opening of the world's highest astronomical observatory - the Atacama Observatory of the University of Tokyo. The Atacama Observatory, located at an altitude of 5640 meters above sea level, opens up new opportunities for astronomers in the study of space. This site has become the highest location for a ground-based telescope, providing researchers with a unique tool for studying infrared waves in the Universe. Although the high altitude location provides clearer skies and less interference from the atmosphere, building an observatory on a high mountain poses enormous difficulties and challenges. However, despite the difficulties, the new observatory opens up broad research prospects for astronomers. ... >>

Random news from the Archive

Quantum radio receiver will pick up the weakest signals 24.03.2019

Weak radio signals aren't just a problem for people trying to tune in to their favorite radio station, it affects magnetic resonance imaging technologies used in medicine, radio telescopes peering into the depths of the universe, and more. In all such cases, it is impossible, after suffering for some time, to tune in to another radio station, as in the first option, therefore, special amplifiers are used to amplify weak signals, the capabilities of which are limited by the magnitude of their own noise and which amplify these noises as well as a useful signal. But recently, researchers at Delft University of Technology, the Netherlands, have created a new type of radio receiver that uses the laws of quantum mechanics. In addition to the practical application of this receiver to receive the weakest signals, the principles used in it can shed light on the interactions between quantum mechanics and gravitational forces.

One of the tenets of quantum mechanics used in the new receiver is that energy can be transferred in tiny fixed "doses" called quanta. "Imagine that you are swinging a child on a swing," says Mario Gely, lead researcher, "From the point of view of classical physics, if I want to give the child more speed and swing amplitude, I will have to give them a push that Quantum mechanics says something else - I can only increase the child's energy by one "quantum step" at a time, transferring energy to him in the amount of half a quantum or another fractional part is fundamentally impossible.

In real life, these quantum "doses" of energy are so small that they will not have any tangible effect on a child on a swing. And until recently, such a statement was considered true in relation to radio waves. However, a new receiver can "feel" these tiny particles of energy in radio frequency signals, allowing it to receive radio waves at the quantum level.

The new receiver exhibits some unusual effects related to quantum mechanics and concepts such as mass and gravity. The theory of quantum magnetism was developed almost 100 years ago, but physicists are still puzzled by the problem of combining quantum mechanics and the concept of gravity.

Other interesting news:

▪ Dog 31000 years old

▪ How the brain understands grammar

▪ WD Passport Pocket external hard drive

▪ Before the event, envy is stronger

▪ Transparent memory chip

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Data transfer. Article selection

▪ article Thermal power plant. History of invention and production

▪ article What physical law helped to convict speculators of illegal insider trading? Detailed answer

▪ article Working with an odorant. Standard instruction on labor protection

▪ article Protection device for the headlight cleaner from burnout. Encyclopedia of radio electronics and electrical engineering

▪ article Grounding and electrical safety protective measures. Protective measures for indirect contact. Encyclopedia of radio electronics and electrical engineering

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