DaxTrajero
Posts: 6
Joined: Fri Aug 10, 2018 10:59 am

Relay - can it be used in reverse (signal microcontroller) ?

Thu Aug 23, 2018 8:05 pm

Newbie alert: Is it possible to use a mechanical relay that, when there's an AC voltage, switches the DC side of the relay? ie. someone turns on a light, and the raspberry pi is signalled

Or is the alternative to use a solid state opto-coupler and resistors?

PhatFil
Posts: 1424
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Aug 23, 2018 9:03 pm

you can use a 'Power Relay' I think thats the term? A relay that switches on with an AC mains voltage instead of a logic circuit level of dc voltage.

most if not all such relays you will find wil be designed for switching ac loads which shouldnt be an issue as long as you dont employ a ssr (solid state relay) tho i dont think 'power' ssrs are very common..

mechanical/magentic coil relays rated for ac loads will be fine for switching a low voltage dc load, its the other way round you want to avoid.


try sticking "240v ac coil power relay" along with 'SPST' (single post single throw) in your shopping searches..

drgeoff
Posts: 9901
Joined: Wed Jan 25, 2012 6:39 pm

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Aug 23, 2018 10:02 pm

You need to use a relay that is specifically intended to work with AC on its coil. Most relays will "chatter" if energised with mains frequency AC. There is not much difference between the coil of a relay and the coil of an AC buzzer or bell. :)

https://www.techwalla.com/articles/diff ... relay-coil

Brandon92
Posts: 775
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Aug 23, 2018 10:37 pm

Hello,
There are indeed special relay for this kind of interface. In the document search for "MasterINPUT". And the overal name for this kind of relay is "Relay Interface Modules".

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

Re: Relay - can it be used in reverse (signal microcontroller) ?

Wed Sep 11, 2019 10:11 am

One safe way to interface the light to give the
Pi a input, would use a 5vdc power adapter
On the lighting circuit. Then use the 5vdc to
Give a 3.3v Pi input using a voltage levelling
Circuit , You could use a potential divider
Or opto isolator or a transistor, the choice
Is yours
Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
davidcoton
Posts: 4200
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Relay - can it be used in reverse (signal microcontroller) ?

Wed Sep 11, 2019 10:25 am

boyoh wrote:
Wed Sep 11, 2019 10:11 am
One safe way to interface the light to give the
Pi a input, would use a 5vdc power adapter
On the lighting circuit...
Except very few lighting circuits have provision to connect power adapters -- certainly UK lighting circuits should not normally have 13A sockets (because they cannot supply 13A).
If you go this way, get help from a qualified electrician.

EDIT: add "UK". Detailed advice will vary between countries.
Last edited by davidcoton on Wed Sep 11, 2019 1:08 pm, edited 1 time in total.
Signature retired

ElEscalador
Posts: 681
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Relay - can it be used in reverse (signal microcontroller) ?

Wed Sep 11, 2019 12:25 pm

You could certainly use a relay with a 100vac coil like this one https://amzn.to/2NVr0RV and monitor the contacts as you would any switch - I do it all the time for different reasons but I also worth with and control voltages up to 480 3 phase for a living.

I think the above is is on the right track and safer that you can use a number of methods to detect the light. Here is one module that is prettty much done for you - or you can buy a phototransistor/photoresistor and DIY a circuit if you wanted to learn more about how they work. But here is a module that should work https://amzn.to/2LqjDQH
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

User avatar
Burngate
Posts: 6063
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Relay - can it be used in reverse (signal microcontroller) ?

Wed Sep 11, 2019 4:51 pm

ElEscalador wrote:
Wed Sep 11, 2019 12:25 pm
You could certainly use a relay with a 100vac coil like this one https://amzn.to/2NVr0RV
Unless you're in Britain, or Europe, or other places with 230V AC

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

Re: Relay - can it be used in reverse (signal microcontroller) ?

Wed Sep 11, 2019 7:19 pm

Witch ever way you use to implement this
Project, means connecting to the AC mains
Other than using a light sensor circuit
The AC mains part of the project
Must be done by a electrician ,

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

