Thread Starter

Elgordoroberto

Joined Nov 6, 2022
4
Hello all,
I’m helping my daughter with a design project and part of it needs a simple led control circuit. Using a single push button and 4 leds, I need an ic circuit that would light led 1 with th e first button push, led 1 &2 with the second, led 1,2,&3 with the third button push, leds 1,2,3,&4 with the fourth button push, and all off with the fifth button push. It eventually needs to be miniaturized, but for now, the circuit design is more important that the size.
Thanks,

Bob
 

dl324

Joined Mar 30, 2015
15,423
Welcome to AAC!

The easiest way would be using a shift register where you shift in 1's, use the outputs to power the LEDs (at low current), and use the 5th stage to reset the shift register.

Take a look at 74HC595:
1667751191447.png
 

WBahn

Joined Mar 31, 2012
27,854
Get familiar with the datasheet for the 595. What do the control signals need to be to advance the data in the shift register? What doe they need to be to reset the shift register?

One thing you will need to consider is that your pushbutton switch will need to be debounced, otherwise when it is pressed the 595 is likely to see a whole bunch of pulses instead of just one. There are a few ways to do it, so look up switch debouncing and see what might work well for your situation.

How old is your daughter? If this is HER design project, and you are just "helping", then be sure to only guide her. Let her do as much of the work, including the data sheet reading and research work, as possible.
 

Papabravo

Joined Feb 24, 2006
19,558
There are a number of ways to attack this problem but choosing the age appropriate one might be a challenge. My familiarity with the problem has always involved debouncing switches with a microprocessor. That may not be appropriate in this case. I hope you can find one or more simple hardware approaches. If you cannot come up with an acceptable alternative, then give us a yell and we may be able to give you additional suggestions.
 

WBahn

Joined Mar 31, 2012
27,854
It eventually needs to be miniaturized, but for now, the circuit design is more important that the size.
What level of miniaturization are you eventually talking about? If the space constraints are too tight, that can rule out some approaches and so it might not make sense to even consider them.
 

Papabravo

Joined Feb 24, 2006
19,558
I have produced an example of contact bounce with mechanical switches. An actual switch will have a less ideal waveform, but at least it illustrates the problem. After the first make or first break the switch will have some period of time where the samples may show the switch either open or closed or somewhere in between. You must ignore these samples and you must see two or more identical samples after waiting for the bouncing to stop. Since every switch (pushbutton) is different you need to have some adjustment capability, at least until you get familiar with the chosen pushbuttons.

1667773797650.png
 

Thread Starter

Elgordoroberto

Joined Nov 6, 2022
4
Yes, I remember these denounce circuits from my Radio Shack electronics learning lab using a 4001 ic to filter the signals…
The need for miniaturization is much further down the line. This is part of a larger project, and she is allowed to “hire out” for the different aspects, but I want her to learn a bit about this aspect as we build it. If it were 40 years ago I might have been able to figure this out , but it’s been a long time since I’ve monkeyed around with circuit design, and even back then my abilities were pretty rudimentary.
 

Thread Starter

Elgordoroberto

Joined Nov 6, 2022
4
How old is your Daughter? Is this something she's supposed to design and you're just helping?
She’s 13. No, she’s not meant to design it, aside from the functional parameters (she needs to know what she wants it to do, but isn’t expected to design the circuit)
 

dl324

Joined Mar 30, 2015
15,423
She’s 13. No, she’s not meant to design it, aside from the functional parameters (she needs to know what she wants it to do, but isn’t expected to design the circuit)
Connect LEDs 1-4 to outputs Qa-d, respectively. Use Qe to reset the shift register. Use your debounced switch output as the clock. Connect other control pins appropriately.

From TI datasheet:
1667833425220.png
 

dl324

Joined Mar 30, 2015
15,423
Connect LEDs 1-4 to outputs Qa-d, respectively. Use Qe to reset the shift register. Use your debounced switch output as the clock. Connect other control pins appropriately.
I've never used 74HC595 before and it's a little more complicated than this.

You have to clock data into the latches and clear is asynchronous, so you need to do something more like this:
1667860035995.png
You still need to debounce the switch.

Note that LED1 is on the right. I chose the order to minimize wire crossings.

Power supply decoupling isn't shown.

EDIT: I breadboarded the circuit and found that the delay from IC2B wasn't always sufficient. It worked better with 3 inverters worth of delay.

EDIT2: Back to a single inverter for RCK. I didn't debounce the switch and it was fairly consistent in bouncing enough to make the press to turn on the first LED generate a double clock (and the other presses were clean enough for correct operation). Once I used a 555 timer to make a one shot, it worked as originally drawn. I tried using a couple inverters in the CD4069 to make a one shot but results were unsatisfactory.
 
Last edited:
Top