Help with decade counter

Thread Starter

CaptainPrice

Joined Aug 12, 2009
49
So heres what I want:

When output 1 goes high LED1 goes on.
When output 2 goes high both LED1 and LED2 goes on.
When output 3 goes high LED1 & LED2 & LED3 goes on.

what Im stumped on is that output2 would short with output1 (cause when output2 is hi all other are low (right?)).
How can I wire this up?


Thanks. Ive been puzzling with this for hours...
 

KJ6EAD

Joined Apr 30, 2011
1,570
The correct use of steering diodes is the key. Additional diodes are strategically added to balance the voltage drops.

http://en.wikipedia.org/wiki/Diode_logic

http://www.falstad.com/circuit/#%24+3+0.0020+1.7725424121461644+50+5.0+50%0A163+256+232+280+232+1+10+0.0+5.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0%0AR+192+152+192+112+0+0+40.0+5.0+0.0+0.0+0.5%0Aw+192+152+104+152+0%0Ar+104+216+104+280+0+47000.0%0Ar+104+152+104+216+0+10000.0%0A165+128+184+192+184+0+5.0%0Aw+104+280+104+312+0%0Ac+104+312+104+344+0+9.999999999999999E-6+3.0348954775308212%0Ag+104+344+104+360+0%0Aw+104+216+128+216+0%0Aw+104+280+128+280+0%0Aw+104+312+128+312+0%0A162+448+104+488+104+1+2.1024259+1.0+0.0+0.0%0A162+448+144+488+144+1+2.1024259+1.0+0.0+0.0%0A162+448+184+488+184+1+2.1024259+1.0+0.0+0.0%0Ar+488+184+488+240+0+91.0%0Ar+528+184+528+240+0+91.0%0Ar+568+184+568+240+0+91.0%0Ag+528+240+528+256+0%0Aw+488+240+528+240+0%0Aw+528+240+568+240+0%0Ad+368+184+408+184+1+0.805904783%0Ad+408+184+448+184+1+0.805904783%0Ad+368+144+408+144+1+0.805904783%0Ad+328+104+368+104+1+0.805904783%0Aw+408+144+448+144+0%0Aw+368+104+448+104+0%0Ad+288+104+328+104+1+0.805904783%0Ad+328+144+368+144+1+0.805904783%0Aw+328+144+304+144+0%0Aw+368+184+320+184+0%0Aw+488+144+528+144+0%0Aw+488+104+568+104+0%0Ad+368+184+368+144+1+0.805904783%0Ad+368+144+368+104+1+0.805904783%0Aw+528+144+528+184+0%0Aw+568+104+568+184+0%0AI+416+312+416+264+0+0.5%0Aw+416+312+440+312+0%0Aw+288+104+288+216+0%0Aw+304+144+304+216+0%0Aw+320+184+320+216+0%0Aw+336+200+336+216+0%0Aw+440+200+440+312+0%0Aw+336+200+440+200+0%0A

This is the equivalent circuit function implemented with integrated OR gates instead of discrete diodes.

http://www.falstad.com/circuit/#$+3+0.0020+1.7725424121461644+50+5.0+50 163+256+232+280+232+1+10+5.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0 R+192+152+192+112+0+0+40.0+5.0+0.0+0.0+0.5 w+192+152+104+152+0 r+104+216+104+280+0+47000.0 r+104+152+104+216+0+10000.0 165+128+184+192+184+0+0.0 w+104+280+104+312+0 c+104+312+104+344+0+9.999999999999999E-6+1.7686914131343163 g+104+344+104+360+0 w+104+216+128+216+0 w+104+280+128+280+0 w+104+312+128+312+0 162+448+104+488+104+1+2.1024259+1.0+0.0+0.0 162+448+144+488+144+1+2.1024259+1.0+0.0+0.0 162+448+184+488+184+1+2.1024259+1.0+0.0+0.0 r+488+184+488+240+0+180.0 r+528+184+528+240+0+180.0 r+568+184+568+240+0+180.0 g+528+240+528+256+0 w+488+240+528+240+0 w+528+240+568+240+0 w+488+144+528+144+0 w+488+104+568+104+0 w+528+144+528+184+0 w+568+104+568+184+0 I+416+312+416+264+0+0.5 w+416+312+440+312+0 w+336+200+336+216+0 w+440+200+440+312+0 w+336+200+440+200+0 152+400+104+448+104+1+3+0.0 152+400+144+448+144+1+2+0.0 w+400+96+288+96+0 w+448+184+320+184+0 w+400+112+320+112+0 w+400+104+304+104+0 w+320+216+320+184+0 w+288+96+288+216+0 w+400+136+304+136+0 w+400+152+320+152+0 w+304+104+304+136+0 w+304+136+304+216+0 w+320+112+320+152+0 w+320+152+320+184+0

