Controlling mains power with GPIO (In a compliant way)
Posted: Fri May 15, 2020 4:19 pm
This question was originally posted on Geekzone, but the replies have mainly focused on plug/wire-in devices, not the question of compliance I am trying to answer.
Original post:
I am bringing forward plans for automation due to a desire to add additional security sensors. My plans will require controlling mains power (lighting initially) via GPIO on a Raspberry Pi. The Pi will also be used as inputs for sensors, while providing a connection via wired Ethernet, and MQTT.
What do I need to do to connect this all together in a compliant way? Obviously the mains voltage stuff needs to be completed by a qualified person and I will consult them ahead of time so they know exactly what I'm planning.
My initial thought was to put everything on a DIN rail in the ceiling. I found this blog post showing a similar setup in Australia. I note that everything is in an enclosure and they are using 24V signalling (not GPIO) and is connected via a second set of terminals so they don't need to touch the relays if they change the input later. I'm hoping this isn't a requirement as it is likely I would also need to add a power supply to boost the signal from 3.3V to (likely) 24V for the relays (I have not found any DIN relays that will operate directly from GPIO).
https://blog.christophersmart.com/2016/ ... ct-part-3/
I'm open to suggestions, but not to use Z-Wave or Sonoff etc.
Additional notes:
Points regarding power and duty cycle of relays were raised on Geekzone. My current requirements are modest, 26W LED lighting. This is however a prototype for a future automation system so a 'complete' solution would allow for 100% duty cycle. E.g. the pool pumps currently require 1.5kW and can operate for 8+ hours a day in summer.
Original post:
I am bringing forward plans for automation due to a desire to add additional security sensors. My plans will require controlling mains power (lighting initially) via GPIO on a Raspberry Pi. The Pi will also be used as inputs for sensors, while providing a connection via wired Ethernet, and MQTT.
What do I need to do to connect this all together in a compliant way? Obviously the mains voltage stuff needs to be completed by a qualified person and I will consult them ahead of time so they know exactly what I'm planning.
My initial thought was to put everything on a DIN rail in the ceiling. I found this blog post showing a similar setup in Australia. I note that everything is in an enclosure and they are using 24V signalling (not GPIO) and is connected via a second set of terminals so they don't need to touch the relays if they change the input later. I'm hoping this isn't a requirement as it is likely I would also need to add a power supply to boost the signal from 3.3V to (likely) 24V for the relays (I have not found any DIN relays that will operate directly from GPIO).
https://blog.christophersmart.com/2016/ ... ct-part-3/
I'm open to suggestions, but not to use Z-Wave or Sonoff etc.
Additional notes:
Points regarding power and duty cycle of relays were raised on Geekzone. My current requirements are modest, 26W LED lighting. This is however a prototype for a future automation system so a 'complete' solution would allow for 100% duty cycle. E.g. the pool pumps currently require 1.5kW and can operate for 8+ hours a day in summer.