3 LEDS, 1 button for 4 activations

Thread Starter

jakelewg12

Joined Apr 7, 2022
2
Trying to build a cool multiple LED circuit. The circuit has 3 LEDS. It has only 1 button with the following activations when pushed. 1st activation (1st button push) : turns on all LEDS at max intensity, 2nd activation : reduces light intensity for all LEDS, 3rd activation : stroboscope effect and finally 4th activation : turns off the circuit. Any help would be appreciated!
//Ideally, after the 4th activation, the series shown before should repeat.
 

Thread Starter

jakelewg12

Joined Apr 7, 2022
2
Welcome to AAC.

What you want to do will require an MCU (Microcontroller). Do you have one you want to use?
I do not have a microcontroller, I have the button, 3 LEDs, transistors, capacitors, op-amps, NE555, and different ICs, mainly JK flip-flop.
 

Ya’akov

Joined Jan 27, 2019
9,143
I do not have a microcontroller, I have the button, 3 LEDs, transistors, capacitors, op-amps, NE555, and different ICs, mainly JK flip-flop.
While what you want to do is certainly possible with discrete logic, it is a very complicated project. If you don't have any idea how to start whoever chooses to help you is going to have a lot of work to do.

Maybe somebody will be interested. In the mean time you should probably learn about the chips that you have and try to build just parts of the project which you can later combine. I would say figuring out how to make the LED go on when the button is pressed, then off when it is pressed again would be a really good beginning.
 

AnalogKid

Joined Aug 1, 2013
11,037
What you describe was a popular flashlight feature set about 10 years ago. ebay still has flashlights that do this. They *all* use either a microcontroller or a fully custom chip.

What you are describing is a state machine with four states. The 555 can do the strobe part, but you need a shift register or counter to step through the states, plus other stuff to do what each state does. Thinking it through, I disagree with Yaakov; this is not a difficult project. A CD4017 is a Johnson counter, which is a shift register with decoded outputs, plus a 555 and two driver transistors will do what you want. As an alternative, the shift register can be made out of four J-K flipflops (2 packages). In this case the 555 is replaced by a CD4093 quad Schmitt trigger NAND gate to be the oscillator and the steering logic for the shift circuit.

1. What voltage is available for the circuit?

2. What are the characteristics of the LEDs" Forward voltage, typical current, etc.?

3. What do you mean by "strobe effect"? My description above assumes that all three LEDs flash together, at the same time, not a 1-2-3-1-2-3 rotating pattern.

ak
 
Last edited:

MrSalts

