📜 ⬆️ ⬇️

"Smart toilet" in a regular apartment



Every year our homes are becoming more and more electrical appliances. Almost everyone now has TVs, refrigerators, washing machines, media centers and DVD (Blue Ray) players, dishwashers and kitchen combines, microwave ovens, electric kettles and multicookers, air conditioners and humidifiers, and much, much more that we don’t we want to refuse. Electricity consumption is growing and at the end of the month quite an impressive amount is accumulating. Willy-nilly, you have to think about how to reduce these costs.

Not spared this problem and me. Due to decent electricity bills at the family council, it was decided to get rid of the electric kettle as one of the most powerful electrical appliances, especially since the kitchen has a gas stove. The household refused to reduce the amount of the rest of the electrical engineering. I had to look for other ways to save electricity. The first step was to replace all the lamps in the house with LEDs. The second step was to be the control that the electric and lighting devices did not remain on for a long time, when no one uses them. After analyzing, I identified two sources of electricity consumption that need to be limited: the burning light and the TV in the kitchen, included in the absence of people there and the light in the toilet, which the children (and me) forget to turn off.

I decided to deal with the kitchen later. First, it is more controlled. And the burning light and the working TV is audible and visible, the main thing is not to be lazy to go on and off. Secondly, I already have a system plan for the Arduino, several motion sensors and an IR transmitter. It remains only to find the time to implement it.
')
But the light burning in the toilet, is not visible from the room and corridor. Therefore, it can burn there all day, especially when no one is at home. Although, to be honest, the problem of turning off the light and saving energy in this case was not the main one for me. Since there are small children in the family, they are primarily inconvenient because they do not reach the switch and cannot turn on the light for themselves. They have to call someone from the adults, distracting from cases, or drag the chair out of the kitchen and climb on it. Needless to say, most often the light remains on in both cases even after the child has left the toilet room (he is in a hurry, he has affairs: cartoons, toys, an unfinished poem ...). To be honest, I sometimes do not turn off the light due to distraction. Add a second switch lower, especially for children, of course, possible. And I would do that if the street were the 60s of the XX century. In the XXI century I want to have more elegant and technological solutions.

The ideal solution would be to put a presence sensor. But these sensors are unnecessarily expensive, they are not so easy to find on sale. From the budget decisions only to put an infrared motion sensor with a shutdown delay.
I decided to implement this option. The only doubt was caused by the fact that these sensors often have low sensitivity and if you make the delay time small, the light will periodically go out, forcing the person in the room to periodically make movements and annoy. Immediately in my head came the option of building a system on the Arduino with several PIR sensors located in different places, the signal from which would be summed up, thereby increasing the sensitivity, but then I dropped the idea. Is it worth it to “fuss” a garden for the sake of solving such a simple task, especially since the apartment has recently been renovated, which I barely survived, the toilet walls are covered with tiles and any options with otkovyrivaniem tiles, walling and new repairs are dismissed immediately. The only place where my sensors can be located is the suspended ceiling and the back false wall, which somewhat narrows the possibilities.

Rummaging in the bins, I found myself in 4 types of PIR - sensors.

Sensor number 1:

image

The sensor consists of two parts. The PIR sensor and the light sensor are placed in a separate unit.

image



Features of this sensor:

• control board and pir-sensor are located in separate housings;
• pir-sensor is attached to the board with a cable with a connector, which facilitates installation and repair;
• the sensor works both on and off, i.e. he is able both to turn on the load when a person appears, and to turn it off;
• the load is switched on via the relay;
• there is a photocell that prevents the sensor from tripping when the illumination level is higher than the set one, the trigger level is set by the resistor on the board and is not adjustable;
• when a sensor is connected, if the lighting level is higher than the set one, the sensor signals that it is in good condition by triple switching the load off and on;

Advantages:
• small and inconspicuous sensor that is easy to fit into any design;
• there is no heating of the control element;
• work both on and off.
• The on-load time is reset every time a motion is detected.

Disadvantages:
• low sensitivity of the sensor due to the design of the Fresnel lens. This lens forms a small number of rays, most of which are located in one plane;
• there is no simple control of the load on time, which is defined by one of the resistors on the control board.
• the relay clicks loudly enough that it is not suitable for use to control the light in the apartment.
• even though the sensor is placed on a separate board and in a separate case, the control board must still be somewhere close to avoid interference when using a long cable, which eliminates the possibility of hidden placement of the sensor on the wall. The only possible application is the installation of suspended ceilings or false walls.

Sensor number 2:

image

Features of this sensor:
• control board and pir-sensor are located in one case;
• the case is “technological” and more suitable for use in non-residential premises;
• obligatory connection of “phase” and “zero” is required;

Advantages:
• silent operation of a solid-state power element (triac);
• The Fresnel lens has a different structure and forms a larger number of rays evenly distributed in the hemisphere, which ensures greater sensitivity of the sensor and a more stable response.
• The on-load time is reset every time a motion is detected.

