📜 ⬆️ ⬇️

Obvious: automatic control of bathroom lighting

Periodically, reading articles on smart home, I come across a description of the inconvenience brought by the automation of lighting in the premises.
I also ordered a motion sensor, temperature and humidity. Hanged in the bathroom and made a cool automation: the light in the toilet automatically turns off after 15 minutes, if you forget to turn it off, and the light in the bathroom turns on at the entrance, according to the motion sensor, and turns off after 15 minutes. Everything is cool, except that it is impossible to live with it. It turned out that 15 minutes in the toilet is actually not enough, especially if Wi-Fi is well caught there. And he is caught well. The increase in the waiting period did not help, so I have turned off this automation and ordered another motion sensor.

Without pretending to exclusivity (and even suspecting that everything that has been said is obvious), I’ll tell you about my own implementation of this task.

1. Pyroelectric infrared motion sensor


PIR

The sensor, I think, is familiar to everyone, it does not make sense to talk about the features. I have it hidden under ceramic tiles, only Fresnel's lens comes out.

This sensor can be used both by itself and with the smart home controller.

Work algorithm:
')

Minuses:


2. Magnetic door opener sensor


PIR

Classic reed switch. We hang on the door and can use.

Use options:


Minuses:


3. Both sensors together


So, let's try to combine the advantages of both sensors. We will monitor their sensors and memorize the response time.

In addition, let us single out for ourselves three modes of system operation:


The algorithm works as follows:


That's all! The logic is very simple - a person entering the bathroom and closing the door behind him will precisely fall under the motion sensor for at least a couple of seconds. After that, he can hide behind a curtain or sit still - it does not matter, the system has already counted it, the light will be on until the door opens again (or rather, another 15 seconds after that and the end of any movement).

Source: https://habr.com/ru/post/401079/


All Articles