LED Synch Strobe, circuit question

Thread Starter

Fuel

Joined May 12, 2010
4
BACKGROUND: I am developing a circuit that uses an infrared LED emitter/detector pair to synchronize a strobe effect with an LED. It's for strobing an animation toy (a phenakistoscope- the toy is a cardboard disc with slots cut in the outer edge, creating control of the IR on/off as it spins.)

I'm also using an NPN (2N2222) as a switch, have resistors, and am using a 9v on the "detector & LED" side. The "emitter" is on a separate circuit.

QUESTION: I'm trying to incorporate a larger array of LEDs to create a brighter light for a larger disc. The circuit I have works okay if the on/off is slow (disc spins slowly), but the LEDs barely light up when the disc spins faster.

Could someone please look at my circuit and offer suggestions / insight, please?

thanks-
fuel
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
First, did you know that there are commercially available IR emitter/phototransistor pairs in an assembly called a photointerruptor? That would make your construction a bit easier, as you wouldn't have to assemble as many items, and it would be easier to take care of ambient light.

Secondly, phototransistors generally have rather low current source/sink capabilities. You would be better off to either use a Darlington transistor, or use the output to control the voltage on the gate of a MOSFET. With either, you will need to limit the output current of the phototransistor so that you don't damage it.

Thirdly, when the wheel is spinning, you have a PWM effect on the LEDs. You really shouldn't exceed the recommended current for the LEDs, as they will become dim much sooner than they should.

[eta]

Your schematic was really drawn rather upside down and backwards, so it didn't register right away that you don't have things hooked up quite right.

I've edited your image to more closely represent commonly accepted methods of drawing schematics, and corrected the 2N2222 connections.

The 2N2222 resistor will turn off more quickly if a pull-down resistor is used from the base to the emitter; value about 5x that of the resistor to +9v (not including the phototransistor)

 

Attachments

Last edited:

Thread Starter

Fuel

Joined May 12, 2010
4
hi Sgt-

thank you for the response. I pre-made the circuit based on your re-draw, and it works nicely. It was working the way I had it drawn, but the NPN base was evidently not supposed to be wired that way. Regarding my issue of the LEDs dimming, your suggestion about being aware of not going over the current because of the PWM-style use of the transistor switch... I am guessing that diagnosing the PWM that my wheel device is generating would require an oscilloscope?

I'm not yet familiar with all the bits and parts you suggest, so I looked up PWM, MOSFET, Darlington Pair, and pull-down/pull-up resistors. The MOSFET looks like a great option as a switch.

I'm not clear at all on the pull-down resistor and how I could put that resistor "between" the base and emitter. Could you clarify?

I am self-teaching, so a little of the upside-backwards happened. But it also happened because I was drawing it out with the idea that current is technically flowing from a negative state, isn't it? I read that the description of current moving from "positive to negative" is a misnomer (Ben Franklin and others,) but has fallen into such common use that it's maintained as a practical reference now. Sometimes I see schematics that address this, and will show resistors placed on the "negative" vs the positive, and I understand it as because of that. I guess that it's preferred to be the other way around.

thanks again,

fuel
 

Bernard

Joined Aug 7, 2008
5,784
For now stick with electron flow, ie, from battery neg thru load to battery +. What color are LEDs, white LEDs @ 20 mA at about 3.3V will need more than 9V for 3 in series, or use only 2 per series string & 120Ω. With 12V & 3 LEDs, use 100Ω. To keep from smearing image, keep slot narrow with respect to block, & I would over current LEDs to maybe 50mA on pulses. For the photo transistor collector resistor-560Ω & 5.6kΩ emitter to ground, battery neg, 2n222 base to photo. emitter.
 

SgtWookie

Joined Jul 17, 2007
22,230
I re-made the circuit based on your re-draw, and it works nicely.
Good. :)
It was working the way I had it drawn, but the NPN base was evidently not supposed to be wired that way.
Nope; you had some connections swapped around.
About the way you had it drawn...
Generally, schematics are drawn so that more positive voltages are near the top of the schematic, more negative towards the bottom.
Also, inputs come from the left, and outputs are towards the right.

Drawn in this way, schematics can be read similarly to how one reads an article in a newspaper or magazine; left to right, top down. It's simply much more readily understood if it conforms to conventions.

There are exceptions to the rule, of course - such as H-bridges, which are more readily understood when presented much as a butterfly; as the sides of the H-bridge are symmetrical; yet mirror images of each other.

Regarding my issue of the LEDs dimming, your suggestion about being aware of not going over the current because of the PWM-style use of the transistor switch... I am guessing that diagnosing the PWM that my wheel device is generating would require an oscilloscope?
Basically, you need to ensure that the maximum LED current cannot be exceeded by checking the calculations you made for your resistors.

I see that you have used 9v on your schematic. If that means you are using a 9v "transistor" battery, it won't last very long due to the current demands of the LEDs.

But basically, to calculate the current limiting resistor (Rlimit) in each series "string" of LEDs:
Rlimit >= (Vsupply - (Vf_LED x Number_of_LEDs_in_string)) / Desired_Current
where:
Vsupply = your supply voltage, which is shown as 9v on your schematic.
Vf_LED = the typical forward voltage of the LEDs that you are using, at the desired current.
Desired_Current - this should be the current that the typical forward voltage was specified at.

