assenda
Posts: 9
Joined: Thu Mar 26, 2015 11:50 am

powersensor for 230v AC with 5v output

Tue Apr 07, 2015 3:36 pm

Hi together,
we need your help in our project.

Image
http://fs2.directupload.net/images/150407/d7mpw7mf.png

It is a simple circuit to control a lamp over the Raspberry using a PCF expander board,
as well as a relay for switching the lamp (~230V).

The relay is switched via the expander board.
Once the lamp was switched on or off by a normal lightswitch,
the raspberry should receive the information that the status has changed.

Do you know any options to send a 5V signal to an input pin of the expander board,
if the circuit (~ 230V) is closed or open?

I need a solution in form of a possible small and cheap board,
preferably in combination with the relay.

The following board should work, but i need your assessment.
Are there better solutions?

http://de.aliexpress.com/item/Free-ship ... 82240.html
http://de.aliexpress.com/item/5A-AC-Cur ... 68708.html

Regards,
Daniel

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: powersensor for 230v AC with 5v output

Tue Apr 07, 2015 3:46 pm

assenda wrote:The relay is switched via the expander board.
PCF8574 board is definitely a bad idea for that.
Consider a MCP23017 or the little sister with 8 gpio (much, much, much better)

BMS Doug
Posts: 4328
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: powersensor for 230v AC with 5v output

Tue Apr 07, 2015 4:06 pm

230V kills, do not work on it unless you are a qualified electrician.


I wouldn't use one of those relays for switching 230v, I'm not convinced their insulation is good enough.


One of your current detection devices is only capable of outputting an analogue signal, this is no use to the Pi, you would need a ADC to converter it to a digital signal for the Pi to use.

The other one could be used, it has a relay output and a signal output (but if the lamp fails the device will always say the light is off).

True two way switching would be better than the parallel switching arrangement you have suggested.
Doug.
Building Management Systems Engineer.

assenda
Posts: 9
Joined: Thu Mar 26, 2015 11:50 am

Re: powersensor for 230v AC with 5v output

Tue Apr 14, 2015 3:07 pm

thanks for the reply!
Is there another solution?
For example, a relay in which I can get 5v dc output from the 230V ac switch?

I havn't found anything.
The previous solution is too big for me.

Regards,
Daniel

User avatar
mikronauts
Posts: 2821
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: powersensor for 230v AC with 5v output

Tue Apr 14, 2015 3:36 pm

AC current sensor like

https://www.sparkfun.com/products/11005

http://openenergymonitor.org/emon/node/58
assenda wrote:thanks for the reply!
Is there another solution?
For example, a relay in which I can get 5v dc output from the 230V ac switch?

I havn't found anything.
The previous solution is too big for me.

Regards,
Daniel
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

tequilacz
Posts: 1
Joined: Wed Jun 15, 2016 10:38 am

Re: powersensor for 230v AC with 5v output

Thu Jun 16, 2016 9:30 am

I have a similar problem. I want check 230V AC voltage, not current. Only is voltage 1, is not 0. I think that one 230V AC / 230V AC relay must solved this problem. On the output pins of relay can flow 5V DC, i think. It is only wire. ;) But it must connect about 350 OHM resistor on output. Or am I wrong?

Something like this:
Attachments
schema_c.jpg
schema_c.jpg (38.69 KiB) Viewed 4049 times

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 10277
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: powersensor for 230v AC with 5v output

Thu Jun 16, 2016 2:06 pm

Looks like overkill to me, and you've got to find an extra 5V rail.
The GPIO pins can have internal pull resistors. Activate that. The relay can then pull the GPIO pin down to ground.
As long as your mains input is sufficient to pull the relay in, you now have a nice clean logic signal, although admittedly in the opposite sense to that you asked for (0=power present, 1=power absent).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.


Return to “HATs and other add-ons”