harvy
Posts: 93
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 9:38 am

Good Morning all,

I've been looking for a way to control 240v mains uk power from the raspberrypi, and have come up with this solution (not cheap but seems safer then some of the options i've seen!).

Starts off with a mean well dual output power supply - 5v(6A) and 12v (3A),

The 5v is currently then split into a micro usb for the pi (keeping it powered via the polyfuse), and the other is connected to the 0v and 5v on the BV4627-B relay board (http://www.byvac.com/bv3/index.php?rout ... duct_id=83

The pi and BV4627 linked by I2C, allowing control of each of its 8 relays.

Each relay on the switching side is feed by 12V, which is output to the coil of the SCLR2-12V relay (designed for 230v switching)
http://www.switchtec.co.uk/catalog_meas ... p?page=204

The load side of the relay will then be connected to 230v mains appliance - at present will actually be used in place of a thermostat in home central heating, but in the future, could be used as a switch for led light driver, etc.

So the question for anyone out there interested, i know this works, as I've set it up. But, in the interest in saving blown components etc, any recommendations as to what to change/improve in terms of setup? The whole set will eventually be mounted onto two din rails, one for the pi, bv4627 and psu, the second for the SCLR2 sets and mains switch for the psu.
Attachments
Connection diagram.jpg
mains control solution
Connection diagram.jpg (58.71 KiB) Viewed 7412 times

User avatar
DougieLawson
Posts: 37674
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 9:49 am

Why is there the 12V0 side of the circuit? That BV4627-B board can directly switch 230V0.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

harvy
Posts: 93
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 9:56 am

12v side I put in as I didn't have faith that the BV4627-B would safely handle 230v over long periods, without significant current draw and possibly damaging the coils. Plus safer to play with 12v then 230 in my eyes (without the debate on 12v at higher amps in dc is worse the n 230v at low amps on ac etc)

User avatar
Cancelor
Posts: 769
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 10:06 am

I guess harvy wants/needs latching relay(s)?
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

harvy
Posts: 93
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 10:20 am

That's exactly what I was after, plus this one allows for manual override

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 12:27 pm

harvy wrote:Good Morning all,

any recommendations as to what to change/improve in terms of setup?
Sure....3 words.

Solid State Relays.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

harvy
Posts: 93
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 2:59 pm

Richard-TX:

Can you recommend any which can be switched by 5v or even 3.3v for the pi, and are suitable for 230v prob 10 amp ac ? Needs to be over i2c to allow for future expansion plans for lighting and automation... and Available from a decent UK distributor?

Also any pros of using a solid state over the coiled version?

User avatar
BAStumm
Posts: 134
Joined: Fri Aug 23, 2013 3:37 pm
Location: Loon Lake, WA USA
Contact: Website

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 3:15 pm

Yep, solid state relays... I'm working on a similar application. I'd also put an opto-isolator breakout board between pi and SSR. use the opto to change from 3.3 to 5vdc (not necessary if short wire run). Most SSR's will switch from 3vdc. At least the ones I use do. Pick an SSR with zero cross detection built in. And I would suggest getting one rated for 480 or 600VAC and at least double the amperage you plan to have. You will still need a heat sink for the SSR if amperage is very high.

I'm using this one for 120VAC, 20A.

http://www.ebay.com/itm/1Pcs-FOTEK-Soli ... 2c7738f1b9

User avatar
BAStumm
Posts: 134
Joined: Fri Aug 23, 2013 3:37 pm
Location: Loon Lake, WA USA
Contact: Website

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 3:17 pm

Never heard of a solid state relay that is i2c. I think you want to add an i2c i/o expansion board in future then use gpio's to trigger the ssr.

harvy
Posts: 93
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 3:56 pm

What are the advantages of using solid state?

The BV4627 has a micro controller which is doing the actual switching so no back emf to the pi, only benefit I can see is arching, but at the same time if ssr doesn't fully 100% isolate I run the risk of the load will be active when I don't want it to? (Depends on the load of course!)

User avatar
BAStumm
Posts: 134
Joined: Fri Aug 23, 2013 3:37 pm
Location: Loon Lake, WA USA
Contact: Website

Re: controlling 230v from rPI - solution? pick holes at it!

Wed Jun 11, 2014 3:59 pm

SSR = safer, more reliable, less noise.

Check e-bay. I saw a lot 10 SSR's for $8 but I didn't check the specs. Again, make sure you get zero cross with zero detection circuit. If you get a phase angle compatible version you will need to do zero cross detection yourself or phase angle fire it which is very noisy.

ratslapper
Posts: 1
Joined: Fri Jun 13, 2014 4:07 pm

Re: controlling 230v from rPI - solution? pick holes at it!

Fri Jun 13, 2014 4:22 pm

i myself would use and optoisolator (moc3011) to control a gated triac configured for 240V.

rgrbic
Posts: 128
Joined: Thu Jun 12, 2014 1:07 pm
Contact: Website

Re: controlling 230v from rPI - solution? pick holes at it!

Fri Jun 13, 2014 10:25 pm

Consider some kind of galvanic isolation (like optocoupler)
At 127.0.0.1
Twitter: @rgrbic
IoT-projects.com

harvy
Posts: 93
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: controlling 230v from rPI - solution? pick holes at it!

Sat Jun 14, 2014 1:05 pm

rgrbic wrote:Consider some kind of galvanic isolation (like optocoupler)
Isolation between?

rgrbic
Posts: 128
Joined: Thu Jun 12, 2014 1:07 pm
Contact: Website

Re: controlling 230v from rPI - solution? pick holes at it!

Sat Jun 14, 2014 1:19 pm

Between RPi and relays.
At 127.0.0.1
Twitter: @rgrbic
IoT-projects.com

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: controlling 230v from rPI - solution? pick holes at it!

Sat Jun 14, 2014 1:38 pm

All of the questions regarding solid state relays can be found by reading the data sheet for the SSR in question.

Here is the one for the relays I use and recommend.

http://factorymation.info/relays/EL.CO.%20SSR08.pdf

In short:

guaranteed 4000 volt input-output isolation
UL and CE certified
zero crossing
up to 48 amp (31,680 watts) rating.
LED indicator

You could do it cheaper, but you can't do it better.

What's not to love?
Last edited by Richard-TX on Sat Jun 14, 2014 1:48 pm, edited 1 time in total.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

harvy
Posts: 93
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: controlling 230v from rPI - solution? pick holes at it!

Sat Jun 14, 2014 1:47 pm

rgrbic wrote:Between RPi and relays.

The byvac board essentially has done this. The relays are controlled by its own micro controller.

The pi sends the signal to the micro controller, the micro controller then switches the relay. There is no back emf from the relays to the pi.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: controlling 230v from rPI - solution? pick holes at it!

Sat Jun 14, 2014 1:57 pm

But the byvac relays are noisy and require power and are not zero crossing.

The SSR is a simple block with two connections to the Rpi. The GPIO pin and ground.

Like I said before, the SSR I mentioned is CE and UL approved. I doubt the byvac can make that claim.

I use small relays for switching low voltages They can be safely used without opto-isolation as the insulation factor of the driver transistors is sufficient.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
BAStumm
Posts: 134
Joined: Fri Aug 23, 2013 3:37 pm
Location: Loon Lake, WA USA
Contact: Website

Re: controlling 230v from rPI - solution? pick holes at it!

Sat Jun 14, 2014 2:04 pm

Optos are cheap, 8 channels for $5. In my (commercial) application I use optos between pi and ssr which is switching 277vac at 30 amps.

stevend
Posts: 236
Joined: Fri Oct 11, 2013 12:28 pm

Re: controlling 230v from rPI - solution? pick holes at it!

Sat Jun 14, 2014 5:50 pm

Some things I found while looking at a similar problem:

1. SSRs typically drop 1.7-2V across them - so if you're powering a high current load (e.g. immersion heater - 12A) you have to lose 20W of power! Less of a problem with lower current loads.

2. Some SSRs have snubber networks across them; these effectively bypass the actual switch in the SSR, passing a small amount of current even when the SSR itself is off. So an open circuit output can actually be live, and a really low current load could be turned on, at least partially, due to the current passed by the snubber network.

3. SSRs generally need less power on the control (low voltage) side - typically 3-5V at 10mA or so - when compared to a relay.

4. SSRs, even those without snubbers, have a little leakage current when off, unlike a relay. Possibly enough to give you a shock if you touch the output when there's no load (I've not tested it!). (Not that you should be touching potentially live wires without isolating the mains input first anyway, but these things can happen).