For example, if your LEDs were rated for 2.5Vf typ @20mA, and you have 3 in series per string, using 9v for a supply, then:
Rlimit >= (9v-(3*2.5))/ 20mA
Rlimit >= (9-7.5)/.02
Rlimit >= 2.5/.02
Rlimit >= 125
Now you consult a table of standard values of resistance; one is here:
http://www.logwell.com/tech/components/resistor_values.html
Bookmark that page.
Looking at the E24 (green) columns, we find that 125 is not a standard E24 value. The closest value >= 125 is 130 Ohms.
Using 130 Ohms with our intermediate result of 2.5V, we can determine what the current will be:
I = E/R, or Current (Amperes) = Voltage/Resistance (Ohms)
I = 2.5/130
I = 19.2mA (rounded off) - that's close enough.

Now you need to determine the power rating for the resistor.
P=EI, or Power in Watts = Voltage x Current.
P = 2.5 x 0.0192
P = 48.1mW (rounded up)
For reliability's sake, you double the result - otherwise the resistor may be very hot.
48.1mW x 2 = 96.2mW. You can use a 1/10 W resistor or larger (1/8W, 1/4W, 1/2W, etc.)

The IR emitter can be calculated similarly.
If the IR Emitter came from Radio Shack, don't put more than 20mA through it. The package might say 100mA, but it was labeled by untrained monkeys.

If you don't know what the specifications are, then err on the cautious side. We'll say the emitter has a typical Vf of 1.2v @ 20mA, and you are powering it with 3v.
Rlimit >= (3v-1.2v)/20mA
Rlimit >= 1.8/.02
Rlimit >= 90
I'll leave it up to you to find the most appropriate resistor and wattage rating.

I'm not yet familiar with all the bits and parts you suggest, so I looked up PWM, MOSFET, Darlington Pair, and pull-down/pull-up resistors. The MOSFET looks like a great option as a switch.
They are quite popular nowadays.

A couple that are quite handy are the IRLD014, the IRLD024, and the IRLD110. These are small logic-level N-channel power MOSFETs that come in a 4-pin DIP package, which make them great for breadboarding and interfacing with TTL. They will sink 1.7A, 2.5A, and 1A respectively. The first two are rated for 60V, the 110 is rated for 100V.

I'm not clear at all on the pull-down resistor and how I could put that resistor "between" the base and emitter. Could you clarify?
Whatever the value of the base resistor, multiply that value by five, and select the nearest standard value to use for the pull-down resistor.. Connect one end of the resistor to the transistor base, and the other end to the emitter. That's it.

I am self-teaching, so a little of the upside-backwards happened. But it also happened because I was drawing it out with the idea that current is technically flowing from a negative state, isn't it? I read that the description of current moving from "positive to negative" is a misnomer (Ben Franklin and others,) but has fallen into such common use that it's maintained as a practical reference now. Sometimes I see schematics that address this, and will show resistors placed on the "negative" vs the positive, and I understand it as because of that. I guess that it's preferred to be the other way around.
I tend to go with "conventional flow".

In single-supply projects, the supply return is generally used as the ground reference - with a few notable exceptions, such as ECL (Emitter Coupled Logic, popular in the 80's when TTL and CMOS were rather sluggish in comparison). In some projects, such as those using a mains-powered transforrmer/bridge/filter/regulator supply, one may actually ground the supply return to help guard against faults.

It is generally a good idea when possible to have current limiting resistors between the power "rail" that is furthest from the ground reference; as in case of an accidental short, the resistor will likely limit the damage.
 

Thread Starter

Fuel

Joined May 12, 2010
4
Thank you SO much for the thorough explanations and attention. This helps me out tremendously, and I'm excited to get it going and make it work. :)
 

SgtWookie

Joined Jul 17, 2007
22,230
One thing that I neglected to cover is a phenomenon known as "transistor saturation."

Transistors are current controlled devices. In a common emitter configuration (like in your circuit) current supplied to the base controls the current in the collector.

In the linear mode, the hFE (gain, beta) of the transistor is used; the hFE of a 2N2222 might range from 100 to 250 or so.

However, you want to use the transistor in saturation. In this context, "saturation" means that increasing the current in the base does not result in a corresponding increase in collector current. That is because Vce (voltage on the collector with respect to the emitter) is as low as it can go.

When calculating current required for saturation, the generalized formula is:
Ib = Ic/10
where:
Ib = base current
Ic = collector current
10 = forced beta/gain (you will find that most general purpose transistors use Ib=Ic/10 for their saturation plots.)

You are showing three parallel strings of LEDs, each draws 20mA current.
So, you have 3*20mA = 60mA load current, which is the desired collector current.
You need a base current of Ic/60mA, or 6mA.
As mentioned in my prior post, your phototransistor is probably limited to around 8mA current; you will need to check your specifications.

If you can safely get 8mA out of it, you can even add another parallel string of LEDs.

Since Ib=8mA, Ic=Ib*10=80mA maximum. 80mA/20mA = 4 parallel strings of LEDs drawing 20mA current each.
 

Thread Starter

Fuel

Joined May 12, 2010
4
I'm glad you added that info- that's a good, clear way to determine the possible LED load as a direct relation to the current abilities of the phototransistor.
 
Top