Maker Pro
Maker Pro

help with a 4017

signalman72

Jan 26, 2014
57
Joined
Jan 26, 2014
Messages
57
I want to use a 4017 decade counter to keep score (1-10) with lights that illuminate with the corresponding score. I want to be able to reset it after the winning point (10) and have a score of 0, or no outputs. In other words, I'd like to have no score lights on after reset and until the first point is scored. Is this possible? Thanks!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,748
Joined
Nov 17, 2011
Messages
13,748
The 4017 counts from 1-10 (or from 0-9, depends on your view).
You want to count from 0-10 (0=reset, 10=max. points).
This is not possible with a simple 4017. I suggest you use a binary counter (e.g. 4161) which can count from 0-15) plus a binary-to-decimal decoder to control the lights.
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
Another possibility is to cascade 2 x 4017 using circuit in Fig 12 in the datasheet that can be found HERE
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
You could also look at using the carry output to drive the extra light for '10' on a sibgle 4017 giving you 0-10 (11 outputs), but you would have to do some logic to stop zero lighting up when carry is set..
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,748
Joined
Nov 17, 2011
Messages
13,748
There is one issue with the datasheet circuit: It will count in decade style. Meaning the first counter (ones) counts from 0-9, then the second counter (tens) will count from 0->1 and the first counter will start from 0.
The sequence shown as bits is as follows:
counter1 counter 2
1000000000 0000000000
0100000000 0000000000
0010000000 0000000000
...
0000000001 0000000000
1000000000 1000000000
0100000000 1000000000

While counting in a decade style correctly from 0 to 10, it will not fit the requirements as posted by signalman, namely at each point in time only one Light is one showing the equivalent score. See this discussion for more detail.
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
@Harald Kapp:

I could be wrong but looking at the diagram more closely, O9 will hold CP1 high stopping the leftmost counter from advancing and so on and so forth for eacj cascaded counter.
So I think it will operate correctly outputting only one at a time as require by the OP.

Note which outputs should be used when cascading, they are not the same for each 4017(except the intermediates).
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,748
Joined
Nov 17, 2011
Messages
13,748
Sorry, you're right. Since OP9 is not used as a signal output it works as you describe.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Can't you just connect a push button switch to the rest pin, ensuring a high level for reset. Or do you want it to do this automatically?
Adam
 

signalman72

Jan 26, 2014
57
Joined
Jan 26, 2014
Messages
57
Gentlemen, would it be advisable to run a relay right off of an output from a 4017? I just checked the current draw of a 12 volt Songle relay and it is about 24 mA. (I used a 9 volt battery to pick it. I figure it will draw even less current on 12 volts) Of course, I plan on using a snubber diode to protect against inductive kick back.
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
No. For various reasons. Not the least of which is that it won't work! A CD4017 might be able to provide 24 mA (I'm doubtful) but only at a reduced output voltage. CD4000 devices have typical output resistances of over 100 ohms. At 24 mA that's a drop of at least 2.4V, probably a lot more.

Also, relays are resistive; if it draws 24 mA at 9V, it will draw 32 mA at 12V.
 

signalman72

Jan 26, 2014
57
Joined
Jan 26, 2014
Messages
57
Thanks for the reply. I then assume I need to go through a BJT first, such as a 3904?

The reason I need a relay is that I would like to switch 120 VAC.
 

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
The relay coil will draw MORE current at 12V than with a 9V battery. Google Ohm's Law if you don't understand why. ;)

I'd use a transistor to drive the relay, to be safe. NPN bipolar or N-channel MOSFET, take your pick, and don't forget the snubber diode. 3904 would work fine.
 

signalman72

Jan 26, 2014
57
Joined
Jan 26, 2014
Messages
57
Thanks for the reply. I must have had a brain lapse because I use ohm's law quite often.....

I will use a 3904 as I have a few handy and will use a snubber diode.
 
Top