wobinb
Posts: 6
Joined: Sat Oct 20, 2012 1:32 pm

3 wire Retroreflective Photoelectric Sensor Switch

Sat Oct 20, 2012 1:44 pm

Hello,

I have purchased a retroreflective photoelectric sensor switch from ebay, it runs at 10-30 volts. I would like some advice on how to connect it to the GPIO connector on the raspberry pi.

I have connected the switch to a 12volt supply, the switch has three wires +, - and the third wire becomes live (at 12volts - i guess) when the switch is activated. So I'm guessing I need to reduce that voltage in order to not fry the pi.

The end objective is to connect two of these sensors and measure the time between them being tripped, to make a rudimentary speed trap.

Any advice greatly received.

Robin

huskybloke
Posts: 2
Joined: Sat Oct 13, 2012 7:26 am
Location: Essex

Re: 3 wire Retroreflective Photoelectric Sensor Switch

Sun Oct 21, 2012 8:57 am

hi
A safe and easy option is to use the 12volts output from the sensor to power a small relay which can then switch whatever voltage the pi likes.
This gives the element of isolation between the 12volt and the pi.
You might also consider a small diode (1n4001) across the relay coil to protect the sensor.

http://www.ebay.co.uk/itm/10-Pcs-DC-12V ... 1e733c4bf5


http://www.ebay.co.uk/itm/20-x-1N4001-R ... 484542760c

wobinb
Posts: 6
Joined: Sat Oct 20, 2012 1:32 pm

Re: 3 wire Retroreflective Photoelectric Sensor Switch

Sun Oct 21, 2012 8:35 pm

thanks for the help, I have ordered the parts so lets see....

What do you mean by putting the diode across the coil?

I'm assuming you mean in the 12 volt circuit, in series with the relay?

Regards

Robin

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

Re: 3 wire Retroreflective Photoelectric Sensor Switch

Mon Oct 22, 2012 9:54 am

wobinb wrote:What do you mean by putting the diode across the coil?

I'm assuming you mean in the 12 volt circuit, in series with the relay?
NO! In parallel with the coil!

At the point when the sensor decides to switch the current through the coil off, the inductance of the coil tries to keep the current flowing.
With nowhere to go, that current builds up a large negative voltage, which could damage something.
The diode provides the current with somewhere to go, and so prevents the negative voltage building up.

wobinb
Posts: 6
Joined: Sat Oct 20, 2012 1:32 pm

Re: 3 wire Retroreflective Photoelectric Sensor Switch

Sat Oct 27, 2012 12:13 pm

so something like this?

Image

many thanks for all the help so far

Robin

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

Re: 3 wire Retroreflective Photoelectric Sensor Switch

Mon Oct 29, 2012 8:59 am

Yes, precisely that

Joypipe
Posts: 1
Joined: Mon Jan 28, 2013 10:12 pm

Re: 3 wire Retroreflective Photoelectric Sensor Switch

Mon Jan 28, 2013 10:33 pm

How did your project go?

wobinb
Posts: 6
Joined: Sat Oct 20, 2012 1:32 pm

Re: 3 wire Retroreflective Photoelectric Sensor Switch

Thu Jan 31, 2013 6:45 pm

I ended up putting that project on hold - thanks for all the help tho.

I ended up building a raspberry pi big trak robot. I'm currently building mk2, once that is built I'll share it here.

Return to “Automation, sensing and robotics”