Welcome! Log In Create A New Profile


Help with Opto sensors

Posted by philwaud 
Help with Opto sensors
July 05, 2009 05:04PM
I hacked a load of opto sensors from a couple of printers (including an awesome one which seems to work over 300mm!)

Ive tried lots of different set ups and think I may have blown a couple but as I havent had any signals at all out of them, Im stuck!

Ive written a short sketch for my new Sanguino which turns an LED on when it gets a low or high signal on one of the pins - the sketch works fine and using a normal switch it turns the LED on and off as expected.

Can anyone help and identify the correct pins on these? I have tried the great trick of looking at them with a digital camera and can confirm that the LED is working fine.

There are two basic types:-
opto1 - the sensor and LED are fixed to a small PCB - from the top, pins 1 and 2 have an SMC component between them - probably a resistor. Pin 2 goes to both ends of the opto sensor, pin 1 goes to just one end, pin 3 goes to the opposite end of the board.

opto2 - is easier to see from the picture.

I really dont want to risk blowing any more of these and would really appreciate any help that anyone has!

Thanks in advance!
Re: Help with Opto sensors
July 05, 2009 05:52PM
The 4 pin versions are an LED (anode and cathode) and a photo transistor (collector and emitter, base is not connected).

The 5 pin versions are an LED and an IC that contains a photo transistor (or diode) and a usually a Schmitt trigger.

Both have three wires, so they are probably power and ground and an output signal.

The five pin photo is clearer. The led is wired across the power rails (which also go to the chip) with a series resistor. The middle pin is the output. By putting a meter across the LED you can determine the anode and cathode. That tells you which is the positive and negative rail, usually 5V. The output may or may not need a pull up resistor to 5V to make it work. Adding one never hurts, try 10K.

I can't quite see the tracks or the resistor value on the 4 pin version. If it is a low value resistor (a few hundred ohms) then it is again in series with the LED and you can determine which two pins are the power and ground.

The transistor will either have its emitter connected to ground, in which case the output is the collector and will need a pull up to 5V, OR its collector could be connected to the 5V pin and the output is its emitter and will need pulling to ground.

Re: Help with Opto sensors
July 06, 2009 04:00PM
Thanks for the reply nophead.

Im not having much luck with this!

Ive also have an opto switch which has OMRON 1230 p8 1 0725H on the side. This doesnt have any resitors but the circuit is similar. One connection goes to both ends, the centre goes to just one and the other goes to the other end.

I wasnt getting anywhere with this one, resitors added in just about every conbination but no joy. I took the plastic casing off and there are two LED like objects but no resistors - im presuming one is an LED and the other is the sensor like you describe.

I wired this up with a breadboard to a 5v source but couldnt get the led to light no matter which way I connected them (im viewing it via my iphone camera which I am assuming will show the light?)

I must sound so stupid, but please be patient, we all have to learn sometime!

Re: Help with Opto sensors
July 06, 2009 04:18PM
Do you have a multi-meter? Most multimeters have a diode test that will allow you to determine which device is the LED and its polarity. From that you can determine whether the common is 0V or 5V.

With three terminals it is most common for the shared connection to be ground, but I have seen some where it is 5V.

You need about 330 ohm in series with the LED for 5V and a 10K pull up on the photo transistor.

Not all cameras will pick up IR. The raw elements do but good ones have an IR filter to prevent heat appearing on photos. I haven't tried myself.

Edited 1 time(s). Last edit at 07/06/2009 04:55PM by nophead.

Re: Help with Opto sensors
July 06, 2009 04:56PM
If you connected the LED to 5V without a resistor you will have destroyed it.

Re: Help with Opto sensors
July 07, 2009 02:11AM
Standard remote controls use IR, so if you point a TV remote at a camera you can see whether IR is picked up or not on the preview. Video cameras with a low light facility often use IR lighting and IR sensitivity.

Reprapping blog and other rants: [renoirsrants.blogspot.com]
My Reprap: [sites.google.com]
Re: Help with Opto sensors
July 07, 2009 03:27AM
I have been very careful not to do this, I went through a phase of popping quite a few LEDs and it started to get costly so Im more cautious now.

I have twelve sensors of five different types so its unlikely I have blown them all.
Re: Help with Opto sensors
July 07, 2009 03:28AM
Thanks, this is really useful advice (from everyone, as always!)

Ill have a play with some remotes etc tonight.

Sorry, only registered users may post in this forum.

Click here to login