The 4017 decade counter is a chip typically used for 10 of its output pins. It turns them on, only one at the time, in a sequence from 0 to 9. The chip waits for an external signal to switch to the next pin.
– Pin #16 (VCC): Connect to VCC
– Pin #8 (GND): Connect to ground
– Pin #15 (Reset): The chip’s current output goes back to output 0 / pin #3.
– Pin #14 (Clock): Tells the chip to switch to the next output pin (ex: from output 2 to output 3 or from output 9 to output 0). The clock is triggered when it is changed from a LOW (GND) state to a HIGH (VCC) state.
– Pin #13 (Disable): Usually attached to GND. Can be pulled HIGH to tell the chip to ignore triggers on the clock pin.
Pin #12: Carry-Out: Becomes High when current output is output 9. Returns to Low when output 4 is the current output. Can be used as the trigger of a 2nd decade counter that will count tens.
Output 0..9: Only one of these pins is High at any moment. They can be used to power other things like LEDs for instance.
In that example, the 4017 chip will turn on the 1st LED on the left. Then, every time the Clock pin goes from GND to HIGH, it will turn off the current LED and power the next one on its right. If the current LED was the last on the right, it will start over with the 1st LED on the left side.
Using only a subset of the 10 output pins
You do not need the chip to count from 0 to 9. Lets say you want to use it to power only 4 LEDs, then all you have to do is to connect output 4 to the Reset pin. So, the chip will power the LEDs attached to output 0, 1, 2 & 3 one after the other. Then, on the next clock signal, it will turn output 4 high, which will reset the chip and make output 0 the current output pin to start a new cycle from output 0 to 3.