Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


SirHumphreyAppleby

2938 posts

Uber Geek
+1 received by user: 1860


#270517 13-May-2020 11:59
Send private message

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/10/22/my-custom-open-source-home-automation-project-part-3/

 

I'm open to suggestions, but not to use Z-Wave or Sonoff etc.


View this topic in a long page with up to 500 replies per page Create new topic
 1 | 2
kobiak
1615 posts

Uber Geek
+1 received by user: 551

Trusted

  #2482679 13-May-2020 12:09
Send private message

just as another option.

 

there're DIY DETA devices (rewire plug and inline switch) available from bunning. These are TUYA powered, so can be added to home assistant for local control or GA/Alexa.

 

great for turn on/off not smart devices or lights. also there are smart wall switches.





helping others at evgenyk.nz




Yoban
453 posts

Ultimate Geek
+1 received by user: 86


  #2482689 13-May-2020 12:26
Send private message

kobiak:

 

just as another option.

 

there're DIY DETA devices (rewire plug and inline switch) available from bunning. These are TUYA powered, so can be added to home assistant for local control or GA/Alexa.

 

great for turn on/off not smart devices or lights. also there are smart wall switches.

 

 

As mentioned by @kobiak...these do look interesting https://www.bunnings.co.nz/deta-smart-plug-base-with-grid-connect_p0098817 and/or https://www.bunnings.co.nz/deta-smart-inline-switch-with-grid-connect_p0098816 with the later being similar to a sonoff, a bit more expensive, but rated/certified.

 

Got me keen now.


SirHumphreyAppleby

2938 posts

Uber Geek
+1 received by user: 1860


  #2482691 13-May-2020 12:31
Send private message

Yoban:

 

As mentioned by @kobiak...these do look interesting https://www.bunnings.co.nz/deta-smart-plug-base-with-grid-connect_p0098817 and/or https://www.bunnings.co.nz/deta-smart-inline-switch-with-grid-connect_p0098816 with the later being similar to a sonoff, a bit more expensive, but rated/certified.

 

Got me keen now.

 

 

Not the right solution for me but they do look interesting. Turning power on and off is only one part of the solution.

 

Some of the Sonoff products have been certified in Australia. The Sonoff Mini doesn't appear to be (yet?), but you can use that with a switch as well. The plug base could be quite good. Sonoff has an IP55 rated version, but that's also quite a bit larger.




SirHumphreyAppleby

2938 posts

Uber Geek
+1 received by user: 1860


  #2484197 15-May-2020 08:41
Send private message

I managed to find some Crydom relays which could be controlled directly from the Pi's GPIO. The DIN modules I found state 15mA typical control current, while the panel mount state 10mA with a maximum of 15mA so those are probably better given the Pi's 16mA limit. While this would work in this case, the Pi has a ~60mA limit across all GPIO ports, so as part of a larger automation project it's a no-go. Probably easier (and cheaper) to boost the output to 12/24V as the Crydom relays are $90 each at RS.


frankv
5705 posts

Uber Geek
+1 received by user: 3666

Lifetime subscriber

  #2484216 15-May-2020 09:15
Send private message

Do you really need mains power for lighting? How about 12V or 24V or 36V DC LED lighting?

Just a thought, and means no compliance issues.

SirHumphreyAppleby

2938 posts

Uber Geek
+1 received by user: 1860


  #2484236 15-May-2020 09:49
Send private message

frankv: Do you really need mains power for lighting? How about 12V or 24V or 36V DC LED lighting?

Just a thought, and means no compliance issues.

 

I'm looking at this as a prototype for more automation going forward, where AC control will be unavoidable. DC lighting will likely be included and I also have code/hardware for DMX control that I could add in to the mix if necessary to provide dimming.

 

In this instance we don't want to replace the existing fittings as they fit with the style of the house. 12V E27/B22 bulbs exist, but their quality is unknown and I'm not keen on having 12V items with connectors typically used for 230V applications. That's just asking for trouble IMO.


 
 
 
 

Shop now on Samsung phones, tablets, TVs and more (affiliate link).
niallm90
123 posts

Master Geek
+1 received by user: 28

Trusted

  #2484241 15-May-2020 09:55
Send private message

Can you link what relays your talking about? Are they a fully enclosed package or do you plan to put them in a box?


SirHumphreyAppleby

2938 posts

Uber Geek
+1 received by user: 1860


  #2484246 15-May-2020 10:10
Send private message

niallm90:

 

Can you link what relays your talking about? Are they a fully enclosed package or do you plan to put them in a box?

 

 

The panel mount relays are here...

 

https://nz.rs-online.com/web/p/solid-state-relays/1450568

 

I don't think these are suitable for more than a couple of circuits due to the switching current requirements.

 

In terms of cost, a 24V coil relay similar to below is cheaper and easier to source, even if you need to add another power supply.

 

https://nz.rs-online.com/web/p/non-latching-relays/8886871/

 

Any need for an enclosure is one of the compliance requirements I am hoping to establish with this thread.


andrewNZ
2487 posts

