Strobing LEDs that are being chased by 4017

Thread Starter

mxabeles

Joined Apr 25, 2009
266
Hi there -
The title is a little misleading, the 4017 is not chasing my LEDS around the workshop. I wish it was THAT exciting.

So, I have an arduino clocking my 4017. It works to chase my jumbo LEDS (I'm using a ULN2803 to increase current to LEDs).

What I would like to do, is have a second arduino pin turn the LEDS on or off whenever I desire, while the 4017 cycles through the row of LEDs independently. I *thought* I could take the common emitter from the ULN2803 and tie that to a second transistor. Unfortunately, if the 2803's emitter is detached from ground the LEDS are still faintly visible.

I now realize I need to have a switch between 5v+ and my LEDs. Any suggestions for a good positive rail switcher? At first I thought to use a reed relay, but that will probably need replacing and slower than some other non electro-magnetic options. Would a P channel MOSFET be a good idea? It's the best thing I could find lounging around the interwebs.

/// As always, thank you for reading and checking up :)
 

dl324

Joined Mar 30, 2015
16,846
ULN2803 are probably overkill for driving single LEDs. What is the LED current and supply voltage?

You could use OR gates on the Darlington inputs or P channel MOSFETs to switch power to them high side. The driving logic for those options would be the opposite polarity. OR gates would require a HIGH to turn an LED on, while driving HIGH side would require a HIGH to turn it off.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
ULN2803 are probably overkill for driving single LEDs. What is the LED current and supply voltage?

You could use OR gates on the Darlington inputs or P channel MOSFETs to switch power to them high side. The driving logic for those options would be the opposite polarity. OR gates would require a HIGH to turn an LED on, while driving HIGH side would require a HIGH to turn it off.
dl324, thanks so much for the prompt and informative reply.
The 4017 is very weak on the output, and I just happen to have a bunch of 2803s lying around. I do agree its a lil much, I am driving 2 LEDs wired in series for each 4017 output though.

I like the OR gate idea. I have a bunch of AND gates lying around. That said, I want to be able to turn ALL the LEDS on / off at a time. Thus, I think it would be quicker and more efficient to simply have one device switching +V to the LEDs as opposed to a logic gate in between all eight inputs to the 2803. I'm going to test the PMOS switch next week once the shipment arrives.
 
Last edited:

Irving

Joined Jan 30, 2016
3,845
P-channel MOSFET or a PNP transistor will both work. With the MOSFET you need to choose one that will be fully on with a gate voltage of around 3v - there aren't too many in a P-channel, through-hole device, but a good example is Infineon's IPP80P03P4L-04. Source to +5, drain to LED, gate to GPIOx. LOW = ON.
 

dl324

Joined Mar 30, 2015
16,846
That said, I want to be able to turn ALL the LEDS on / off at a time.
I missed the fact that you wanted to control all of them at the same time.

In that case, you could connect the ground from the ULN2803 to an N channel MOSFET or NPN transistor. That would use a HIGH signal to disable all LEDs.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
Ah thats the weird thing! I did connect ground from ULN2803 to the emitter of my NPN....ooops. haha maybe I need to connect the ground from 2803 to the collector of TIP120 XD. Alrighty, let me give this another shot. Thanks again, m8.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
yeah, no dice, There is current leakage or some thing so the LEDS don't fully shut off when using the above mentioned circuit. I think I really need to trip the v+ line to the LEDs.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
P-channel MOSFET or a PNP transistor will both work. With the MOSFET you need to choose one that will be fully on with a gate voltage of around 3v - there aren't too many in a P-channel, through-hole device, but a good example is Infineon's IPP80P03P4L-04. Source to +5, drain to LED, gate to GPIOx. LOW = ON.
Thank you. Sounds like PNP transistor might be the simpler option of the two.
 

dl324

Joined Mar 30, 2015
16,846
yeah, no dice, There is current leakage or some thing so the LEDS don't fully shut off when using the above mentioned circuit. I think I really need to trip the v+ line to the LEDs.
Try using a transistor with lower leakage. The spec for TIP120 is 0.5mA max, but no other information is given.

What is the total maximum current in an LED string? If it's less than 200mA, you can use a general purpose NPN transistor. 2N3904 has a leakage current of 50nA max.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
Try using a transistor with lower leakage. The spec for TIP120 is 0.5mA max, but no other information is given.

What is the total maximum current in an LED string? If it's less than 200mA, you can use a general purpose NPN transistor. 2N3904 has a leakage current of 50nA max.
Interesting, again thanks :) I'm currently staring at an 2N222. I'll give a whirl . ..
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
Interesting, again thanks :) I'm currently staring at an 2N222. I'll give a whirl . ..
argh, same problem. Some leds stuck on, most are very dimly lit when 2N222 base is low. Just a goddamn disaster haha. I don't get why this "wouldn't" work though. For example. if I just powered LEDs with 4017 alone, and tied all the - leads of LEDs to emitter of NPN this would work - I've tested it. Adding in the amplifying transistors makes things more complex.
 