Edit: Sgt.Wookie points out the current budgeting flaw below. I always forget the driver transistors and supply voltage when I'm playing with the Falstad demonstrator.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,210
Unfortunately, steering diodes don't work so well with this problem, as the voltage drop across the diodes is cumulative, and the current requirement exceeds the capacity of a 4017 to supply it.

I came up with a solution using AND gates awhile back... now to track down where I put it...

[eta]
Oh yeah, here:



Bernard came up with this circuit:



It will work OK if you just have a few LEDs to light and are running from 12v. The ULN2004 has a pretty high input resistance (~10.7k Ohms), but even then after cascading three or so you'll be about out of current to supply the inputs.
 
Last edited:

KJ6EAD

Joined Apr 30, 2011
1,570
This is more realistic than my previous examples. It's a demonstrator, not a simulator so the component models are simplified and idealized.

http://www.falstad.com/circuit/#%24+3+0.0020+1.7725424121461644+50+5.0+50%0A163+208+224+232+224+1+10+5.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0%0AR+144+144+144+104+0+0+40.0+12.0+0.0+0.0+0.5%0Aw+144+144+56+144+0%0Ar+56+208+56+272+0+470000.0%0Ar+56+144+56+208+0+100000.0%0A165+80+176+144+176+0+0.0%0Aw+56+272+56+304+0%0Ag+144+360+144+376+0%0Aw+56+208+80+208+0%0Aw+56+272+80+272+0%0Aw+56+304+80+304+0%0Ar+432+224+432+280+0+150.0%0Ar+520+184+520+240+0+150.0%0Ar+608+144+608+200+0+150.0%0Ag+520+280+520+296+0%0AI+368+304+368+256+0+0.5%0Aw+368+304+392+304+0%0Aw+288+192+288+208+0%0Aw+392+192+392+304+0%0Aw+288+192+392+192+0%0A152+328+96+376+96+1+2+0.0%0A152+280+136+328+136+1+2+0.0%0Aw+272+208+272+176+0%0Aw+240+88+240+208+0%0Aw+256+128+256+208+0%0Aw+272+144+272+176+0%0Aw+328+104+328+136+0%0Aw+240+88+328+88+0%0Aw+256+128+280+128+0%0Aw+272+144+280+144+0%0Ac+144+336+144+360+0+1.0E-8+8.0%0Ac+56+304+56+360+0+1.0E-6+4.503479461995281%0Aw+56+360+144+360+0%0At+408+176+432+176+0+1+-11.99999999995+-0.11685752445206814+100.0%0At+496+136+520+136+0+1+-11.99999999995+-0.11685752445206814+100.0%0At+584+96+608+96+0+1+-11.99999999995+-0.11685752445206814+100.0%0A162+608+112+608+144+1+2.1024259+1.0+0.0+0.0%0A162+432+192+432+224+1+2.1024259+1.0+0.0+0.0%0A162+520+152+520+184+1+2.1024259+1.0+0.0+0.0%0Aw+608+200+608+280+0%0Aw+520+240+520+280+0%0Ar+584+96+536+96+0+1000.0%0Ar+496+136+448+136+0+1000.0%0Ar+408+176+360+176+0+1000.0%0Aw+272+176+360+176+0%0Aw+520+280+608+280+0%0Aw+432+280+520+280+0%0AR+520+64+520+24+0+0+40.0+12.0+0.0+0.0+0.5%0Aw+608+80+608+64+0%0Aw+520+64+608+64+0%0Aw+520+64+520+120+0%0Aw+432+160+432+64+0%0Aw+432+64+520+64+0%0Aw+328+136+448+136+0%0Aw+376+96+536+96+0%0A
 
Top