How do I connect multiple LEDs to one push-button switch?

AnalogKid

Joined Aug 1, 2013
12,138
I've never seen a problem with the switch contacts in similar circuits, but this one does have a relatively large decouple cap. 100 ohms would limit the peak current to 90 mA.

ak
 

Thread Starter

Circuitn00b

Joined Aug 12, 2019
8
Still think you should add a 10Ω resistor in series with the push-button.
I've never seen a problem with the switch contacts in similar circuits, but this one does have a relatively large decouple cap. 100 ohms would limit the peak current to 90 mA.

ak
The LEDs that I use can handle a 9 volt battery without a resistor, does that mean that I could skip all resistors including the ULN2804?
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,138
Posts #5 and #12 use the input switch to switch the GND connection to the output drivers. In this way, all LEDs are off when the switch is off and the circuit is less complex. I took a swing at folding this into the #20 schematic and ran into a problem.

ULN2804-Inside.gif

Each driver is a darlington transistor with two base pull down resistors in series. Combined with the input resistor, each stage has 20.7K of resistors between an input pin and the GND pin. At any time, one input is high and the rest are low, so there is an overall resistance of around 3 K from the GND pin to 7 parallel CMOS low-state output stages. This is pulling down on the input line, so the debounce resistor to VCC would have to be about 1/10 of this for firm input behavior. That makes the pull up resistor 300 ohms and the debounce capacitor around 100 uF. This has implications for the switch protection resistor that Wally likes, so overall I don't think this is a workable approach for the bipolar driver part. I have not looked into the internal schematic of the FET part.

Update: Also, the reverse-polarity protection diode on the left is not shown on all datasheets. It it is indeed present in the part, that presents the same problem detailed below, another reason this circuit technique will not work with this part.

ak
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,138
Here is the internal schematic of the TBD62083.

TBD62083- Inside.gif

When the switch is open, the debounce resistor tries to pull all 6 of those GND symbols up to VCC. We don't know the values of the two resistors in series with the base (which is connected to a CMOS low output for all of the non-active outputs), but that doesn't matter. That first reverse-polarity protection diode is the problem. 7 of these in parallel will prevent the 4017 input from getting above 1.0 V, let alone up to around 4.5 V, the CMOS transition level for a 9 V circuit.

So, I don't think this will work. It could with a DPST or DPDT switch, but not with a single-pole switch.

ak
 

AnalogKid

Joined Aug 1, 2013
12,138
The LEDs that I use can handle a 9 volt battery without a resistor, does that mean that I could skip all resistors including the ULN2804?
Probably not.

The issue is the current needed by the LED for acceptable brightness. At 10 V, a CD4017 output is rated to source 2.6 mA (typical). Even for a "high brightness" LED, that's not much. If your part has internal current limiting that is fixed at a higher value, it can damage the chip.

What is your LED part number / vendor / web page?

ak
 
Last edited:

Thread Starter

Circuitn00b

Joined Aug 12, 2019
8
I've never seen a problem with the switch contacts in similar circuits, but this one does have a relatively large decouple cap. 100 ohms would limit the peak current to 90 mA.

ak
Probably not.

The issue is the current needed by the LED for acceptable brightness. At 10 V, a CD4017 output is rated to source 2.6 mA (typical). Even for a "high brightness" LED, that's not much. If your part has internal current limiting that is fixed at a higher value, it can damage the chip.

What is your LED part number / vendor / web page?

ak
So the CD4017 will basically act as a resistor, and need resistors in order to not damage itself if the voltage/current/mA from the power source is heigh enough?

When i short-circuit one of my LEDs with a 9 volt battery (PP3), it gives a clear and bright shine like that I want to achieve. But when i short-circuit the same LED with a 1,5V AAA battery (LR03), it gives a much more vague light.

What’s weird is, when i short-circuit the LED with a small 12V (LR23A) battery, the LED wont even shine. What’s the reason behind that?

If I want the same current/effect in this application, as i get when i short-circuit using a 9V PP3 battery without any resistors, what will I need then? Another kind of Johnson
(or will other kind of counters also work?) counter instead of the 4017?

I don’t know what kind of LEDs I have, I believe they are a of an old kind.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,138
From your description it sounds like you have standard LEDs with *no* built-in current limiting. The fact that the LED does not fail instantly when you connect it directly to 9 V or 12 V does not mean it is designed for it.

How to tell:

With a 9 V battery, connect the LED in series with a 1 K resistor.
Measure the voltage across the resistor.
Repeat with two 1 K resistors in parallel.

ak
 

Thread Starter

Circuitn00b

Joined Aug 12, 2019
8


What will happen if I connect like this? Will it harm the 4017? I connected the GROUND (-) entry to the CLOCK (14), what’s the pros/cons with that? If the 4017 won’t work, are there any other alternative that could replace it and work without any resistors?
 

ElectricSpidey

Joined Dec 2, 2017
3,335
You might destroy the chip, it will not clock, and the carry out cannot be directly connected to ground.

