infrared break beam circuit

Thread Starter

davidhoff

Joined Sep 19, 2008
66
The mysterious circuit board is from a paintball gun that uses a solenoid to actuate the firing mechanism. The IR led and phototransistor will go in holes drilled into the breech. When a paintball is in the breech, the phototransistor will be blocked, and the mosfet will be on. When the breech is empty, the mosfet will be off. The supply and drain pins of the mosfet will be wired up to the board to intercept the signal that the board sends to fire the solenoid (this signal is small and I'm about 90% sure it's dc). This way, the gun won't try to fire unless there is a paintball in the breech. This keeps it from firing before a paintball is completely in the breech, which would cause the bolt to hit the ball and jam. I don't know a whole lot more about the "mysterious circuit board," but I do know it runs off of a 9v battery. If I were to run everything off of the same 9v battery the mystery board runs off of, could that avoid the problem with the 2 batteries all together?
 

jpanhalt

Joined Jan 18, 2008
11,087
Just a couple of added comments on the circuit:

1) You don't need a resistor from emitter to ground on the common emitter transistor that turns off the mosfet.

2) 100K on the pull up seems a bit high and will slow turn on, which might cause the mosfet to heat more, depending on the current. I would size it appropriately for the transistor current capability, battery capacity, and duty cycle.

3) I would go with a single battery, unless the IRED emitter and detector need to be separated by a great distance (>1 meter).

John
 

scubasteve_911

Joined Dec 27, 2007
1,203
John,

I already suggested all but 3 :p

David,

Your circuit will work fine with the lowering of the resistors and consolidating to the battery. Depending on your battery type, the voltage may vary significantly, so I would add a voltage regulator to keep it stable. The voltage varying would cause varying amount of light through the IR LED.

Steve
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
Thanks for the input, guys. I have swapped out the 100k resistor for a 22k resistor. Is that more appropriate for this application? As for the common emitter resistor, I have taken that out. In regard to the battery thing, I think that is what I'm going to do. It seems like the best solution. I don't think voltage variation will be a big problem, because they led and phototransistor will only be approximately 1 inch apart, and in a dark place. If I find it to be a problem, I can add one later.
 
Last edited:

jpanhalt

Joined Jan 18, 2008
11,087
That so-called pull-up resistor is the equivalent of a gate resistor in a typical mosfet driver. The values for such are generally less the 100 ohm; however, that might lead to too much current for your transistor and, depending on duty cycle, drain the battery really fast.

How much current will your mosfet be driving? If it's not much, then 22K will probably work. If you get heating, then consider reducing it to 1K.

John
 

scubasteve_911

Joined Dec 27, 2007
1,203
Originally, I suggested this equation for finding the minimum value you should use for the pullup.
Pullup resistor = (supply voltage - saturation voltage of transistor) / recommended operating current (less than maximum)
As John said, you don't want to have it too low, otherwise you might have an unnecessary battery hog. It's actually a tradeoff of conduction losses versus switching losses.

goodluck,

Steve
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
I'm not sure what the saturation voltage or max current of the transistor are. What would those be labeled as on the packaging?
 

jpanhalt

Joined Jan 18, 2008
11,087
You can find that information on the datasheet for the component. Here is the datasheet for MPS2222A. In general, it is a good idea to check the manufacturer's site for updates, but that is probably not necessary in this case. John
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
I have information just like that on the little package it came in, but I don't know what it means. Which ones are these?
saturation voltage of transistor
recommended operating current
 

scubasteve_911

Joined Dec 27, 2007
1,203
There's actually a tiny bit more information needed, since it's a darlington arrangement. I would revert to experimental values, especially without good specs for the phototransistor and calculating how much light is getting to the transistor.

Steve
 

jpanhalt

Joined Jan 18, 2008
11,087
Let me first say I have never used or seen a paint ball gun; although, I have a general idea what they are. In the fresh light of morning, here are some additional thoughts on the matter:

1) Re: batteries. Is the firing solenoid run off the same type of 9V battery that is used for the logic/safety?
2) Is the breech generally empty until just before firing, or is it reloaded after each shot, so it is usually loaded? If it is generally empty, then you want low current in the logic when the mosfet is off. If it's generally loaded, then you would want low current when it is on, which is as your circuit is currently.
3) It seems the mosfet turns on under no load conditions. That is, while turning on, it is simply making the circuit ready to fire and is not actually conducting the firing current. If that assumption is correct, then the pull-up resistor can be fairly large, because the mosfet will be conducting negligible current (drain-source) during the turn-on period. A larger resistor will minimize battery drain when the mosfet is off. Conclusion: go with what works. If the 22K works, I would stick with it. If not, you have a large range of values to experiment with. You might try 1K.
4) Your transistor is rated at 600mA current (Ic). The pull-up resistor would have to be around 13 to 15 ohm to exceed that, and you would have a very short battery life. So, current limitation by that transistor is not an issue.
5) Which mosfet are you using?

I hope these thoughts are helpful and not too redundant. My advice at this point would be to try your circuit with the actual firing solenoid and focus on whatever problems arise then.

John
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
In response to your questions:
1. Yes, everything is run off the same battery.
2. As soon as the gun fires, a new shot is loaded and sits there until you fire again.
3. That is correct. The mosfet just connects the path so that when you pull the trigger, the signal to fire will be let through.
4. Ok.
5. It is an IRF510 power mosfet transistor N-channel 60-V, Radioshack part number 276-2072.

My plan is to test it out in the real setup next. I can't do it right now, because I can't have my paintball gun at school. Next chance I get, though, I'm going to try it out with everything set up for real.
 

Thread Starter

davidhoff

Joined Sep 19, 2008
66
update: Over last weekend, I was able to go home and install the circuit into the paintball gun. I tested it out and it works great. After some testing, I discovered I didn't need the led to be full brightness for the system to work. So, I upped the resistor that limits current to the led to save a little power. Everything is working great. The only thing I'm not sure about is battery life. Hopefully this weekend I will be able to go play with it and see how long it lasts on a new battery. Thanks everybody!
 
Top