Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

My 1st project - To cycle through 7 LEDs with push button

Status
Not open for further replies.
I said:
The LED supply comes from a +V IGN source and the driver SINKS the LED when a positive voltage appears at the input.

the OP said:
I often disconnect the truck's batter when working on the truck...

Apples and oranges. Unrelated. +V IGN only is used for the LED display, not memorizing the count.

==

But, it brings up something else: DIM You might like a lower intensity for the LEDS at night. i.e. When the headlights are on, the LEDs have a lower intensity.

==
I said:
Discussion about other junk required like transient suppression, unused gate inputs HAVE to be tied to ground or +V for CMOS logic, 0.1 uf ceramic caps connect to power and ground near each IC.

the OP said:
Is this shown in the schematics listed so far? or is it one of those things that you all (whom actually know what your doing) understand without having to draw it out?

It would be shown on a real schematic, but not for simulation.

Also read: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCIQFjAA&url=https://www.littelfuse.com/~/media/electronics_technical/application_notes/varistors/littelfuse_suppression_of_transients_in_an_automotive_environment_application_note.pdf&ei=ArMPVYPUA8imNtqmgOAM&usg=AFQjCNEagIFxFNgwYh7JGwMJ1lI2sThXcw&sig2=tuMfSwjPZsqHv164k8_ZgA&bvm=bv.88528373,d.eXY

==

the OP said:
For display purposes, either would be fine. I didn't realize that was option and was familiar with LEDs

7 segments displays are just LEDS and there are IC's that take a 4 bit binary/BCD number and create 0-9 and sometimes a-f. Bezels are harder to come by.
 
Last edited:
Understood

I suppose my response was more appropriately directed to the question of why I had a coin cell in my drawing. Bare with me guys, still digesting all this wonderful info.
 
Battery backup was not understood from #1 , rather we assumed to be switched ignition. A large Coin Cells has an ESR of ~~1k .
CD4017 will draw < 20uA from 3V coin cell. This can be reduced to near zero with 10V drop/20uA or 500K pullup to 12V.

Depending on colour and Vf, 2~3V for Red to Blue/Wh the LED drain can be switched low with ~9V +/-? Zener diode to V+ (an no inverting driver driver. This dim Led can also serve as Battery voltage meter as CD4017 is around 200~300 Ω using 10~15V.

But for consistent high brightness, ULN2002 inverting buffer is more reliable. ONLY 1 pullup R is needed between switched V_+and LED Common Anodes, since only one LED is on a time. Depending on CD range of LED choose 5 ~20mA for desired brightness from Ohm's law for V drop) e.g. 12Vbat -3V(white)-1V (Darlington@10mA) = 8V so for 10mA choose 760 Ω or for 16 mA choose 470 Ω.

Each R and C in my schematic has dual purposes for filtering and timing, but not critical in tolerances. Adjust on Falstad Simulator and test to verify

Changing the input 100R to 1000R will delay switching to 100us ( with 100nF) and reduce load dump current to CD4017 which has input diode clamps to V+/gnd from ACU inductive clutch (K.I.S.S. has shown correct automotive requirements)

If any CMOS gets a pulse that pulls internal diodes more than 1V above Vcc even for a 10 nanosec or below gnd by same, then CMOS chip turns into a TRIAC across battery (CMOS latchup effect) and gets hot until power is removed or fries depending on ESR.

As you see there is more to a reliable design than what appears on the schematic.
 
Last edited:
You haven't defined if Traffic alert LED unit requires switch to ground or V+ and load current yet

Note this demo below has no coin cell or inverting buffer for simplicity sake.

But notice timing effects of filter values from pressing switch

After rapid pulsing (>4 pps) of switch to last position on 4017, if still pulsing switch fast it will RESET
Otherwise if slow <1 pps it continues to advance instantly.

The advantage is you can advance both until end using fast method or sustained depression and hold counter while Traffic LEDs recycle to 1st position. ( while Q0 on 4017 stays ON )

UPDATE RC values can be adjust for more glitch filtering or faster response.
 
Last edited:
1700659700_1427050890.jpg

What am I missing here? It looks to me like the 10M resistor will act as a pull-up (granted, a weak one) for the Reset pin, which when pressed will bring the input of the inverter high, thus the output low, and resetting the chip. I don't think you want to reset the chip every time you click the "Click switch", do you?

Please enlighten me :p
 
As you should be able to see from the design and timing diagram...
It only resets after depressed for 1 s or pulsed rapidly to Q0 position and attempt to continue ...

e.g. 8 button pulses at 1 second may be enough to pass Vcc/2. like staircase that rises slowly during each press and decays 10x slower.

... then each subsequent rapid pulse stays at Q0 until waiting for 1 second when they appear to be in Sync. After Reset slowly stops, Instant step will occuir.


So there are two reset mechanisms.. slow press or rapid pulsing beyond last and attempt to loop past first position.

JUST try it out and see the result? Add more views to scope if needed.

The switch charges 100nF instantly to CLK but the other 100nF cap slowly to RESET in.
 
Last edited:
No.

CLK has 100K pull down, while RESET follows CLK pull down with 10M//0.1uF.

Hmm why haven't u run the circuit and click with mouse?
 
As you should be able to see from the design and timing diagram...
It only resets after depressed for 1 s or pulsed rapidly to Q0 position and attempt to continue ...

e.g. 8 button pulses at 1 second may be enough to pass Vcc/2. like staircase that rises slowly during each press and decays 10x slower.

... then each subsequent rapid pulse stays at Q0 until waiting for 1 second when they appear to be in Sync. After Reset slowly stops, Instant step will occuir.


So there are two reset mechanisms.. slow press or rapid pulsing beyond last and attempt to loop past first position.

JUST try it out and see the result? Add more views to scope if needed.

The switch charges 100nF instantly to CLK but the other 100nF cap slowly to RESET in.

No need to be rude. The explanation without the attitude would have been sufficient.
 
Excuse me, but which part appears to be rude to you? Sorry if your feelings are hurt
 
Excuse me, but which part appears to be rude to you? Sorry if your feelings are hurt

The overall tone of your past few posts have come across as a bit rude. No hard feelings, just wanted to mention it.
 
Tony:

The "Switch debounce" writing kinda obscured what I didn't see. 10 M and an effective 10.1 M pull downs,. Thanks.
I did catch the "long press" technique. Clever.
 
If you need the coin cell, connect it to CD4017, but you must limit switch voltage to 3V so replace 100Ω with 470-1k and add blue or white LED or 3V zener to switch out and gnd.

Then drive ULN2002 with 3V pulses to drive LEDs with all Anodes tied to one series R also 470~1k for any colour LED to 12V ignition .

Protection:
The RC filters in timing circuit will filter noise for EMI. but your 12V switched pwr should have any series diode for reverse battery protection of LEDs. Coin cell no problem.

Make sense??

With a 3V pulse from CD4017, the ULN2002 will easily drive LED with 2V drop on output and ~ 220uA load to coin cell so, choose largest coin cell avail. Coin cells have an ESR in 1-3k range so 3V should not drop more than 5% for good choice.


EDIT

I made a mistake

Correction : Use the ULN2004, not the ULN2002 which has same 10K series R but no Zener which was intended for higher Vin
**broken link removed**
 

Attachments

  • image.jpg
    image.jpg
    41.5 KB · Views: 151
Last edited:
The overall tone of your past few posts have come across as a bit rude. No hard feelings, just wanted to mention it.
Perhaps some interpret rudeness for impatience for those who didn't take the effort to try my simulation or appreciate my efforts.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top