I know this info is now obsolete, but I still want to post, because this is an archive site.

So I ran my circuit in LTSpice using the ULN2004 (don’t have a model for the other driver).

Results…

1. The 4017 will not clock without a pullup resistor on the CE pin. (omitted from my posted circuit)

2. The outputs of the 4017 reach the full 9 volts.

3. The driver outputs have weird spikes when configured with only one LED resistor, but works none the less.

4. The output from the driver chip is much smoother when using one resistor on each LED.

So I can’t speak for the MOSFET driver but I can pretty much insure the circuit will work with the ULN2004.

Didn’t test the de-bounce in the sim but the circuit was stable up to 100uf, which should be enough.

Of course I would never rely completely on a sim before building a finished circuit, so I would suggest breadboarding any design before going to a final product.

A_Simple_4017_Circuit_3.JPG
 

AnalogKid

Joined Aug 1, 2013
12,138
What will happen if I connect like this? Will it harm the 4017? I connected the GROUND (-) entry to the CLOCK (14), what’s the pros/cons with that? If the 4017 won’t work, are there any other alternative that could replace it and work without any resistors?
The circuit can not work as shown.
You have no power or GND connections to the chip.
Leave pin 12 floating.
You are driving both the true and inverted clock inputs with the same signal. This will not work reliably.
It is not clear which polarity clock signal you intend to use. Whichever one it is, it needs a boas resistor and a debounce capacitor

There are other devices that can achieve the same result, such as a shift register (which is what a Johnson counter is internally), but the extra steering logic makes it a significantly more complex circuit.

What is your aversion to having a current-limiting resistor?

ak
 

Thread Starter

Circuitn00b

Joined Aug 12, 2019
8
The circuit can not work as shown.
You have no power or GND connections to the chip.
Leave pin 12 floating.
You are driving both the true and inverted clock inputs with the same signal. This will not work reliably.
It is not clear which polarity clock signal you intend to use. Whichever one it is, it needs a boas resistor and a debounce capacitor

There are other devices that can achieve the same result, such as a shift register (which is what a Johnson counter is internally), but the extra steering logic makes it a significantly more complex circuit.

What is your aversion to having a current-limiting resistor?

ak
I want the light to shine bright. My LED’s are basically small incandescent lamps, they shine just fine when I’m using a 9 volt battery but with anything smaller than that they start to vague.

So my only concern is that the lamps won’t shine bright enough, and without any resistors I will damage the chip instead.. Catch 22.

However, I guess I’ll give it a try because I want to achieve this. I made a new sketch based on your original schematic design, I made a few modifications and I also included a few resistors this time because I don’t want to damage the chip, I’ll just include what’s necessary for the circuit to work. The LED’s may won’t be affected to much anyway, because the power equal to a 1,5V AAA battery is not near enough for my lamps, but 4 of them (6V) gives an okay brightness (even though not as good as a 9 volt PP3 battery).

Here’s the connection, I tried to translate it into reality. What do you think? Will it work this time?

0130E7F6-AC16-4CED-AF71-5A073C89097F.jpeg
 

djsfantasi

Joined Apr 11, 2010
9,237
The isolated 9VDC battery will supply much more current than the 4017 can. To use the 4017 and have bright LEDs, you need a driver circuit, such as ULN2003, ULN2004, several 2N2222 NPN transistors or several PNP transistors, or 2N7000 n-channel MOSFETs.

Some of these drivers require more rewriting than others.
 

AnalogKid

Joined Aug 1, 2013
12,138
My LED’s are basically small incandescent lamps,
No, they are not.

The are either LEDs or not. There is no combination device. An LED is a diode. An incandescent lamp is a resistor in parallel with an inductor. How the chip responds to them is different.

Also, what is your aversion to current limiting resistors?

Also, the only way to assure the brightness you want no matter what your devices actually are is to add driver transistors or a transistor array.

aj
 

Tonyr1084

Joined Sep 24, 2015
9,744
I'm glad @AnalogKid covered the LED / Incandescent lamp issue. The two are entirely different animals.

But there's one thing I haven't seen covered is battery life. I've only glanced at the circuitry shown, but am wondering if when the device is not in use - will the battery still drain? If so - how fast (or how long before the battery is dead)?

Aside from amusement, what is this circuit for? Though the 4017 was my first thought too, what about using a shift register instead? It's been years since I messed with logic circuits of this type. I have a board on my bench right now that is just a LED chaser, 30 LED's long. I could make it 100 LED's long but the board it will go on is just not that big and I don't want to mess with wiring 100 LED's.

Those are my concerns for your project, battery life and purpose.
 

AnalogKid

Joined Aug 1, 2013
12,138
There are two ways to do this with a shift register. One is to copy the internal schematic of a CD4017, since it is a shift register at heart with a lot of gating to determine the outputs. The other way is to essentially move the external gating to the input - at the input to the shifter, create a logic 1 that lasts for one clock cycle and then propagates down the shifter. Note, this is messier than it sounds.

ak
 
Top