logoi5893
Posts: 10
Joined: Thu Nov 10, 2016 3:01 pm

Sensing 120VAC presence with RPi

Thu Nov 10, 2016 3:30 pm

Hi all,

I am currently working on a project to remotely monitor the status of a generator transfer switch. I need the RPi to recognize when I have normal power available, emergency (generator) power available, and when the transfer switch has transferred load to emergency. The RPi will send an email when it senses any of these has changed state.

The transfer switch does have contacts available for the switch position, so that one's easy. But it does not have go/no-go contacts for the presence of normal or emergency power. It does have transformers (primary side is 120VAC to ground, secondary side is 20VAC to ground) that provide for the indicator lights on the front panel.

So my question is - what would be the best way to interface with the Pi? I have toyed with the idea of relays, but I'm afraid the coil voltage won't be quite right, or we'll have to rectify and filter the transformer output to interface with a DC coil. I've looked into optoisolators, but after searching the forums most of the examples I see are for optoisolation on the output of the Pi, not the input. If we use the optoisolators, what is the "correct" way to build the circuit for this purpose?

What would be the ideal way to go about this? Thanks in advance!

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

Re: Sensing 120VAC presence with RPi

Fri Nov 11, 2016 2:20 pm

Just use two standard 120VAC relays, connect one to your generator supply and another to your mains supply. connect a GPIO input to the switch contacts as you would any other switch or button.
Doug.
Building Management Systems Engineer.

RaspISteve
Posts: 100
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Sensing 120VAC presence with RPi

Sun Nov 13, 2016 7:27 pm

What about a simple neon type indicator across the 120vac and a photo diode or LDR looking at the neon and attached to a spare PIO.
Share and Enjoy.

logoi5893
Posts: 10
Joined: Thu Nov 10, 2016 3:01 pm

Re: Sensing 120VAC presence with RPi

Mon Nov 14, 2016 7:12 pm

Thanks for the responses! Part of my dillema is that the transfer switch is in-service and there's not really any good way to remove voltage from the 120V normal side to safely lug on a relay coil. I think what we're going to do is just go ahead and do the 120V relay on the emergency side, and forego for the time being monitoring the normal side.

It would be ideal to have something like a phase monitor that could give a state change for any of the three legs going out. But I still have to deal with the problem of how and where to safely connect it.

Thanks again for the input!

boyoh
Posts: 1463
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Sensing 120VAC presence with RPi

Mon Nov 14, 2016 8:25 pm

On each supply to be monitor ,fit a power out put socket.
In each socket fit a 5v+ Power adapter to interface with the Pi.
In each case you could use a opto isolator as a voltage leveler
5v to 3,3v GPIO IN/PUT
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

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

Re: Sensing 120VAC presence with RPi

Tue Nov 15, 2016 8:13 am

logoi5893 wrote:Thanks for the responses! Part of my dillema is that the transfer switch is in-service and there's not really any good way to remove voltage from the 120V normal side to safely lug on a relay coil. I think what we're going to do is just go ahead and do the 120V relay on the emergency side, and forego for the time being monitoring the normal side.

It would be ideal to have something like a phase monitor that could give a state change for any of the three legs going out. But I still have to deal with the problem of how and where to safely connect it.

Thanks again for the input!

you don't have any circuits that are on non-maintained supply? It's unusual for the generator to backup everything within a building.

Schedule fitting the relay for the next time you do a on-load test of the generator system, if your relay is already mounted in the panel it should only take a few minutes to connect up.
Doug.
Building Management Systems Engineer.

boyoh
Posts: 1463
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Sensing 120VAC presence with RPi

Wed Nov 16, 2016 10:09 am

Is it possible to use split clamp CTs to switch the the transmitter of a OPTO ISOLATOR.
This would be a non intrusive connection, and total isolation. Use the receiver side transistor
To interface with the Pi GPIO IN/PUT
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

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

Re: Sensing 120VAC presence with RPi

Thu Nov 17, 2016 8:20 am

boyoh wrote:Is it possible to use split clamp CTs to switch the the transmitter of a OPTO ISOLATOR.
This would be a non intrusive connection, and total isolation. Use the receiver side transistor
To interface with the Pi GPIO IN/PUT
If attempting this please remember to connect the transmitter to the output of the split clamp CT BEFORE attaching the split clamp to the cable.
Doug.
Building Management Systems Engineer.

logoi5893
Posts: 10
Joined: Thu Nov 10, 2016 3:01 pm

Re: Sensing 120VAC presence with RPi

Thu Nov 17, 2016 3:57 pm

boyoh wrote:Is it possible to use split clamp CTs to switch the the transmitter of a OPTO ISOLATOR.
This would be a non intrusive connection, and total isolation. Use the receiver side transistor
To interface with the Pi GPIO IN/PUT
This is a really good idea, and we were really excited about it. But we realized that if we are wanting to monitor the incoming normal power (upstream from the transfer switch), then this would not tell us if power returned while we are on generator - the current coming from normal power while on generator would be zero.

We did end up figuring out what we could do, though. We found a spare three phase breaker in the disconnect box upstream from the transfer switch. We can safely lug onto it while in the off position, and either run to 120V relays or a voltage/phase monitor that would give us the contact closure(s) we need to be able to interface with the Pi. Then just turn the breaker on.

Thanks again for all the suggestions!

boyoh
Posts: 1463
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Sensing 120VAC presence with RPi

Thu Nov 17, 2016 7:55 pm

BMS Doug wrote:
boyoh wrote:Is it possible to use split clamp CTs to switch the the transmitter of a OPTO ISOLATOR.
This would be a non intrusive connection, and total isolation. Use the receiver side transistor
To interface with the Pi GPIO IN/PUT
If attempting this please remember to connect the transmitter to the output of the split clamp CT BEFORE attaching the split clamp to the cable.
Good thinking Full marks
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

Annesville
Posts: 6
Joined: Wed May 23, 2012 12:51 pm

Re: Sensing 120VAC presence with RPi

Tue Nov 29, 2016 9:39 pm

BMS Doug wrote:
boyoh wrote:Is it possible to use split clamp CTs to switch the the transmitter of a OPTO ISOLATOR.
This would be a non intrusive connection, and total isolation. Use the receiver side transistor
To interface with the Pi GPIO IN/PUT
If attempting this please remember to connect the transmitter to the output of the split clamp CT BEFORE attaching the split clamp to the cable.
Give us the reasoning behind this please, Doug, so that we can learn...

User avatar
aTao
Posts: 1091
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: Sensing 120VAC presence with RPi

Tue Nov 29, 2016 10:12 pm

Annesville wrote:
BMS Doug wrote:
boyoh wrote:Is it possible to use split clamp CTs to switch the the transmitter of a OPTO ISOLATOR.
This would be a non intrusive connection, and total isolation. Use the receiver side transistor
To interface with the Pi GPIO IN/PUT
If attempting this please remember to connect the transmitter to the output of the split clamp CT BEFORE attaching the split clamp to the cable.
Give us the reasoning behind this please, Doug, so that we can learn...
Current transformers are a current source 9research current source and voltage source), they will generate sufficient voltage to make the expected current flow. Now, consider what happens when the output is open circuit.... Yup a gazillion volts.
>)))'><'(((<

Return to “Automation, sensing and robotics”