5. SSRs switch on the zero crossing of the mains, so less interference - a definite plus point when switching frequently.

I opted for SSRs for the relatively low current circuits, since they would be switched frequently (these) although for versatility I buffered my processor outputs. Then avoid the power dissipation I used a relay for the high current control, since I would be switching this less frequently (although an immersion heater of course has its own thermostat - an internal contact which switches on and off)

rgrbic
Posts: 128
Joined: Thu Jun 12, 2014 1:07 pm
Contact: Website

Re: controlling 230v from rPI - solution? pick holes at it!

Sun Jun 15, 2014 8:53 am

harvy wrote:
rgrbic wrote:Between RPi and relays.

The byvac board essentially has done this. The relays are controlled by its own micro controller.

The pi sends the signal to the micro controller, the micro controller then switches the relay. There is no back emf from the relays to the pi.
Then you don't need it (sorry, I didn't check the details about the byvac board, I thought it is just a board with the relays). According to your schematic, I think it will work. Only watch on voltage levels between RPi and MCU on the board (RPi uses 3.3V logic levels).
At 127.0.0.1
Twitter: @rgrbic
IoT-projects.com

harvy
Posts: 93
Joined: Mon Nov 26, 2012 1:49 pm
Location: London - UK

Re: controlling 230v from rPI - solution? pick holes at it!

Sun Jun 15, 2014 8:18 pm

Re the noise and power requirements. Given that the sclr2 is a mechanic not electromagnetic, latch, although the byvac board needs constant power, the relay will at most only be active for 0.2 seconds or shorter... I'm really not that concerned about the noise and power draw for that short time. The method I'm looking to use these will mean only one relay will be active at any one time for that split second. They may be safer, but still looking for an actual reason why ssd would be better for my needs...

Plus by the sounds of it, if I need more relays then the number of io pins available then I'd have to use a second or more io add on board anyway. This way I can just keep adding as many byvac boards as I want each giving me an extra 8 outputs.

Return to “Automation, sensing and robotics”