ElEscalador
Posts: 681
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Sep 12, 2019 12:01 am

Burngate wrote:
Wed Sep 11, 2019 4:51 pm
ElEscalador wrote:
Wed Sep 11, 2019 12:25 pm
You could certainly use a relay with a 100vac coil like this one https://amzn.to/2NVr0RV
Unless you're in Britain, or Europe, or other places with 230V AC
Very true - my bad. I can't help it - as an American, I was raised that we're center of the universe. Also our new thing is to refuse to correct or acknowledge mistakes, so if everyone will just pretend that 100vac is not a typo that'd e great. Don't make me take a marker to some textbooks to prove how correct I am.
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

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

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Sep 12, 2019 8:36 am

davidcoton wrote:
Wed Sep 11, 2019 10:25 am
boyoh wrote:
Wed Sep 11, 2019 10:11 am
One safe way to interface the light to give the
Pi a input, would use a 5vdc power adapter
On the lighting circuit...
Except very few lighting circuits have provision to connect power adapters -- certainly UK lighting circuits should not normally have 13A sockets (because they cannot supply 13A).
If you go this way, get help from a qualified electrician.

EDIT: add "UK". Detailed advice will vary between countries.
I was hoping someone with common sense
Would understand that an electrician would
Be able to make safe connection to the existing
Lighting circuit for him to fit the power adapter
It then would be solid state no relays,

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
davidcoton
Posts: 4200
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Sep 12, 2019 12:26 pm

boyoh wrote:
Thu Sep 12, 2019 8:36 am
I was hoping someone with common sense
Would understand that an electrician would
Be able to make safe connection to the existing
Lighting circuit for him to fit the power adapter
It then would be solid state no relays,
In my time working as an electrician I have learnt that, unfortunately, common sense is not always available.
Advice given on this forum with respect to mains connections should never assume that readers (not only the OP) have any understanding of the dangers involved.
Signature retired

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

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Sep 12, 2019 1:08 pm

davidcoton wrote:
Thu Sep 12, 2019 12:26 pm
boyoh wrote:
Thu Sep 12, 2019 8:36 am
I was hoping someone with common sense
Would understand that an electrician would
Be able to make safe connection to the existing
Lighting circuit for him to fit the power adapter
It then would be solid state no relays,
In my time working as an electrician I have learnt that, unfortunately, common sense is not always available.
Advice given on this forum with respect to mains connections should never assume that readers (not only the OP) have any understanding of the dangers involved.
Point taken, we should never assume that a poster
Under stands the danger of working
On mains power, I hope now we can help him
With his low power project. There is to much
Emphasise on Coding than learning electronics
With the RaspberryPi There will be more
Coder then electronic engineers in the future.

BoyOh Retired Electrical / Electronics Technician
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

ejolson
Posts: 3724
Joined: Tue Mar 18, 2014 11:47 am

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Sep 12, 2019 6:09 pm

DaxTrajero wrote:
Thu Aug 23, 2018 8:05 pm
Newbie alert: Is it possible to use a mechanical relay that, when there's an AC voltage, switches the DC side of the relay? ie. someone turns on a light, and the raspberry pi is signalled

Or is the alternative to use a solid state opto-coupler and resistors?
The difficulty with all the proposed solutions is that they will detect whether the power is on but not whether the light is on. It could happen that the bulb is burned out.

Checking whether the light is on can be done with some sort of photodiode. Fortunately such parts are cheap and don't need to be connected to mains voltages. Given the dangerous uses computers can be put to, perhaps someday coding will, in general, also require a government issued license.

User avatar
davidcoton
Posts: 4200
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Relay - can it be used in reverse (signal microcontroller) ?

Thu Sep 12, 2019 8:56 pm

ejolson wrote:
Thu Sep 12, 2019 6:09 pm
Given the dangerous uses computers can be put to, perhaps someday coding will, in general, also require a government issued license.
No, the issue of licences will be privatised. That way more people can make more money out of the poor coding footsoldier.
Signature retired

Return to “Beginners”