Maker Pro
Maker Pro

LED optic sensor circuit

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
Hi - I'm a newbie here and I'm trying to fix a problem for a friend since I'm a little more mechanically/electronically inclined than he is. Here's the situation...I'm trying to repair an LED optical sensor circuit. The purpose of the sensor was to detect that a golf ball has passed down a return pipe. There were two holes drilled into a PVC pipe and LEDs were pushed through so they were directly across from each other in the pipe. The whole assembly was home built long ago by someone else and when I took it apart, all of the wires to the LEDs and the resistors were corroded so badly I could barely tell how the circuit was set up. Luckily there is an another operational sensor that works at his mini golf course so I could find out the voltage being fed to the LED and the voltage being produced during normal operation (i.e., no ball is passing through the pipe/sensor). The voltage going into the sensor is 5 volts. The voltage being produced is 800mV. Based on this I assume that the one LED is powered with the 5V and the other LED is acting as the sensor and is producing 800mV while the other LED is glowing. When I tested the other working sensor at the course, almost 5 V were produced when I blocked the LED light (i.e., simulated a ball in front of the light LED) I was expecting the voltage to go to 0 but it didn't. I don't dare take the working sensor apart since it's the only one left and it's sealed. I took some pictures of the corroded wires if interested. I included a drawing of what the wire configuration resembled but it can't be right because both LEDs would be lit. I don't know if there was another component inside that disintegrated over the years due to water getting into the components and causing a short. Any help at all on what the circuit could possibly be, would be greatly appreciated. Sorry for the bad drawing ;) Thanks!

I put the actual pics of the corroded circuit here : https://www.dropbox.com/sh/pfr0vdwhsbg008r/AACTAc96hfnv_K7mbHfMzHkKa

The yellow wire in my drawing is the white wire in the pics.
 

Attachments

  • LED_circuit.jpg
    LED_circuit.jpg
    10.8 KB · Views: 113
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Hi Lance and welcome to Electronics Point :)

OK, most probably, LED1 is an infra-red LED and "LED2" a phototransistor.

The LED is needs to be fed from a supply voltage via a resistor; this will be the top resistor in your diagram, feeding the anode of the LED on the left side of the "LED1" square.

The phototransistor will also have a resistor from its collector (the left side of the "LED2" square) to the positive supply, and the detection signal will be taken from the collector.

This matches your diagram except for the resistor that connects directly to the left side of the "LED2" box - this resistor should be replaced by a short circuit, in the usual arrangement, so that the yellow wire connects straight to the left side of the "LED2" box. Can you check your drawing? Also, can you note the band colours on the resistors?

Assuming the circuit is what I think it is, the output (the left side of the "LED2" box, which is actually the collector of a phototransistor) should be low (less than 1V relative to the green wire) when infra-red light is falling on the phototransistor. When the light is blocked, this voltage will go up to at least +4V. This fits with what you found.

Infra-red LEDs, phototransistors, and resistors are readily available; you just need to match the physical characteristics. Can you remove the old ones from the tube and upload some photos of them? Include a ruler in the photo, or give us the dimensions.