dl324

Joined Mar 30, 2015
16,846
Some leds stuck on, most are very dimly lit when 2N222 base is low. Just a goddamn disaster haha. I don't get why this "wouldn't" work though.
It seems to me that it's a leakage problem.

You can check the LEDs by moving the ones that are turning off to places where they aren't. If that fixes the problem, you have some leaky LEDs.

If that doesn't fix the problem, then the Darlingtons or the power switch transistor have too much leakage.

Do you have any N channel MOSFETs with a sufficiently low Vgs(th) to try? 2N7000 have a maximum leakage current of 1uA.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
It seems to me that it's a leakage problem.

You can check the LEDs by moving the ones that are turning off to places where they aren't. If that fixes the problem, you have some leaky LEDs.

If that doesn't fix the problem, then the Darlingtons or the power switch transistor have too much leakage.

Do you have any N channel MOSFETs with a sufficiently low Vgs(th) to try? 2N7000 have a maximum leakage current of 1uA.
Dennis, thanks for sticking with me here. Question: should I be utilizing the "COM" pin on the 2803? I never have before, but I saw a circuit using LEDs that connects +V to COM. I'll try it, just wondered what your two cents are here. I know I'm grasping at straws rather randomly now lol
 

Irving

Joined Jan 30, 2016
3,845
What resistor(s) do you have between base on 2n2222 and gpio output?

COM is for suppression diode if switching motors/relays. connect to v+ but not needed to..
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
What resistor(s) do you have between base on 2n2222 and gpio output?

COM is for suppression diode if switching motors/relays. connect to v+ but not needed to..
Yeah the COM connection didnt do diddly for this setup (yes I do recall using that for flyback diodes).

I have the standard 1K between arduino output pin and 2n2222. I'm going to step away from trying to control strobbing with NPN now, it's just not working. Will report back on how the PNP switch works later. I can always just bite the bullet and use an electromagnetic relay to trip v+ to LEDs. I know that will work (for how long is the question). Thank you all so much!
 

dl324

Joined Mar 30, 2015
16,846
Question: should I be utilizing the "COM" pin on the 2803?
That information is in the datasheet. When not driving inductive loads, COM can be left floating.
I never have before, but I saw a circuit using LEDs that connects +V to COM.
There's a lot of junk on the internet posted by so-called experts (some of whom apparently don't read, or comprehend what they read, very well).
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
That information is in the datasheet. When not driving inductive loads, COM can be left floating.
[quote[I never have before, but I saw a circuit using LEDs that connects +V to COM.
There's a lot of junk on the internet posted by so-called experts (who apparently don't read very well).
[/QUOTE]
haha yeah, I hear you. Sorry to throw random junk at ya . . .
 

dl324

Joined Mar 30, 2015
16,846
I have the standard 1K between arduino output pin and 2n2222.
There is no such thing as a "standard" base resistor when driving transistors from Arduino's. The value depends on the load you're driving. The base current needs to be one tenth of the desired collector current (for saturation mode operation). Since you haven't posted what the LED current is, no one can calculate an appropriate base resistor value.
I'm going to step away from trying to control strobbing with NPN now, it's just not working.
You'll learn more if you keep working on the circuit until you can make it work.

If you take the time to isolate the problem, that will give you a solution space to work in. If the LEDs are leaky, finding better LEDs will solve the problem. Another fix is to put a resistor in parallel with the problematic LEDs, but we'd need to know more about the circuit to know if that's practical.

If this is a one off design, kludgy may be acceptable. If it's something that you need to work in a lot of copies, you'll want to use quality parts so kludgy woakarounds aren't necessary.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
There is no such thing as a "standard" base resistor when driving transistors from Arduino's. The value depends on the load you're driving. The base current needs to be one tenth of the desired collector current (for saturation mode operation). Since you haven't posted what the LED current is, no one can calculate an appropriate base resistor value.
You'll learn more if you keep working on the circuit until you can make it work.

If you take the time to isolate the problem, that will give you a solution space to work in. If the LEDs are leaky, finding better LEDs will solve the problem. Another fix is to put a resistor in parallel with the problematic LEDs, but we'd need to know more about the circuit to know if that's practical.

If this is a one off design, kludgy may be acceptable. If it's something that you need to work in a lot of copies, you'll want to use quality parts so kludgy woakarounds aren't necessary.
Got it. I will take the time to get the specs for my LEDs and will post a schematic later today :).
 
Top