IC 4017 is the 5 stage Johnson Decade counter IC widely used in chaser lighting circuits. It takes the clock pulses from the Clock input and makes one of the ten outputs On in sequence each time a Clock pulse arrives. A Johnson counter, also called Walking ring counter is the modified Ring counter in which the last stage is Inverted and fed back as the input to the first stage. It is a Decade counter since the counting is in Decimal digits and not in Binary. See the working details of CD 4017 and the Circuits.


CD 4017 or HEF 4017 are 16 pin CMOS version ICs belonging to the 4000 series. Internally the IC has 5 Bistables which are interconnected in the Johnson counter pattern. The outputs of the Bistables are decoded to give 10 individual outputs.The IC, take clock pulse from an external oscillator and steps the outputs from negative to positive in a series of 10 steps. Only one output will be high at a time. The IC can be exploited in different ways. It can be used to count up to a certain number and repeating the sequence or halting the count after a particular count or it can be cascaded to another 4017 IC to get higher numbers. It can be also used as a Bistable latch in the toggle mode.

CD 4017 works off 5-15 volts while HEF 4017 operates  from 3 volts. It has 10 outputs and each output can sink 10 mA current.

It works based on the Johnson counter method in which the last stage in inverted and fed to the first stage as input. It is also known as Switch tail ring counter, Twisted ring counter or Moebius counter. The Register of the IC cycles through a sequence of Bit patterns. The length of the bit pattern is equal to twice the length of the Shift register. The Register cycles continue infinitely. Johnson counter has 2n output states where the n is the number of Flip-Flops in the chain. It is a Decade counter that makes the counts in Digits. It is also known as Mod counter when it counts to 10 from 0 to 1, 2, 3 etc. A Mod counter that counts to 10 stops at 9 because the 0 count is a valid count.

The IC has 10 Spike free Decoded outputs Q0 to Q9, an Active low Carry out pin and Active high and Active low inputs namely CP0 and CP1.Its Reset pin is an Overriding Asynchronous Master Reset( MR). The counter advances by either a Low – to – High transition pulse at Active high input CP0 while CP1 is low or a High – to – Low transition at Active low input CP1 when CP0 is high. A High pulse at the Master Reset pin will resets the counter to 0 independent of the clock pulses at CP0 or CP1. The IC also has an Automatic counter code correction mechanism. If there is an illegal code, the counter will returns to the normal counting mode with in 11 clock pulses. The Clock inputs are highly sensitive ( Even the e.m.f around the live wire can clock the inputs) and tolerant to slower rise and fall times.

Pin connection

1. – 6th sequential output
2. -2nd sequential output
3. – 1st sequential output
4. -3rd sequential output
5. – 7th sequential output
6. – 8th sequential output
7.- 4th sequential output
8. Ground
9 – .9th sequential output
10.- 5th sequential output
11. – 10th sequential output
12. CO – Carry Out – Outputs high on counts 0 to 4. Outputs low on counts 5 to 9 .Thus a transition from low to high occurs when counting from 9 back to 0)

13. LE – Latch Enable – latches on the current output when high (i.e. the chip counts when LE is low)
14. CLK – Clock In
15. RST – Reset – Sets output 1 high and outputs 2 through 10 low, when taken high
16.Vcc – + 3 to +15 Volts DC.

Circuits using CD 4017


Traffic light
This circuit simulates the Traffic Lights. The Red, Yellow and Green LEDs lights one by one for a period of 1 minute and the cycle repeats just like the Traffic lights. IC1 (NE555) is the popular timer IC wired in the Astable Multivibrator mode. Resistors R1, R2 and capacitor C1 act as the timing components and the output pulses are available from the output pin 3 of IC1. These pulses are given to the input pin 14 of the Johnson decade counter IC CD4017. Out of the 10 outputs of IC2, only three outputs are used to drive the LEDs. The fourth output pin 4 is connected to the reset pin 15 to stop the counting. So that the cycle repeats. With the value of C1, each LED remains on for 1 minute. When one LED turns off, the second on turns on. This cycle repeats giving the Traffic light appearance. Resistor R3 keeps the input pin 14 of IC2 low after each pulse.
Note - If LEDs are connected to all outputs, and the value of R1 and R2 is reduced to 100 K, a running light can be constructed. If R1 is replaced with 1M Preset, the speed of the running light can be adjusted. Reset pin 15 should be grounded.

Clap Switch


This is the circuit of a very sensitive clap switch. It switches ON/OFF a White LED or electrical appliances through claps. The circuit can sense the sound of claps from a distance of 1-2 meters.

