
Surely everyone heard about the technology of "smart home". One of the most popular applications of this technology in automatic lighting is, for example, turning on and off lights when people enter or leave the premises. In this article I would like to show that there is nothing supernatural in this, and anyone can realize this opportunity. So, we will try to connect a motion sensor to an ordinary Ilyich lamp in the corridor, and make the lighting work depending on the presence of people in the room.
The LX-01 sensor, produced in the Middle Kingdom, was chosen as a motion sensor. The principle of its operation is quite simple - when a motion is detected in a given area, the sensor closes the circuit, thereby switching on electrical appliances connected to the sensor. As soon as movement in the surveillance zone stops, the sensor opens the circuit, turning off the connected devices. The sensor can be configured using 3 regulators, which are located on its body. The first controller is responsible for the sensitivity of the sensor. At maximum sensitivity, the sensor will operate at the slightest movement, at minimum - only at very noticeable. The second controller sets the time during which the sensor “holds” the circuit after the last motion detection. That is, as soon as the movement in the room has ceased, the sensor will not immediately turn off the light, but wait for the prescribed time. The last control is responsible for the level of illumination at which the sensor will work. After all, it makes no sense to turn on the light on the motion sensor, if the room is already light.
The described motion sensor is not one of a kind. Now there are many motion sensors, different in appearance and functions. When choosing a motion sensor, you need to be clear about where and why you plan to install it. For example, I bought the specified motion sensor specifically for installation in the corridor, where all people only pass from one room to another, without lingering for a long time. But for example in the bathroom such a motion sensor would not fit. Why? Because he reacts only to movement. Therefore, if you lie in a bath with a bunch of foam while listening to music, then you will do it in the dark - there is no movement. So, choose a room thoroughly.
After selecting the model of the motion sensor and the room for installation, you must also find a good location for the sensor. The sensor must respond to all movements in the room, and at the same time it should not operate falsely. Therefore, you need to take into account the layout of the room - doors, windows, ways of movement of people, large furniture - all this affects the choice of place for installation. My corridor has the following layout:
')

The plan shows that there are 4 doors in the corridor and no windows. By the way, the absence of windows is more likely a plus than a minus - because at the same time the motion sensor will not have to be adjusted to different levels of illumination in the room, since we know that the room is always dark. The presence of doors on each side of the corridor makes it difficult to choose the place of installation. If you have a free wall, then the sensor should be attached to one of its corners. Why is it necessary in the corner of the room? Because this sensor has an overview of 120 degrees. If you put it in the middle of the wall, then its corners will fall into the dead zone, which is not good. Given all these parameters, we get the following sensor layout:

The connection diagram of the sensor to the electrical network is presented in the instructions for the sensor. It looks like this:

The experiments I carried out showed that it is impossible to connect wires differently than on the diagram it is impossible - a sensor with a characteristic cotton fails :)
When installing the sensor, it was decided to slightly complicate the circuit by adding a control switch to it, which in the open state would not interfere with the motion sensor, and in the closed state would turn on the light regardless of the sensor. You can think of a few examples when the lighting in the room is necessary even when there is no one in it, but this is not the point. Therefore, it was decided to connect a conventional light switch to the motion sensor. In this scheme will take the following form:

Now you need to ring all the wires and connect the motion sensor to the mains. Take the tester and call each contact. The wire passing from the switch to the lamp is connected to the red contact of the sensor. The brown sensor contact is connected to the wire located on the other side of the switch. Now we take the wire that matches the lighting fixture not from the side of the lamp and connect it to the blue wire of the sensor.
Important! When working with electrical wiring, observe all safety measures. Turn off the power supply to the apartment, arm yourself with rubber gloves. At the end of the work carefully inspect the wires, insulate all exposed areas.
When you finish connecting the sensor, it remains only to attach it to the wall in the selected location. It is necessary to fix the sensor almost immediately under the ceiling, so that the review was better. Then you need to check the operation of the sensor - enter the room, the light should turn on. Then exit the room, estimate the interval before turning off the sensor. If the sensor did not work, then perhaps you made a mistake in the installation. If it does not always work, try changing its settings - for example, set the sensitivity to maximum. Time to turn off, I recommend to put about 6-10 seconds.
