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.




1290 posts

Uber Geek


#270517 13-May-2020 11:59
Send private message quote this 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/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
1413 posts

Uber Geek

Trusted

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

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


260 posts

Ultimate Geek


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

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.


 
 
 
 




1290 posts

Uber Geek


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

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.




1290 posts

Uber Geek


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

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.


3767 posts

Uber Geek

Lifetime subscriber

  #2484216 15-May-2020 09:15
Send private message quote this post

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.



1290 posts

Uber Geek


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

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.


123 posts

Master Geek

Trusted

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

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


 
 
 
 




1290 posts

Uber Geek


  #2484246 15-May-2020 10:10
Send private message quote this post

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.


2216 posts

Uber Geek


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

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




Location: Dunedin

 




1290 posts

Uber Geek


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

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.


381 posts

Ultimate Geek


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

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?


196 posts

Master Geek

Lifetime subscriber

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

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.


3897 posts

Uber Geek

Trusted
Lifetime subscriber

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

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. 


2216 posts

Uber Geek


  #2485378 18-May-2020 00:18
Send private message quote this post

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...




Location: Dunedin

 


2216 posts

Uber Geek


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

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.




Location: Dunedin

 


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





Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Chorus completes the build and commissioning of two new core Ethernet switches
Posted 8-Jul-2020 09:48


National Institute for Health Innovation develops treatment app for gambling
Posted 6-Jul-2020 16:25


Nokia 2.3 to be available in New Zealand
Posted 6-Jul-2020 12:30


Menulog change colours as parent company merges with Dutch food delivery service
Posted 2-Jul-2020 07:53


Techweek2020 goes digital to make it easier for Kiwis to connect and learn
Posted 2-Jul-2020 07:48


Catalyst Cloud launches new Solutions Hub to support their kiwi Partners and Customers
Posted 2-Jul-2020 07:44


Microsoft to help New Zealand job seekers acquire new digital skills needed for the COVID-19 economy
Posted 2-Jul-2020 07:41


Hewlett Packard Enterprise introduces new HPE GreenLake cloud services
Posted 24-Jun-2020 08:07


New cloud data protection services from Hewlett Packard Enterprise
Posted 24-Jun-2020 07:58


Hewlett Packard Enterprise unveils HPE Ezmeral, new software portfolio and brand
Posted 24-Jun-2020 07:10


Apple reveals new developer technologies to foster the next generation of apps
Posted 23-Jun-2020 15:30


Poly introduces solutions for Microsoft Teams Rooms
Posted 23-Jun-2020 15:14


Lenovo launches new ThinkPad P Series mobile workstations
Posted 23-Jun-2020 09:17


Lenovo brings Linux certification to ThinkPad and ThinkStation Workstation portfolio
Posted 23-Jun-2020 08:56


Apple introduces new features for iPhone iOS14 and iPadOS 14
Posted 23-Jun-2020 08:28



Geekzone Live »

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


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



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.

Alternatively, you can receive a daily email with Geekzone updates.