Uber Geek
+1 received by user: 1461
Inactive user


  #2484318 15-May-2020 11:05
Send private message

Solid state is the way to go if you want to control it direct from the Pi. You do need to be aware of the potentially significant heat generated by the SSR though. The one you linked is good for 10A, but only with a heatsink and operating for less than an hour at time (no duty cycle is specified). With no heatsink and no air flow, it'll be rated for bugger all.

What exactly do you want to control? (LED lights, fluro lights, heaters, motors...)

I wouldn't advise anyone to use standard IOT home automation gear (sonoff etc) for anything over about 0.5A. It's a fire risk.

Maybe your best soloution is to put in a PLC and just program it to be ?modbus/modbusTCP? remote IO.
For example, a AB Micrologix1400 might be under $2k if you know the right people, and you'll get 12x relay out and 20x 24VDC Inputs

SirHumphreyAppleby

2938 posts

Uber Geek
+1 received by user: 1860


  #2484328 15-May-2020 11:20
Send private message

andrewNZ: What exactly do you want to control? (LED lights, fluro lights, heaters, motors...)

 

For the current task, only 26W (LED lighting).

 

Higher current and duty cycle loads are desirable in the future. E.g. the pool pumps run for around 8 hours a day during summer, at 1.5kW when the solar pump is running.

 

I will need to look more at Modbus.


Eitsop
584 posts

Ultimate Geek
+1 received by user: 153

ID Verified

  #2485360 17-May-2020 22:19
Send private message

andrewNZ: I wouldn't advise anyone to use standard IOT home automation gear (sonoff etc) for anything over about 0.5A. It's a fire risk.

 

I would like to use https://robotdyn.com/relay-module-2-relay-5v-30a.html for a HWC switch.. as no DETA model can do >10amp?

 

But your saying too risky? and no sparky would sign off?


 
 
 

Support Geekzone with one-off or recurring donations Donate via PressPatron.
SomeoneSomewhere
1882 posts

Uber Geek
+1 received by user: 1086

Lifetime subscriber

  #2485366 17-May-2020 23:14
Send private message

Not a chance in hell a sparky would sign that off.

 

 

 

Essentially, you will want a probably 24V AC or DC intermediate stage, switching standard electrical contactors - something like ABB ESB or Schneider iCT. Get contactors with 24V coils, and use a smaller interposing relay or transistor that you can drive with your RPi/BMS/PLC to switch them.

 

 

 

Any mains wiring (and low voltage, really) needs to be in a box so that you can't access live parts (or, for mains, 'basic insulation' - the coloured layer) without a tool.

 

 

 

Modbus TCP is what you want, or Modbus RTU if you're willing to deal with getting RS485 serial going. These are standard industrial control protocols, and there are open source tools for dealing with them. These will let your central node monitor and control inputs and outputs on whatever hardware you use, via a network. I probably wouldn't use the IO directly on an RPi for this; for starters, you start having scalability issues.


Handle9
11924 posts

Uber Geek
+1 received by user: 9674

Trusted
Lifetime subscriber

  #2485368 17-May-2020 23:24
Send private message

SirHumphreyAppleby:

 

andrewNZ: What exactly do you want to control? (LED lights, fluro lights, heaters, motors...)

 

For the current task, only 26W (LED lighting).

 

Higher current and duty cycle loads are desirable in the future. E.g. the pool pumps run for around 8 hours a day during summer, at 1.5kW when the solar pump is running.

 

I will need to look more at Modbus.

 

 

The newer generation smart relays are networkable and NZ compliant.

 

https://nz.rs-online.com/web/p/logic-modules/1653283/

 

Modbus is a total PITA - it's a protocol from the 70s and not like reading an API. 


andrewNZ
2487 posts

Uber Geek
+1 received by user: 1461
Inactive user


  #2485378 18-May-2020 00:18
Send private message

Most PLC's these days are networkable, the trick is communicating with them in a meaningful way.

Modbus is not great but it works well. I gave it as an example, I'm not saying that it's the best solution, but it is an established protocol, and it is still widely used. ModbusTCP is significantly better than the rs485 version.

Going with a well established protocol of some kind means that if any part of the system needs to be replaced with something different, you won't have too much work to do.
If you select something that uses product specific comms...

andrewNZ
2487 posts

Uber Geek
+1 received by user: 1461
Inactive user


  #2485379 18-May-2020 00:36
Send private message

attewell:

andrewNZ: I wouldn't advise anyone to use standard IOT home automation gear (sonoff etc) for anything over about 0.5A. It's a fire risk.


I would like to use https://robotdyn.com/relay-module-2-relay-5v-30a.html for a HWC switch.. as no DETA model can do >10amp?


But your saying too risky? and no sparky would sign off?


You'll find someone to sign off anything. But no-one who's any good will go near that.

I tried a sonoff POW for my hot water. Rated for 16A my HWC draws 6A.
It failed at a solder joint and tried pretty hard to set itself on fire.

None of that stuff is designed with any kind of failure safety.

 1 | 2
View this topic in a long page with up to 500 replies per page Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.