Also, tell us your location (there's a field for this in your profile) so we know which supplier to recommend, and let us know if you already have a preferred supplier for components.
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
HI - thanks for getting back to me to help me with this issue. Both LEDs 'looked' the same. I've included a picture of one of the LEDs and two of the resistors. The other LED shattered when I tried to remove it from the pipe. I can't find the other resistors.

I live in Bucks County, PA (southeastern PA).

Can you change my drawing so that I can understand what changes I need to make in the circuit?? As I mentioned, my drawing was a guess based on what I saw that was left of the physical wires/components. The resistor connected to the LED2 wasn't there but there was a rust mark on the PVC that looked like a component was there in the circuit. It was a guess on my part.

I included a picture of the yellow/white wire connection and the missing part of the connection directly to the left side of LED2.

Thanks!
Jim
 

Attachments

  • photo.JPG
    photo.JPG
    179.6 KB · Views: 121
  • photo 1.JPG
    photo 1.JPG
    111.4 KB · Views: 116
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
OK, here's what I think you probably have:

268955.001.GIF

And here's your image annotated to match mine:

LED_circuit.png
The difference is the bottom resistor, which I've drawn shorted out. I don't see any reason why there would be a resistor in that position. That's why I asked you to check that there really is a resistor in that position, and tell me the colour bands on all of the resistors. Can you use the detector that still works as a reference?

I've labelled R2 10k in my diagram because one of the resistors in your photo is 10k (brown black orange) and that's a likely value for R2 (but not for R1). I can't read the colours on the other resistor in the photo.

Your IR LED and phototransistor look like they're in standard 5 mm LED packages, called "T1 3/4". If you have a local Radio Shack, these components may be suitable: http://www.radioshack.com/product/index.jsp?productId=2049723 but the reviews are very mixed so read them first! If you want to be sure of what you're getting, these parts from Digikey should be suitable, and cheaper, but their delivery charges can be quite high. They both have peak response at 940 nm (infra-red region).
LED: http://www.digikey.com/product-detail/en/IR333-A/1080-1080-ND/2675571
Phototransistor: http://www.digikey.com/product-detail/en/PT334-6B/1080-1158-ND/2675649
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Interesting reading the reviews on that Radio Shack product. People disagree on which is the emitter and which is the receiver. I would expect that the receiver is the dark one, since the coloring would be to block visible light and make it sensitive only to IR. But many of the reviewers insist that it is the other way around, even though the package labeling agrees with me. Who knows?

Bob
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
[Thanks for the diagram - that's great. Yeah, I guess I should have made sure my shadow wasn't cast over the resistors when I took the pic. I posted a better pic. Looks like one is Brown-Black-Orange-Gold - I guess that's the 10K and the other looks like Brown-White-Brown-Gold or 190 - does that look right to you??

I'll try those LEDs from radio shack since they're only 4 bucks.

Thanks so much for your help. I'll let you know how I make out.
 

Attachments

  • photo_res.JPG
    photo_res.JPG
    109.1 KB · Views: 171

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Interesting reading the reviews on that Radio Shack product. People disagree on which is the emitter and which is the receiver. I would expect that the receiver is the dark one, since the coloring would be to block visible light and make it sensitive only to IR. But many of the reviewers insist that it is the other way around, even though the package labeling agrees with me. Who knows?
Yeah. It's pretty funny looking through all the different opinions. In my limited experience, IR LEDs are normally water clear, and IR phototransistors are normally tinted. But the Everlight LED from Digikey that I recommended is apparently tinted blue. The matching detector is tinted dark though. So I guess there's some variation.

Considering that Radio Shack probably buy whatever they can get the cheapest, it could even be that they changed at some time. I can just imagine the buyer at Radio Shack buying a pack of 5000 no-name devices from Shenzhen on eBay! That would explain the lack of manufacturer name, part number, and detailed documentation! LOL :)
[Thanks for the diagram - that's great. Yeah, I guess I should have made sure my shadow wasn't cast over the resistors when I took the pic. I posted a better pic. Looks like one is Brown-Black-Orange-Gold - I guess that's the 10K and the other looks like Brown-White-Brown-Gold or 190 - does that look right to you??
I think it's orange white brown - 390 ohms. That will run the LED at around 10 mA which is a sensible value.

Have you come to any conclusion about the third resistor in your diagram? Have you had a close look at the sensor that still works?
I'll try those LEDs from radio shack since they're only 4 bucks.
Yeah, provided that they have it in stock locally, or can deliver it cheaply. Otherwise you're probably better to go with Digikey, or some other e-tailer like Mouser, Newark Element 14, Jameco, or Fry's Electronics.
Thanks so much for your help. I'll let you know how I make out.
Cool :)
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
I was at radio shack before I saw your latest post. I actually got the 190 ohm resistor instead of what you think should be the 390. I measured it with my MM before I went and it was 190. Also, Radio Shack didn't have a 190 so I got a 220.

The conclusion I had about the 3rd resistor is that there probably wasn't one. I couldn't tell as that part of the circuit has disintegrated and there was just a rust mark on the pipe. So I'm leaving it out as I think you're correct that it doesn't make sense

Anyway, I bought the components at radio shack and hooked them up in the pipe. I made some readings and it didn't appear to matter if the sensor was blocked. The collector read .25 volts out of the package in normal light. When I gave the circuit 5V, the output reading went from .25V to .5V. I was hoping it would go close to input voltage value but no dice.

I put the circuit on a bread board and it appears to measure the same voltages as in the pipe. I've included a picture of the circuit on the bb. Also, The dark (transmitting LED) does not light. I don't know if that's normal and It produces waves I can't see. ?? Let me know if you see anything I have screwed up in the circuit.

As far as checking the other working sensor, I can't get to the components of that sensor as they are sealed inside an outer pipe that is 'weather-proofed'. I'd have to break the whole assembly apart. I'm afraid if I do that I'll have NO working sensors :)

