infrared break beam circuit

Thread Starter

davidhoff

Joined Sep 19, 2008
66
I am looking for help with making a simple infrared break beam circuit. What I need it to do is this. When something gets in the way of the beam and breaks it, it will turn a switch on. When the beam goes unbroken, the switch turns off. It will need to be able to cycle fairly quickly (about 15 times per second). It also needs to be relatively small. I would like to avoid using a relay for the switch, because the design will see lots of vibration in use. The switch won't need to handle much power either, less than 9v and maybe a hundred miliamps max (I'm not sure exactly how much, but I know it won't be much). Any help would be awesome. An actual circuit diagram is preferred, but ANY help or pointers are appreciated! ;) Edit: I forgot to mention that this will be used in a dark place, so light interference shouldn't be a problem. If on the other hand you know how to prevent light interference and want to share, by all means do! It would be great just to know.
 

scubasteve_911

Joined Dec 27, 2007
1,203
Have you seen the standard slotted sensors? Something like the following

http://www.fairchildsemi.com/ds/H2/H21B1.pdf

It isn't enough current, but you can buffer that. Or, you can make your own. There are so many ways to do it, various wavelengths and angles of emission, photosensors (photodiodes, phototransistors, CdS cells, etc.). It's kind of an application specific process.

Steve
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
Thanks for the speedy help. That looks similar to what I'm looking for, but i need a gap of about 3/4 inch between the transmitter and receiver. Additionally, I don't know how I would hook up a part like this to control a switch. I think making it control the switch is the part I need the most help with. The specific application I'm trying to use this for is add "eyes" to a paintball gun. The "eyes" are there to detect whether a paintball is in the breech of my paintball gun, and if so, allow the trigger signal to trip the solenoid. If a ball is not present, it will not let the signal through, and the gun won't shoot.
 

FunkiiMunkii

Joined Sep 16, 2008
12
If you need a wider gap, you can just get the infrared LED and photodiode separately and connect it up like this.



The output will go fine with digital circuits, but if you need the output to drive something like a motor, you should use a transistor along with the output.
 

FunkiiMunkii

Joined Sep 16, 2008
12
I forgot the pull-down resistor in that schematic (I just updated the circuit). The NOT gate is used to make it so that the output is high when only when the beam is cut (no light reaches the photodiode).
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
WOW! Thanks so much! I've been thinking about this for weeks, wondering how it could actually be done. Thank you lots!
 

scubasteve_911

Joined Dec 27, 2007
1,203
That's an incorrect circuit. You forgot the current limiting resistor! If you hook up any LED, or laser, you need to limit/control the current.

For the switch I selected arbitrarily, you need to select the current limiting resistor, then a pullup resistor for the open-collector output.

Resistor value = (supply voltage - forward voltage of LED)/ recommended current
Pullup resistor = (supply voltage - saturation voltage of transistor) / recommended operating current (less than maximum)

Steve
 

bertus

Joined Apr 5, 2008
22,277
Hello,

There is a site (like many) for calculating the resistor for the led.
http://ledcalc.com/
Just fill in the supply-voltage, the voltage drop over the led, the current you would like to have and press calculate.
A ir led has a voltage drop of about 1.8 Volt.

Greetings,
Bertus
 
Oops! Well, usually I use 2V for the LED at which a limiting resistor isn't completely necessary. But since I did label Vdd for both, I guess I should have put the resistor. My bad. =P
 

SgtWookie

Joined Jul 17, 2007
22,230
This thread is incredibly goofy ;)

IR LEDs have lower Vf (forward voltage) than most LEDs. You'll need to consult the documentation for the particular LEDs you purchased to get the low-down.

Once you get the specs looked up for your particular diode, find the TYPICAL Vf @ current specification.
From there, you can figure your LED's current limiting resistor as:
Rlimit = (VoltageSupply - Vf(LED) ) / DesiredLEDCurrent