Disadvantages:
• there are no simple adjustments to the level of illumination at which the sensor is triggered and the time the load is switched on.

Sensor number 3:

image











Features of this sensor:
• The sensor is designed to be used as a substitute for a conventional wall switch, so it is designed to be placed in a standard junction box;
• the sensor is included in the open circuit and does not require the obligatory connection of the "phase" and "zero";
• the load is switched on through a triac.
• there is a photocell that prevents the sensor from tripping when the illumination level is higher than the preset one; the triggering level is adjusted by the trimming resistor.

Advantages:
• easily replaces the standard switch;
• no obligatory connection of “phase” and “zero” is required;
• silent operation of a solid-state power element (triac);
• The Fresnel lens has a more complex (faceted) structure and forms a larger number of rays evenly distributed in the hemisphere, which ensures greater sensitivity of the sensor and more stable response.
• there are adjustments to the level of illumination at which the sensor is triggered and the load on time.
• The on-load time is reset every time a motion is detected.

Disadvantages:
• installation only in an installation box (of course, installation in a false ceiling is possible, but in this case it will be necessary to cut too large a hole);

I liked this sensor the most, I tried on where I cut a hole in the false ceiling. But something was holding me back, there was no certainty that with the ceiling placement there would be a stable response, especially when a child appeared, and that the sensor would not turn off the light in time without feeling small movements of a person who is in relative calm. As it turned out, I knowingly delayed with cutting a hole in the ceiling.
Some time later, another sensor came to me, which I liked the most, and with which the implementation of the task became easier, more reliable, and more qualitatively functional.

Sensor number 4:



Features of this sensor:
• The wireless sensor is designed to control the power units of the nooLite system (I just recently bought such a set from the unit and a switch to make control of the light from the desktop in the room. Well, the room will wait. I will use the control unit from the kit for this project, and then, if everything works out, I will purchase another control unit, since they are of the same system and are compatible with each other);
• power units include the load through the solid-state element (triac), and therefore silent;
• sensor power supply from two AAA elements for at least a year
• range of up to 50 m (depending on the medium of the signal).

Advantages:
• The sensor is flat and light, you can attach it with screws, or with double-sided tape.
• The sensor is wireless, so it can be fixed anywhere and, if necessary, moved to another location.
• the sensor has an adjustable threshold of sensitivity, light, time off;

Disadvantages:
• Powered by batteries (the manufacturer promises at least a year of work on one set).

A few more photos of this sensor:



On the reverse side there are three trimming resistors that regulate the sensitivity, the level of illumination at which the sensor ceases to operate and the time the load switches on when triggered. Everything is simple and intuitive: the arrows in the directions "+" and "-".
Here is the button “linking / unlinking”, with the help of which the sensor is “attached” to the power unit, which it will control. The power block also has a “bind / unlink” button. Up to 37 control panels, keyfobs, sensors and other control devices of the nooLite system can be connected to the power unit.



The sensor device resembles a standard circuit breaker.



Inside, we see a control board, an antenna, and two spaces for AAA elements.

And now, finally, I proceed to the installation. First of all, before starting to disassemble the ceiling, I decided to attach the sensor and the power unit and check how this system will work and at the same time find the location of the sensor and the load off (lighting) delay time. On the table it is more convenient to do this than standing on a stepladder.

Therefore, a test bench was assembled, which simply plugged into the outlet.



It was decided to temporarily fix the sensor using small squares of double-sided tape so that it was easy to unstick and move it during the experiments.



Since in this case there are no restrictions on the location of the sensor, at first I fixed it to the back false wall directly opposite the door, directly above the toilet bowl. Experiments have shown that with this arrangement, the sensor responds completely to the appearance inside the room of a person (child) almost without delay. Since the sensor is located close, most likely the person simultaneously crosses a lot (or even all) of the rays generated by the Fresnel lens and reacts even to the slightest movement, resetting the load off time timer. After several experiments with different delay times, I set the time for 40 seconds from the principle of reasonable sufficiency, this was quite enough so that the light did not turn off while in the person’s room (after 3 weeks of use, the light never turned off early) and enough for the time of burning light after a person leaves the room.

After experiments on the stand, I proceeded directly to the installation.



The bulb is screwed into a ceiling-mounted luminaire. To gain access to this lamp it is necessary to partially disassemble the ceiling.



The control unit was still attached to the sensor on the stand. I connect its outputs directly to the luminaire contacts. The inputs will be supplied with a mains voltage of 220V.



On the control unit there are mounting ears. On the lamp a special mounting plate with two screws. This makes it possible to fix the power unit directly on the ceiling light housing.

Good thing I had to climb to the ceiling. Jumshuts from the Belarusian regional center, who did the repairs in the toilet, nakosyachili, where possible. Wiring is no exception. With the wires connected to the lamp, the insulation was partially cut off and exposed wires hung from the ceiling. It is good that I noticed it in time and did not have a short circuit.



The wire under the suspended ceiling is quite long, so you can connect the lamp directly standing on the floor. By the way, the temporarily stuck sensor is visible from behind.



In order to put the lamp in place, the power unit had to be unscrewed, otherwise the assembled structure did not penetrate into the hole in the false ceiling.



After the lamp is installed, the power unit takes its place.
Before final assembly of the ceiling, I check everything for operability. And here I have a problem. The light for some reason is lit and does not turn off. I thought that when connected burned a triac in the power unit. Understanding came later: I turned off the power unit several times, and in fact he remembers the state when disconnected. The state change (on / off) occurs only by a command from the control panel or, in my case, a sensor. If at the moment when the sensor gave the shutdown command, the block was turned off, then the control unit, when connected to the network, retained the state it was in when disconnected, that is, it connects the load and waits for the disconnect command. And since the light in this room is lit, the light sensor will block the transmission of commands to turn on the light and, accordingly, the shutdown command will no longer arrive and the light will be on all the time. Having understood this, I decided to block the light sensor, sealing the photocell window with an opaque black adhesive tape, since there are no windows in the toilet and there is no need to block the light from turning on during the day. I was already going to disassemble the sensor, but at first I decided to try to minimize the sensitivity of the light sensor. It turned out that if the “Sensitivity” adjustment resistor is loosened to the minimum position, the light sensor turns off completely and does not participate in the work. Thus, even if the power supply is disconnected from the power unit (for example, the light is turned off), the next time a person appears, the PIR sensor, regardless of the fact that the light is already on, will send an activation command to the power unit, and after 40 seconds after the person leaves, the shutdown command and the lights go out.

Now, after all the checks and assembling of the ceiling, it remains to lock the switch in the corridor, because I myself, and other family members, will still click on the switch for a long time and the power supply of the power unit will sometimes turn off and : so that the light stably lights up and turns itself off when the children enter the toilet, it will not be realized.



With the switch, I, too, is not so simple. The wall between the corridor and the bathroom with a toilet is so thin (less than 50 mm) that it does not fit the standard installation box. Earlier in this place were very thin Soviet switches in square boxes. When it came time to change the switches, I chose the thinnest and cut the wiring box. And now the switch is inserted to the full depth and rests on the bottom of the junction box, just close the two wires under the switch does not work, there is simply no place for these wires.



It is good that there are two contacts on the terminals of the switch. Since there is no place at the back of the switch, I did not disconnect the wires from it, but simply shunted it with a loop of wires in the insulation, which I let on the side of the switch itself, where there is a place. Now, regardless of the position in which the key of this switch is located, the power unit is always connected to the network and the light comes on when a person appears.

On this my work was finished. The youngest member of the family responsibly participated in the experiments and we were convinced that the sensor responds with confidence even to the most imperceptible movements, the light always lights up and does not go out in the presence of a person.

Finally, I noticed another little nuance. The sensor, when it hangs on the far wall, is triggered only by the appearance of a person in the doors of the door. And since the corridor is narrow, then any person, opening the door, stands a little apart and the light does not come on. And when the door is open, there is still a slight delay in the motion sensor. Of course, family members may get used to it, but at first it will cause some discomfort. Not to mention the guests who will stand in the corridor and click the switch, not realizing that you just need to go into the door. They will have to explain how to turn on the light. I don’t like this option at all.

And then I realized what I had to do. The sensor is completely autonomous. Who bothers me to attach it directly to the door?Now when you open the door, a person, even standing away from the door, will still be in the field of view of the sensor and it doesn’t matter that it’s not the person who will move but the sensor itself, the main thing is that he will give the command to turn on the light.

Since the PIR-sensor was fixed on small pieces of double-sided tape, its gluing to a new place did not take much time. Now he is even closer to the man and even more sensitive to the slightest movements.



The younger member of the family continued the experiments. Now I was completely satisfied with the results.

1. The light comes on when the door is moving, even if the person does not enter the field of view of the sensor. I deliberately checked this by opening the door and hiding behind it so that I was not visible. So the sensor detects the difference in the temperatures of the back and side walls during movement and this is enough for him to issue a command to turn on the light.
2. The sensor reacts to the slightest movement of a person, prolonging the time of switching on the light for 40 seconds with each triggering.
3. Exactly 40 seconds after the person left the room the lights go out.
4. The light does not light up itself when driving and noise in the corridor or rooms.
5. The sensor surely triggers the presence of a person, making life much easier for both children and adults.



And most importantly, the younger and the main family member is most pleased. Now he has become completely independent and does without the help of adults. Well, the first step has been taken towards the construction of the “Smart Home”

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


All Articles