Joined Apr 2, 2020
2,767
If you don't want to use a microcontroller...
You can use a simple two-chip method.
cd4017 decade counter - the button cycles the first four outputs and then Q4 hits the reset. It only draws a fraction of a microamp when nothing is connected and output set to Q0 pin.
Startup:
Q0= off state, nothing is connected
Press once:
Q1= powers (through any small signal diode to the transistor that switches your three diodes.
press again
Q2= initiates power to a 555 timer at ~300Hz 50% duty cycle (half brightness)
Press again
Q3= initiates power to same 555 but switches to larger timing capacitor at 3Hz for emergency flash
Press again, returns to Q0 (see above to repeat cycle).

if you are using 12v, you can use the same chips but. If you want, you can save some power by putting the LEDs in series - let us know the the answers to analogkid's questions (previous post).

6F6532C1-D563-4384-9E16-E635A8410C7A.jpeg
 

AnalogKid

Joined Aug 1, 2013
11,037
You can eliminate three transistors, two diodes, and two resistors, but without reference designators I can't say which ones.

Changing the transistors to n-channel FETs such as the 2N7000 eliminates two more resistors.

The debounce time constant is pretty short. Also, three of the transistors have no pull-up/down resistors on the base to guarantee complete turn-off.

ak
 
Last edited:

MrSalts

Joined Apr 2, 2020
2,767
You can eliminate three transistors, two diodes, and two resistors, but without reference designators I can't say which ones.

Changing the transistors to n-channel FETs such as the 2N7000 eliminates two more resistors.

ak
2N7000 are obsolete and out of stock everywhere I looked recently. A Mosfet would need resistors to pull down the gate if the gate is fed by diodes as shown. I like to offer parts that can be breadboarded for new members (Digikey has exactly

I could get rid of the PNP/NPN combo but those cut off all quiescent current for the 555 timer (quiescent current not specified when reset is pulled low) - an inquiry to TI long ago resulted in no answer from tech support. No reason to waste batteries - I assumed battery so I like low power options. It could be reworked if low power is not a requirement.

the output transistor is there in case the LEDs are pulling more than 250mA that the would draw in the off state.

The transistor controlling the smaller capacitor could be eliminated because it won't change the timing of the emergency mode.

I don't thing getting rid of the diodes would be a good idea since the cd4017 outputs are when not active (not high impedence).
 

Ya’akov

Joined Jan 27, 2019
9,143
First pass at a rework of Salts schematic. Rushed, probably needs tuning. 555 pin 6 should be tied to pin 2.

ak
View attachment 264534
It is not a difficult project for you, but the TS didn't even seem to have a clue where to start. I hope I am wrong about the implementation phase but unless I was also wrong about the skill level and experience of the TS, I don't expect to be.

I am glad you want to help.
 

AnalogKid

Joined Aug 1, 2013
11,037
It is not a difficult project for you,
Thank You !!!

Finally, someone else gets it! That is my exact reaction whenever I see someone respond to "I'm trying to build..." with Microcontroller + development system + programming language and compiler + device programmer.

Thanks for agreeing with me.

ak

ps. Because of your body of work, it is unfair to pile my entire tagline onto you. But you get at least a touch:

"I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail."

- Abraham Maslow, Professor of Psychology at Brandeis University
"The Psychology of Science: A Reconnaissance", 1966
 
Last edited:

Ya’akov

Joined Jan 27, 2019
9,143
Thank You !!!

Finally, someone else gets it! That is my exact reaction whenever I see someone respond to "I'm trying to build..." with Microcontroller + development system + programming language and compiler + device programmer.

Thanks for agreeing with me.

ak

Because of your body of work, it is unfair to pile my entire tagline onto you, but you get at least a touch.

"I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail."

- Abraham Maslow, Professor of Psychology at Brandeis University
"The Psychology of Science: A Reconnaissance", 1966
I won't debate this in someone's thread but while I respect your opinion I do disagree with it.
 

AnalogKid

Joined Aug 1, 2013
11,037
I was working on my schematic when you posted, so there is some overlap here.

2N7000 are obsolete and out of stock everywhere I looked recently.
Over 12,000 in stock at Mouser
Over 2,500 in stock at Newark
Over 1,000 in stock at Allied
Almost 700 in stock at Jameco
Over 1,500 in stock at Av-net, plus 150,000 in stock at their partners.

As the world continues to shift toward automated assembly, the 2N7000 (TO-92 package) is becoming less popular. Still, it is far from obsolete, and in current production by nine manufacturers (Digi-Key).

A Mosfet would need resistors to pull down the gate if the gate is fed by diodes as shown.
As I pointed out, so do bipolar transistors.

I like to offer parts that can be breadboarded for new members (Digikey has exactly
134 - plus 100,000 on order, due in June

I could get rid of the PNP/NPN combo but those cut off all quiescent current for the 555 timer (quiescent current not specified when reset is pulled low)
The 555 internal schematic is the most discussed IC of all time. Per that, the Reset transistor starves current away from part of the output circuit. This circuit is not fed by a constant current source, so there is a small increase in device current when in Reset mode. Worst possible case is 2 mA when operating at 16 V with the Reset input at 0 V, but again part of this current already is included in the Supply Current spec.

Also, the CMOS 555 has a typical operating current of 100 uA at 5 V. We don't know what the TS has, or if he is even aware of the options.

I don't thing getting rid of the diodes would be a good idea since the cd4017 outputs are when not active (not high impedence).
In each of the two instances, replacing one diode with a resistor uses that not-high-impedance to an advantage by solving the pull-down resistor issue. Back-feeding the outputs with less than 0.5 mA is no problem (it is no different than driving a 22K load), but that current can be reduced by scaling up/down all resistor and capacitor values.

ak
 
Last edited:

MrSalts

Joined Apr 2, 2020
2,767
The 555 internal schematic is the most discussed IC of all time. Per that, the Reset transistor starves current away from part of the output circuit. This circuit is not fed by a constant current source, so there is a small increase in device current when in Reset mode. Worst possible case is 2.2 mA when operating at 16 V, but again part of this current already is included in the Supply Current spec.
Exactly, your design will require an extra on-off button whereas the design I provided with the NPN/PNP was intended to be nano-amp power when the cd4017 was on Q0. Otherwise the flashlight battery would drain in some days at your worst possible 2.2mA estimate. Note- there are not a lot of wall-powered flashlights, as you called it.
 

AnalogKid

Joined Aug 1, 2013
11,037
I checked 555's from four different manufacturers spread over 40 years, The average change in operating current caused by asserting the Reset input to GND is 0.4 mA, approx. 10% of the device's non-reset current. This is about 1/3 of the average current through the 2.2 K resistor (reference designators!), and less than 1/10th the current in the PNP transistor's base resistor. In terms of reducing battery drain, the circuit has several opportunities for improvement.

For the CMOS 555, the difference is less than 10 uA, again about 10% of the operating current.

ak
 

AnalogKid

Joined Aug 1, 2013
11,037
the flashlight battery would drain in some days at your worst possible 2.2mA estimate.
I knew that putting in that "Worst possible case" part would bite me, and it very predictably did. That 2.2 mA reset current cannot happen in real life unless the chip is damaged. And, the real value is around 0.4 mA, but what's 500% here or there?

Actually, whatever the value is, this makes a case *for* power management for the bipolar part, not a new concept where 555s and batteries are involved. Changing to a CMOS 555 reduces the problem by 97%. Replacing the 555 with a CD4093 makes the circuit larger physically, but the 4093 standby current is less that that of the 4017. Schematic to follow.

ak
 

MrSalts

Joined Apr 2, 2020
2,767
;)
...and less than 1/10th the current in the PNP transistor's base resistor.
I think you are missing the point of my npn/PNP pair. The CD4017 has quiescent current of 0.05uA (50nA) so pushing the button until you get to Q0 is essentially "off" and won't drain the battery because the NPN/PNP pair are not supplying any current to the 555 timer allowing the battery to last for years.

Your design (removing that transistor switch) always supplies current to the 555 and the battery will be dead in days to months if the device is not used (set to Q0). To get the battery to last longer in your design will require a main power switch but that will likely be forgotten when cycling per the OPs off state requirement.

Final note- PNP base current draw is not a concern unless this device will be in the on-state much more than the off state (not a common usage for a flashlight)
 

crutschow

Joined Mar 14, 2008
34,412
Here's the simulation of a relatively simple CMOS circuit which draws only leakage current when idle, so there's no reason to add a circuit to shut it off.
The dim setting is a 300Hz, 50% duty-cycle signal.
The flash is about 3 per second.

1649474511346.png
 
Last edited:

AnalogKid

Joined Aug 1, 2013
11,037
Here is an alternate theory of the crime. It looks like a lot of stuff, but is functionally equivalent to what has been discussed. Because the 4093 is an actual combinational gate, it (U2C) can eliminate one of the two OR circuits in earlier posts. There are two separate oscillators because it takes fewer parts (and no additional transistor). Tried to get rid of that last diode, but couldn't get there.



ak
LED-Flashlight-2-c.gif
 
Last edited:
Top