Automation of lighting a plot in a village or the first step to a smart home

    For a long time I was going to write about my smart home, and here came a long vacation, for which I did not go anywhere and there is a good reason to fulfill my plan. I am thinking of breaking the text into several small articles that will be easier to read (and probably write too).

    First, the preamble. It all started with the fact that I put a few poles on the village site and installed lighting on them. After which I got the idea to somehow automate turning on and off the light.

    The simple option of turning on the light in the evening and turning it off in the morning with the help of a photo relay did not fit, since the light got into the windows of the house and prevented sleep. The family told this option a friendly no.

    The next option was a timer with a REV-302 calendar from Novatek-Electro. The disadvantage of this option was that it more or less allowed to turn on the light at twilight (calendar twilight), but it was definitely impossible to determine when it was necessary to turn off the light - sometimes we go to sleep in villages at 10 pm, sometimes at 1 night - no mode!

    I started thinking about possible scenarios. In the first version (rather clumsy) there were three modes:
    • day - the light is off
    • twilight - the light is on
    • night - the light turns on for a while by the motion sensor.

    Switching between day-twilight and night-day modes was obviously implemented using a photo relay. The concept of twilight-night switching was supposed to be carried out after a certain time (30 or 60 minutes) after the lights on the terrace went out. The terrace in the village is such a place where everyone always hangs out and when everyone goes to bed the light turns off there. The motion sensors were supposed to stand at the exits from the house or in the corridor and turn on the lights on the site when someone goes to the toilet at night.

    This scenario seemed to me too complicated and I simplified it by abandoning the motion sensors. In a simplified form, the script looked like this:
    • the light turns on when dusk sets in (photo relay)
    • the light turns off when morning arrives (also photo relay)
    • the light can be turned on and off at any time by a switch.

    Despite the simplicity of the script, it was impossible to implement it without special devices. Here on one of the forums they suggested using Aries programmable relay PR110.

    image

    After studying the documentation for the relay, I decided that this is exactly what I need. By the way (I thought about this much later), this relay allows you to implement the very first scenario. The only thing that was a little embarrassing - it seemed to me that using such a relay for such a simple task was like a sparrow cannon, but for lack of other options, I settled on it.

    The relay is programmed in a special visual environment OWEN Logic, in which the program is created in the form of flowcharts. The visual approach to programming also played a role - I didn’t want to remember programming languages, but everything seemed to be simple (much later I changed my attitude to visual programming a bit - this is really good for very simple tasks, but as soon as complexity increases, visual programming becomes a burden ) In this environment, I implemented my logic and checked in emulation mode - everything works exactly as I wanted.
    image
    I’m still not sure how optimally the algorithm is implemented, but since everything works, there’s nothing to touch))
    It was possible to move on to practice. I bought a programmable relay, photo relay and button-switch. I also had to buy a special device for connecting to the computer to load the programs into the relay and for debugging. There was especially nothing to debug, but it was impossible to load without it.

    image
    Assembled test bench in the kitchen.

    In May, when we went to the village, I installed a relay, loaded the program into it, and for two years now everything has been working fine, without a single intervention.
    image

    Could a more optimal solution be found for this task? Probably, yes, if you solder the control circuit yourself. This option was also considered, but my knowledge was clearly not enough to come up with a circuit myself, and even though I know how to solder, I don’t really like it. Since then, I met and studied different controllers, but for simple tasks, I still think programmable relays are a good alternative.

    PS
    This summer I started redoing all the wiring in the house and finally I plan to put everything in a neat box)))

    Also popular now: