logo elektroda
logo elektroda
X
logo elektroda

Remote control of lights with Raspberry Pi Zero - how to connect the relays?

l3g4to 3003 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 15322964
    l3g4to
    Level 9  
    I have a Raspberry Pi Zero and I'm thinking of remotely automating my house light switches. I was thinking about Z-wave but this solution is very expensive and as I will only be taking delivery of the flat in a few months I will be able to pull the cables up to the switches quietly.

    What I want to do
    The aim is to enable remote control of the lights using a Raspberry Pi Zero (e.g. Home Assistant), while still being able to switch the lights on/off with switches in the rooms.

    What's my idea
    Remote control of lights with Raspberry Pi Zero - how to connect the relays?
    I'm not a professional electrician so I came up with something like this for now:
    1. For now my idea is to run a cable from the Raspberry Pi GPIO (5v) and an additional circuit from the 220v box under each switch I want to automate.
    2. Next, I would mount 2 relays under the switch on the wall - one 220v (switched on/off by an additional 220v circuit) and one controlled from the Raspberry Pi GPIO (5v).
    3. I would connect both relays to each other so that the light would switch on when either voltage is on or off on both relays)
    This way, I assume I will be able to control the light remotely as well as the switch on the wall and protect myself from the situation if my Raspberry Pi dies.

    My questions
    1. Does this diagram/solution above make sense?
    2. What relays will work best for this? The cheaper the better. I don't know.
    3. The disadvantage of this solution is that by controlling the light I won't have any feedback (whether it's currently on or not). I can pull another input circuit from the Raspberry Pi GPIO but don't know the best way to do this.
  • ADVERTISEMENT
  • #2 15326505
    tos18
    Level 42  
    You are making unnecessary combinations.
    If you already have to use relays then just switch the lights with them and only connect the switches to the raspberry inputs. Also read about staircase switches (if you want to implement the idea from the drawing)
  • #3 15327009
    l3g4to
    Level 9  
    tos18 wrote:
    You are combining unnecessarily.
    If you already have to use relays then just switch the lights with them and only connect the switches to the raspberry inputs. Also read about stair switches (if you want to implement the idea from the drawing)


    As no one replied I corrected the idea yesterday and posted it here as my problem seemed to be more about Electrical than Automation (I will delete this thread maybe?):
    https://www.elektroda.pl/rtvforum/topic3145642.html#15326291

    I came up with the idea of a stair switch instead of one relay, but I don't really understand how to connect the other inputs to the Raspberry - with what you suggest. I'd be grateful if you could write more as I can't connect 220v directly through the Rasperry pi and I'd like the circuit to be independent of the Raspberry Pi - it would work if I disconnected the circuit.
ADVERTISEMENT