IC1 amplifies the sound collected by the Mic. Resistor R1, R3 and variable resistor VR1 adjust the sensitivity of the amplifier. Resistor R1 set the sensitivity of Mic. The amplified output pulses from IC1 passes to the input of IC2 (CD 4017).Resistor R4 keeps the input (pin14) of IC2 low so as to prevent false triggering. IC2 is a decade counter IC which is wired as a toggle switch. That its outputs 1 and 2 (pins 2 and 3) becomes high and low when the input pin14 receives pulses. Pin4 (output4) is connected to the reset pin15 so that further counting will be inhibited. The high output from IC2 passes through the current limiter R6 to the base of switching transistor T1. When T1 conducts, White LED (D2) turns on. If a 6V 100 ohms relay is connected to the points marked (A and B), the relay will also energized and the load (bulb or electrical equipments) will be switched on. In the next clap, output pin 2 becomes low and relay and White LED will be switched off. LED D1 (Red LED) indicates the OFF position.
Note – Use 1M Preset as R1 to adjust the sensitivity.

Note that the Carry Out pin 12 and Latch Enable pin 13 are grounded

AC Tester


The circuit beeps and blinks when it is close to a live wire. Its range of detection is more than 30 cms. LED gives a visual indication about the nature of 50Hz pulses in the AC.

The major component of the circuit is IC1 (CD 4017) which is the Johnson Decade counter .IC 4017 has a sensitive clock input (Pin14) and 10 active high outputs. That is, by receiving clock pulses in its input, the outputs turns high one by one for each low to high clock pulse. The counting of IC repeats only if its Reset pin 15 is grounded or open. After completing the counting cycle, again a new counting cycle starts automatically repeating the whole process.
In the circuit, only one output (Pin3) is used while output pin 4 is shorted with the reset pin 15 to stop the counting when pin 4 becomes high. So further counting will be inhibited and a new cycle starts.

The circuit is capable of detecting the e.m.f near the conducting wires. The clock input of IC1 is very sensitive and it detects the pulsating EMF as clock pulses. These clock pulses starts the counting cycle in the IC and its output turns high one by one on each clock pulse created by the e.m.f. When the pin 3 becomes high, transistor T1 forward biases and current passes through the LED and buzzer. Since the 50Hz pulses of e.m.f are too fast, buzzer gives a chirping sound and LED blinks very fast. Thus the LED gives a visual indication about the nature of 50Hz pulses in the AC.
Note : Use 10cm plastic wire as Antenna. Do not touch the antenna to live wire or AC sockets.

About these ads

About D.Mohankumar

D. Mohan Kumar M.Sc., M.Phil, is an Associate Professor from Trivandrum, Kerala, India. He has been guiding Post Graduate students in Animal Science research for the last 25 years in several premier institutions in Kerala, India. He is an avid electronics enthusiast and has been designing circuits for the past 20 years. In this period he has supported many electronics/electrical engineering students in their final year projects. He is a regular contributor to Electronics For You magazine which is South Asia’s largest circulating electronics magazine published from New Delhi. He is also contributing articles in http://www.elprocus.com and http://www.engineersgarage.com/

4 responses

  1. vasant patil says:

    thank you very much for the information. your site is very informative. keep it up.

  2. vasant patil says:

    dear mohankumar,
    pls clear me one doubt regarding 4017 ic. in your clap circuit, when led white is in on condition,if we are removing battery and connecting again,4017 get input pulse and red led glows. if we remove and connect battery again, 4017 get another pulse and white led get on. means, on each time 4017 loses the supply voltage and retain, getting input pulse and red and white led glows alternately each time. ( i have used 9v transformer supply and when power goes and come back ,without clap led is malfunctioning.) can you suggest a remedy for this?
    ie, if we remove the supply voltage and connect again,4017 should be in same state as when we removed the supply. if we removed the supply while white led glows,after connecting supply only white led must glow. should not go to the next led. pls help me

    • D.Mohankumar says:

      Dear Vasanth

      CD 4017 is the decade counter with highly sensitive input. It has no latching action to keep the output high /low steady.More over the at power on, the Mic amplifier sends a short pulse to trigger 4017. If you use a Transformer power supply, frequent switching can be avoided. If power fails and returns the same thing happens.The only remedy is instead of the relay driver transistor, use an SCR so the relay will be in the latched state. But to remove the latching again we have to switch off power. The Clap switch is meant to turn On/Off gadgets through claps.Its drawback like false triggering at power on cannot be eliminated.More complicated circuitry is necessary for this.