Let's say that your IR diode has a typical Vf of 1.3v, a current rating of 15mA and your source voltage was 5v.
Rlimit = (5v - 1.3v) / 15mA (No mysteries, right? Pretty straightforwards)
Rlimit = 3.7/0.015 (Just moving decimal places where they belong...)
Rlimit = 246.666... Ohms (Resistor of the Beast - well, choose a neighbor instead)

In this example, Rlimit would need to be 246.666... Ohms or higher to limit the current to keep the LED within specifications. Exceed rated voltages/currents at your own risk.
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
I understand how to do everything on the led side of the circuit. The question now is about the pull up resistor mentioned by scubasteve_911. What is this, and where does it go? Also, I would like to thank everyone who has posted for helping me out.
 

scubasteve_911

Joined Dec 27, 2007
1,203
Look up open-collector type outputs. Basically, the output is the collector of a transistor. You need to use a resistor to make a signal that you can use. So, the resistor goes from the collector to your logic supply voltage. When the transistor sees light, it will start pulling current through the collector-emitter junction. The output of the collector (with a pullup resistor) will go low. If there is no light, then it will remain a logic high.

Steve
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
Thanks for the explanation Steve. I'm a little bit confused however. I was planning on using a photodiode instead of a phototransistor. In the case of the diode, do I still need that resistor?
 

hgmjr

Joined Jan 28, 2005
9,027
Thanks for the explanation Steve. I'm a little bit confused however. I was planning on using a photodiode instead of a phototransistor. In the case of the diode, do I still need that resistor?
The use of a photodiode will require the addition of an amplifier whereas the use of a phototransistor in particular a photo-darlington transistor can overcome the need for an amplifier.

hgmjr
 

scubasteve_911

Joined Dec 27, 2007
1,203
Yeah, photodiodes need a thing called a 'transimpedance amplifier', which converts the current from the diode to a useable voltage signal. This is a whole new can of worms though...

Basic Photodiode selection:

-pick center wavelength of the photodiode to match your source
-calculate how much light will reach the photodiode
-then, by using the specified sensitivity in "amperes/watt", figure out how much current will flow under ideal illumination
- ensure that the dark current is sufficiently low, (signal of photodiode under illumination's ratio to dark current), should be at least 25 (absolute minimum)
- also, ensure the turn on is fast enough (in your case, any will work), this is a function of capacitance, and other factors..
- look up a basic transimpedance amplifier and set the gain to give you the voltage level you need, so if your photodiode is putting out 1mA, and you need a 5V signal, you need a gain of 5/0.001, or 5 Kohms

If you want to be absolutely sure that your source is responsible for the detection, you should module the emitter with a known frequency. Then, your transimpedance output goes into a bandpass filter. Take the output of the filter as your positive detection signal, may need to be filtered twice for a second order filter.

Or , just stick with the photo-darlington and add a mosfet for a basic on/off amp.

Steve
 
Last edited:

Thread Starter

davidhoff

Joined Sep 19, 2008
66
I'm sorry that I'm so dense, guys, but I am still confused. It is making a lot more sense than when I started though. The reason I was going to use a photodiode, is because that was in the original diagram funkii munkii posted. I'm not sure if that is what he meant it to be or not. It sounds like some kind of phototransistor would work better from what everyone else is saying. Anyway, I think I have narrowed down what I am confused about to a couple simple questions.

1) I would use either a pull up resistor OR a pull down resistor, not both. Is this right?

2) Since the whole point of this setup is to either let a signal through or stop it, does the signal I'm allowing or blocking go in at the place circled in red and come out at output? If not, then, where does my signal i'm trying to switch go? (I know there is a resistor missing, to limit current to the led. Just pretend it's there.)



3) Is this the right way to hook up the NOT gate? Circled in red is where the signal I want to block or allow goes in. Circled in green is where the signal from the phototransistor comes in. Circled in blue is where the signal I want to block or allow comes out. Circled in brown is connected to ground.



If I understand correctly, then all the answers should be yes. If not, then I don't understand what is going on with the question(s) where the answer is no. Thanks for your perseverance in helping me to understand.
 

Attachments

Top