Introduction: Liner Counter

Picture of Liner Counter

 In the questions and answers forum at Instructables a fellow DYI member asked about building a liner counter. He was building a Coil Gun and he wanted a way to track the number of times he fired his Coil Gun. He wanted six LEDs, two green, two yellow, and two red LED, and he wanted them to turn off one at a time as a projectile passes between an IR LED and a Phototransistor.

I came up with a modified Johnson Counter, the counter and added the IR LED and Phototransistor to the clock.

Step 1: Modified Johnson Counter

Picture of Modified Johnson Counter

As in most circuit simulator programs, what works in the program does not necessarily work in the real world. Since I have over 100,000 components at my disposal I offered to build and test the circuit on a bread board.

Step 2: This Is the Finished Circuit

Picture of This Is the Finished Circuit
I built and tested this circuit a number of different ways using SN74LS74 and SN74LS175 ICs, With SN74LS175 ICs the circuit is smaller and uses 2 ICs less and half the wires than building it with SN74LS74 ICs.

This is two different ways to wire the circuit.

It works the way they wanted, turn on the circuit and all the LEDs turn on, if all 6 LEDs do not come on press the reset button and all the LEDs will turn on.

Every time you pass an object between the IR LED and the Phototransistor, one LED turns off at a time until all 6 LEDs are off, then when you press the reset button all 6 LEDs turn on.

If you pass an object between the IR LED and the Phototransistor a 7th time or more and the LEDs start to turn on.

Step 3: Parts

Picture of Parts

1. Proto board

1. IR or UV LED

1. IR or UV Phototransistor

1. CJ78M05 voltage regulator

1. Push button switch

1. 220 uF 16 volt electrolytic capacitor

1. 10 uF 16 volt electrolytic capacitor

2. SN74LS175N D Flip Flops

3. 1N4001 Diode

6. LEDs, 2 red, 2 green, 2 yellow

9. 1 KΩ ¼ watt Resistors

If you need a place to get the ICs you can get them at

For the voltage regulator just enter 78M05 in the search box.

You can get the datasheets at

Step 4: Upping the Design

Picture of Upping the Design

I always like to improve on things and I thought the color order could be a bit confusing. I changed the color order to four green, two yellow, and one red, for plenty ammo, green, low on ammo, yellow, and out of ammo or reload, red.

I think the next counter I design and build will be a numerical counter.


pruthvi-in-instructs (author)2016-03-22

Thanks a lot Sir!!!!!

pruthvi-in-instructs (author)2016-03-19

pls send the circuit diagram

The circuit diagram is in the Instructable.

sorry I'm not able to understand the pin configuration of the IC's

Josehf Murchison made it! (author)pruthvi-in-instructs2016-03-20

You can get datasheets on components here:

You can buy the parts and get datasheets here:

This is all the help I can give.

Ops made a bobo on the second IC with only two LEDs connected to it the lead on pin 10 should be on 11.

sallydaw (author)2015-06-30

You sure know your stuff. If I sat down to do something like this.. it wouldn't end well!

That is the fun part of electronics, Toasting components.

mujeresculonas (author)2015-02-05

Good circuits :)


awtsu (author)2014-08-04

in the parts list there are only 2 D flip flops used, how come that in the schematics there are 8?

Josehf Murchison (author)awtsu2014-08-04

There are only 2 flip flop ICs because each of the ICs have 4 d flip flops in them making a total of 8.


awtsu (author)2014-08-02

can I use a photodiode or another IR LED instead of a phototransistor?

Josehf Murchison (author)awtsu2014-08-02

I never tried it but as long as it will transfer enough power it should work.

awtsu (author)2014-08-02

I'm also wondering what is the essence of the 8th D flip flop you used? it doesn't look like that it has any effect on the circuit.

Josehf Murchison (author)awtsu2014-08-02

They only come in two's and four's.

awtsu (author)2014-07-29

ok the schematic in step 4 is the one I should use if I want the red LED to be my indicator that there is no ammo left in the coil gun right?

Josehf Murchison (author)awtsu2014-07-29

Yes that is right.

In that circuit I used a SN74LS175N D type flip flop.


awtsu (author)2014-07-29

and what flip flop did you use here?is it D flip flop?

Josehf Murchison (author)awtsu2014-07-29

I used D type flip flop and tested it in SN74LS74 and SN74LS175.

But any flip flop you can make a Johnson Counter with will do.


awtsu (author)2014-07-29

sir may I ask what is the difference between those two schematics in step 2? thanks

Josehf Murchison (author)awtsu2014-07-29

Just call me Joe

The top one is positive logic.

The bottom one is negative logic.


About This Instructable




Bio: I am a photographer, a tinker, an electronics technology engineer, and author; I write short stories and poetry for the love of writing. I started ... More »
More by Josehf Murchison:Repurposing an Aquarium StandRhubarb BreadSpiked Chinese Lantern Jam
Add instructable to: