EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: kalel on June 13, 2017, 08:01:35 pm
-
I'm wondering if a counter IC would facilitate a simplest solution to changing "modes" on something like a small LED light, or whether there could be some unforeseen (or quite foreseen for experienced people) issues with that.
For example, let's imagine that the counter IC can drive an LED directly (some can), or otherwise just amplify the output.
Would it be reasonable as a simplest solution to using a momentary/push button (I hope I got the name right, it goes LOW when not pressed and HIGH only upon being pressed) to switch "modes" (e.g. light intensity and on/off) with something like this:
Power Supply > Counter IC > Resistor > LED
Where for each output on the Counter IC a different set of resistors can be added in-line with the LED, to provide different light outputs. Likely a decade counter in this case.
For an "OFF" mode, the output would simply not be connected to the LED.
If we have less modes than the counter has outputs, one output could be connected to the "RESET" pin of the IC.
Basically, is something like this a reasonable solution for the simplest circuit (least components), or would it simply not work, or is there perhaps a yet simpler solution?
-
Mechanical switches usually show some ringing when operated. This can make the counter to count up be way more than 1 - up to the point of making a kind of dice - thus a random jump. So it would usually take some measures to avoid ringing. This could be something like a SPDT switch operating between a H and L level with a small capacitor for buffering.
A second point to watch is that many counters have a limit on how slow the input signal is allowed to change.
-
Depends what the output needs to be, there were some dirty ideas here:
https://www.eevblog.com/forum/projects/discrete-logic-design-vs-a-super-cheap-micro/msg624674/#msg624674 (https://www.eevblog.com/forum/projects/discrete-logic-design-vs-a-super-cheap-micro/msg624674/#msg624674)
-
Mechanical switches usually show some ringing when operated. This can make the counter to count up be way more than 1 - up to the point of making a kind of dice - thus a random jump. So it would usually take some measures to avoid ringing. This could be something like a SPDT switch operating between a H and L level with a small capacitor for buffering.
A second point to watch is that many counters have a limit on how slow the input signal is allowed to change.
If you design for low cost, adding an RC filter for the button and using schmitt trigger input solves this problem 99% of the time.
The only issue I'm seeing is the currents. See, for a decade counter, 1 input is high 9 is low. So most of the current will flow out of the IC through the resistor, do a 180 degree turn, flow back into trough the resistors into the IC, ground. So you need an open collector output, or add series diodes.