Thanks
 

Attachments

  • bb_led.JPG
    bb_led.JPG
    140.1 KB · Views: 129
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
One of the resistors is connected wrong. Both of them should have one end connected to the +5V rail.

You need to find out which device is the LED and which is the phototransistor. If you have a cellphone with a camera, it will "see" the infra-red light. Try both devices in the left hand position in that photo, that is the position where you have the dark device in the photo. The wire on the side that has the flat part on the skirt should connect to 0V (blue wires). Test with a cellphone or other electronic still camera or video camera.
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
I also followed your circuit diagram and hooked up the sensor on the pipe. I took voltage measurements while the power was connected. I attached a pic of the test points and the voltage readout. The clear LED is the phototransistor. I blocked the sensor with a rag and there was no voltage change on the ouput. clearly I'm doing something wrong


I also took some pics of the circuit on the pipe - please excuse the ugly wiring as I was switching the stuff back and forth from the bb to the pipe. ;)
 

Attachments

  • voltage_readings.jpg
    voltage_readings.jpg
    16.9 KB · Views: 168
  • hookup.JPG
    hookup.JPG
    137.4 KB · Views: 123
  • hookup_b.JPG
    hookup_b.JPG
    170.2 KB · Views: 124
Last edited:

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
If those are your voltage readings, I think you have the LED and phototransistor reversed.

Did you try looking at it with a camera as Kris suggested?

Bob
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
OK, there's a problem: the voltage on the anode of the LED cannot be 4.3V as you've shown in the diagram. My guess is that you have the LED and the phototransistor exchanged. That could also explain why you measure 0.5V on the phototransistor collector.

The photos of the pipe look OK. I assume that the other wires of the two devices are connected together and to the black wire?
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
Thanks for hanging in there guys especially when it seems like I'm not making any progress. OK, so I switched the LED and the phototransistor and decided to put it on a breadboard to avoid the soldering over and over. I've attached pics of the breadboard setup. When the input is 5V, all of the test points that I listed in the previous picture are basically 5V.. On the breadboard 5V was measured at I16, I9, H9, H16. H24 and I24 measured 4.96V. Kris, can you verify that I have the bb setup correctly this time?
As far as testing it with a camera, I assumed that Kris meant measuring the voltage on the phototransistor while pointing my iphone camera at it - is that right?? If so, I didn't see any voltage change on the phototransistor when I pointed my phone in camera mode at it. At room light, the phototransistor read about 10 mV. When I shined my flashlight directly at the phototransistor, the voltage jumped to 1.1V.
 

Attachments

  • photo1bb.JPG
    photo1bb.JPG
    148.1 KB · Views: 112
  • photo2bb.JPG
    photo2bb.JPG
    142.8 KB · Views: 133

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
I think Kris was suggesting that you might be able to see the LED glow if you look at it using your cellphone camera.

The LED and the phototransistor ate all polarised components so you have to know both which is which and get them oriented correctly.

Assuming the supply is 5v, you could try each of the 8 permutations to find the best (two will work, but one will be best). Fortunately 5v is low enough that connecting them the wrong way won't kill them.

You can speed that up by identifying the IR LED first, because that only leaves you with 2 options for the orientation of the phototransistor -- one of which will be better than the other.

So, in short, identify the LED first using your phone camera, then get the best orientation for the other part (which must be the phototransistor).
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, exactly what Steve said.

Cellphone cameras (all digital cameras) respond to infra-red light, so you'll be able to see the IR LED glowing when you get it round the right way.

