Maker Pro
Maker Pro

LED optic sensor circuit

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
That'll work if the base lead is available on the phototransistor. I don't think it is on the RadioShack one. It's just a 2-lead T1 3/4 case similar to an LED.

In any case, it should work "as-is". A lower voltage drop gives a larger margin of error. You can use a higher value resistor to "dim" the LED as well. It'll be plenty fast enough, adding a B-E resistor will make it faster, but that only matters if you're dealing with microseconds time frames. The ball will probably take 1/10 second to pass at least.

Have you tested it in the ball tube yet? Make sure to test it in the dark (no ambient light hitting the tube or phototransistor) to ensure the LED is "shining" enough IR on the transistor to keep it "on" with no ambient light entering the tube.

Since you have the photodiode already, it would be interesting to test it with a transistor to see if it performs similarly.

I was going to mention if ambient light will cause a problem, but since you're sensing the blockage of light, the ball would block out the sun as well when it drops into the tube, so that shouldn't be a problem either. :)
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That'll work if the base lead is available on the phototransistor. I don't think it is on the RadioShack one. It's just a 2-lead T1 3/4 case similar to an LED.
No, the detector is a photodiode and the transistor is just a 2N3904 or similar.
It'll be plenty fast enough, adding a B-E resistor will make it faster, but that only matters if you're dealing with microseconds time frames. The ball will probably take 1/10 second to pass at least.
It's not just the speed that's the issue. Without a resistor, it may be too sensitive to light and it might never turn off. I agree it'll probably be fine, but now's the chance to do it properly.
 

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
Ok, I thought you were referencing the phototransistor the OP purchased on his last trip to RadioShack (post #39). I think he's planning to use that instead of the photodiode + 2n3904 circuit, and from what I've seen on the website it's a 2-leaded part with no base lead.

Sensitivity can be verified and tweaked by installing the LED and phototransistor into the ball tube and testing it in a darkened environment. After verifying the voltage at the phototransistor is 800 mV or less while unblocked and the LED shining on it in the dark, test it in sunlight to ensure that doesn't cause an issue if it's too sensitive. I don't think it will since the ball would tend to block the sun from hitting the sensor at the same time it blocks the LED.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Ok, I thought you were referencing the phototransistor the OP purchased on his last trip to RadioShack (post #39). I think he's planning to use that instead of the photodiode + 2n3904 circuit, and from what I've seen on the website it's a 2-leaded part with no base lead.
Oh, you're right! I thought he was talking about adding the transistor to the photodiode he already had. I've probably really confused him now!

Jim (the OP), you could do what I suggest if you go back to using the photodiode, with a separate transistor. You could prove for sure that the photodetector from the LED+detector package is actually a photodiode and that it works, and you would be able to vary the detector sensitivity. I don't know whether that would be helpful.
Sensitivity can be verified and tweaked by installing the LED and phototransistor into the ball tube and testing it in a darkened environment. After verifying the voltage at the phototransistor is 800 mV or less while unblocked and the LED shining on it in the dark, test it in sunlight to ensure that doesn't cause an issue if it's too sensitive. I don't think it will since the ball would tend to block the sun from hitting the sensor at the same time it blocks the LED.
Right. He just needs to test it in the brightest sunlight and make sure the ball is detected.
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
Cool! That's great.
adjust it for maximum resistance, then connect it between base and emitter of the transistor. Power up the circuit. The collector voltage should still be low (< 500 mV) like it was before you made the changes. Turn the trimpot until the voltage starts to climb quickly. If possible get the voltage around 800 mV. Disconnect the trimpot and measure its resistance, buy the closest resistor you can find, and install it permanently. Change the LED resistor back to 220 ohms.
I don't know what you mean between 'base and emitter of the transistor' - I installed a phototransistor. I bought a transistor but didn't add it to the circuit since the phototransistor from RS worked.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I don't know what you mean between 'base and emitter of the transistor' - I installed a phototransistor. I bought a transistor but didn't add it to the circuit since the phototransistor from RS worked.
Yeah, sorry. kpatz put me on the right track. See post #44.
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
I don't know what you mean between 'base and emitter of the transistor' - I installed a phototransistor. I bought a transistor but didn't add it to the circuit since the phototransistor from RS worked.


OK - makes sense now that I saw the previous two posts AFTER I posted previous question.

I'd still like to get the 160 mV closer to the 800mV but I understand what you mean about the digital input. I guess I'll wrap this baby up and try it at the course.

Thanks,
 

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
I'd still like to get the 160 mV closer to the 800mV but I understand what you mean about the digital input. I guess I'll wrap this baby up and try it at the course.
I wouldn't worry about the 800mV. The closer to 0V you can get while illuminated/unblocked, and the closer to 5V while unilluminated/blocked the better.

Assuming the input circuit is a Schmitt trigger digital input, the low threshold is probably ~1V and the high threshold somewhere in the 3-4V range. Do you know what this circuit is controlling/triggering?
 

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
Assuming the input circuit is a Schmitt trigger digital input, the low threshold is probably ~1V and the high threshold somewhere in the 3-4V range. Do you know what this circuit is controlling/triggering?

The circuit sets off a light and an alarm at the clubhouse to let the clubhouse know that someone has won afree game on the 19th hole. The person in the clubhouse then hits a reset button to turn off the light and alarm.
There is an electrical box outside the 19th hole with a lot of components in it. I didn't get a chance to look to see what they all were. I just disconnected the pipe and took the sensor home since it was clear the sensor was bad
 
Last edited:

Lance Mannion

Jun 9, 2014
37
Joined
Jun 9, 2014
Messages
37
My parts came from Digikey so I decided to give those a try. They actually seemed to work better than the parts from Radio Shack. With the infrared LED and the phototransitor from Digikey, The initial reading before dropping the ball was 200 mV. With these components, the voltage jumped a little higher on the meter when I dropped the golf ball down the pipe.

I tried the sensor out at the golf course...worked like a charm!!! I'm now sealing it up and will do the full install soon.

Thanks for your help!!!
 
Last edited:

Rick L

May 21, 2014
14
Joined
May 21, 2014
Messages
14
Job well done!
I personally find little projects like this very satisfying, find the problem, figure out what it is supposed to do, make it work again. Thanks for sharing. :)
 
Top