I think the phototransistor has its leads reversed in those recent pics. The flat section on the skirt is probably the emitter, and if so, it should connect to 0V.
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
I couldn't see any difference in either of the components looking at it via the camera. I applied +5V to the 220 ohm resistor and connected the resistor to the longer leg of the LED. I have two each of the LEDs and phototransistors and I tried all 4 and nothing looked different. I even switched the resistor to the shorter leg and tried all 4 again - I couldn't see any change. I tried a regular LED that I had laying around an it worked fine.

To try to distinguish the LED from the phototransistor, I tried the following: I hooked one component up to the 5V and the other read the other component out of the circuit on the DMM. The only major difference I saw was when I hooked the tinted component up as the LED. I attached the clear component to the DMM and it initially read 255 mV. I moved the clear component over the tinted one and the voltage jumped to 325mV. That made me think the tinted is the LED and the clear is the phototransistor. I tried switching the components and did the same test. There was no change on the DMM when I put the components across from each other.

Can you tell me what you think the voltage readings should be at the test points in the previous picture when +5V is applied??

Thanks,
 

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
I've used those combo packs from RadioShack and IIRC the tinted one is the LED and the clear one is the sensor, which is actually a photodiode, not a phototransistor.

While all camera sensors can "see" IR, some cameras have IR filters in the lens that prevent them from responding to IR light. You may need to try another camera.

One way to tell which is the photodiode is to connect it to a voltmeter and shine light on it. The photodiode will generate a small voltage when illuminated. The LED will too, but not as much. Another way is to use the diode-test function on your multimeter. Connect the photodiode so it's reverse biased (shows a high or infinite voltage drop), then shine a light on it and see if the voltage drops.

As for using the photodiode, it can be operated in two ways. One is in photovoltaic mode, where it's not presented any voltage, and the small voltage generated by the diode is sensed. The other way is to reverse-bias the photodiode with a small voltage (such as 5v, with a current-limiting resistor), and it conducts a current when illuminated. The latter is the more common way, and is closer to the way a phototransistor circuit would work.

If the old circuit used a phototransistor, you can connect the photodiode's anode to the base of a NPN transistor and the cathode to the emitter, then you have something that functions much like a phototransistor.
 
Last edited:

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
I tried the diode test on both components.

1. tinted component - hooked leads up to DMM - display showed '1' or open. shined light - no change. switched leads and shined light - no change

2. clear component - hooked leads up to DMM 0 display showed 617. Shined light - display changed to 670. reversed biased the leads and the display read '1' or open. Shined light and the display read -300

Based on this, does this prove the tint component is the LED and the clear one is the photodiode?

I also could not see anything from the emitter using my iphone camera or my old Sony videocamera. I tried two different tinted LEDs and couldn't see any 'purple' light. Could that mean that those components could be blown?

If this is a photodiode, would this not produce the results I was looking for in my initial post? Do I need to get an actual phototransistor in order to get those results?? Again, the results I'm looking for is a voltage of 800 mV when the sensor path is clear and 4-5 volts when the sensor path is blocked (i.e. golf ball has passed sensor)

Thanks
 
Last edited:

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
Does your Sony video camera have a "nightshot" mode? If it does, use that mode, and cover over the IR light on the camera. You should see the LED light with that.

When you tested the LED, you used a resistor in series, right? If you didn't, you could have blown it.

Try reverse biasing the photodiode with a 10k resistor in series to a 4-5 volt power supply. Connect your voltmeter across the photodiode's leads. See what voltage you get with the diode darkened, and again with it illuminated. You could even use that to test the LED. Put the LED and photodiode facing each other, wire the photodiode to your voltmeter as described above and then connect and disconnect power to the LED and see if the photodiode "sees" the LED's light.

photodiode.PNG
 
Last edited:

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
I connected the photodiode as you suggested - reverse biased and +5V supply and the resistor. It measured 5volts. I shined my flashlight directly onto the photodiode and the voltage went practically to 0

I hooked up the LED and moved the photodiode very close - there was no change in voltage. I did this to both of the 'tinted' components. I then tried a normal LED and when I moved the photodiode close, the voltage dropped by about 2 mV

I just found another camera and when I plugged in both 'tinted' LEDs, I could see a little purple light on each so I guess they are emitting. I'm not sure why the the photodiode is not detecting it since the voltage doesn't change at all when I put the two components almost head to head

Thanks
 
Last edited:
Top