Introduction: Build a Coin Counter

This is a TTL logic coin counter that counts Canadian coins as they are manually sorted and dropped into 6 jars. Apparently some of you want to attempt to build the coin counter which was previously published only as a video demonstration of it operating. Okay here you go, I built this so long ago, finishing touches around ~ 2005, that it is not completely documented but definitely enough that you can build it.  It is not perfectly documented because it was never intended to be an instructable. So did my best to document it and I hope there are no errors, if there are, you will need to be skilled enough in electronics to find and correct them. However some of you are asking for an instructable after seeing the video, so this is what I have. See the video at: 
http://www.youtube.com/watch?v=IWdTCH-7hug

My advice would be to translate this into something modern using a PIC, PICAXE or ARDUINO which will be much simpler on the hardware side. If you are going to attempt to emulate this project as is using TTL, you should probably be some what experienced with electronics and understand basic logic because if you get in to problems building this, I am not going to be able to help you troubleshoot it remotely. I'm probably not even going to be able to help you if you live in Toronto because after all these years I probably can't even remember enough to fix my own version. AGAIN DON'T TRY TO BUILD THIS UNLESS YOU ARE SUFFICIENTLY SKILLED TO TROUBLESHOOT AND DEBUG IT YOURSELF. There you've been cautioned with the "here be dragons" statement. Brave soles may proceed beyond this point :-) ....

Step 1: Breadboard It

Before you buy all of the jars, connectors etc, breadboard this project to make sure that you can get the counter and the display working. This goes back to the statement in the first step, make sure you have the skills to do this and getting it working on a breadboard is a really good way to test that theory.

Step 2: Parts List

1 x large glass jar from Ikea
6 x tall glass jar from Ikea
4 x plastic pens ( remove the insides and just use the barrel)
1 x breadboard 2 x 3.75" x 5.5" Proto board
4 x MAN 6760 Common Anode 7 segment display
4 x 74LS47 BCD to 7 Segment decoder
9 x 74LS93 counter
6 x opto - gate Ti L888 or equivalent ( not sure if these will work as a substitute http://dx.com/p/sg-206-electronic-component-optocoupler-sensors-black-5-pcs-154294)
7 x 555 timer (if you want to make an optional manual clock you need 8)
2 x 74LS126 Quad tri-state buffer
1 x 74LS08 Quad 2 input And gate
2 x 1N4001 diode
18 x small signal diodes (optional for resetting the counter to zero - you can also use 1N4001)
1 x 100 UF 6V+ cap
9 x 0.01 or 0.001 UF 6V+ cap
6 x 470K resistor
6 x 1uf 6V+ cap
6 x 0.01uf 6V+ cap
1 x 100K resistor
6 x 100 ohm resistor
28 x 1K resistor
1 x 2.2uf 6V+ cap
1 x 6V battery (Lead Acid or alkaline lantern battery)
1 x SPST switch
1 x momentary push button switch (optional for resetting the counter to zero)
1 x fuse holder
1 x fuse (about 1A) you may need to experiment to find a good value depends on your cct
1 x 5V wall wart power supply 
14 x 5mm LEDs (for lighting effects, counter pulse monitoring and power indication)
2 x power jack to fit you wall wart and to battery backup
2 x power plugs to fit the jack
6 x 5 pin DIN plugs (or an equivalent minimum 4 pins required)
6 x 5 pin DIN jacks (or an equivalent minimum 4 pins required)
6 x rubber grommets
4 x 2.75" Hex standoff
8 x screws to fit the standoffs
8 x 4-40 3/8" screws and bolts (to re-attach Ikea jar lid handles after you remove the rivets)
IC Sockets - assorted 8, 14, 16 pin sockets
cable ties
hot glue gun
hot glue sticks
heat shrink
30 AWG wirewrap wire
22 & 24 AWG hookup wire
4 conductor telephone wire

* Note 1uf 6V+ cap means a capacitor with at least 6V working voltage, this would be the lower limit you can use 10 or 12V  too.

Step 3: The Schematics - Display and Counter

Due to the size of the project and the number of chips required, I had to draw the schematic on 4 drawings and these do not include the manual clock and counter reset function that I added at a later date. I don't have the diagrams for those, but you don't really need them and it will work without them. I will just describe what to do.

On the first schematic you see the counter display. The 1000's counter and display is not shown because there was not room on the drawing, but you just repeat the circuit one more time, as you see each section 1, 10, 100, 1000 is identical. You can build it as shown and it will count to 999 or add another section to count to 9999.

How it works essentially is every time a pulse comes in from the coin counting section the display is incremented by 1, and if there are four 7-segment displays and counters it will be able to count up to 9999 before rolling over to zero again. The 74LS47 IC is a BCD to 7 segment decoder. The 74LS93 IC is a BCD Decade counter. When a pulse comes in to the 74LS93 on pin 14 (Clock - negative edge triggered) the counter increments one and a high (1) shows up on pin 12 (QA). This is seen as a one on the 74LS47 input and it interprets the one by turning on the correct segments of the 7 segment display to display a 1.

When 9 pulses have been received by the 74LS93, there will be a 9 on the first 7 segment display. When the tenth pulse arrives, pin 11 (QD) is already high, pin 9 (QB) will go high and pin 2 (R01) and pin 3 (R02) will both be high, this resets the counter to zero. when pin 11 (QD) goes to low, it also clocks the ten's 74LS93 counter as they are connected. Now a 1 shows on the tens 7 segment display and a 0 on the one's display. This process repeats until the counter reaches 9999. Note that the 100's 74LS47 RBI (Remote Blank in) pin is grounded. This supresses the display when it is at zero. It's RBO pin feeds the 10's 74LS47 RBI pin so that the 10's display is blanked appropriately. The one's 74LS47 RBI is not connected so that it will always show a zero at power on or zero count. It is good practice to tie the one's RBI to +5V to ensure that zero blanking is not activated, but you don't really need it.

Step 4: The Schematics - Coin Counter Circuit 1c, 5c, 10c

The next schematic shows the coin counter section for pennies, dimes and nickels. Using the pennies section as an example of how this works; there are 100 pennies in a dollar and because this counter only increments the counter for every 1 dollar counted, we need to drop 100 pennies in the jar before we get a 1 on the counter.

When a penny is dropped through the opto-gate U1, a pulse is generated on pin 4 which triggers the 555 chip via pin 2. In the photo you can see the gate below the coin slot. I also added an LED (again not shown on the schematic) which is just connected with a resistor across +5V and Gnd. This just lights up the jar at night and makes it look cool. The 555 is configured as a monostable because when the coin falls through the opto-gate it generates a noisy pulse (like switch bounce) which may trigger the counter multiple times. With the monostable only one clean pulse is sent to the 74LS93 counter and this filters out any false triggering. You could also use a 74LS121 or 74LS123 monostable chip here, but I used 555 because I had a pile of them in my supplies.

The pulse from the 555 clocks the 74LS93 which counts to 10 and then resets and clocks the following 74LS93 once. So you need to clock the first 74LS93 100 times before the second 74LS93 resets and clocks the main counter (in the first schematic). The ten cents counter works the same way but only needs to count to ten as there are ten in a dollar. The five cents counter is designed to count to 20 as there are 20 in a dollar and so on. 

Step 5: The Schematics - Coin Counter Circuit 25c, $1, $2

The next counter section works the same way but is set up to count 4 quarters, single $1 (loonies) and single $2 (toonies). The toonies circuit is set up with a second 555 set up in mode that will generate 2 clean pulses on the output whenever it is triggered.

Step 6: The Schematics - Coin Counter Circuit Summing the Counter Outputs

The outputs of all coin counters are summed in a 74LS126 tri-state buffer which is used so that all the counter outputs can be connected to the input of the master counter and display circuit. The beauty of this scheme is that each counter independently keeps track of the coins fed to it. So you can mix and match plugging in coins and it will keep track.

For example if you put in a single quarter, the display counter does not increment because you need 4 quarters for a dollar. If you now put in a loonie ($1 dollar) the master counter will increment and show a one. If you now put in 3 more quarters, the quarters counter will increment and the display will show $2. The only thing you can't do is drop in two coins simultaneously, this will result in a race condition and only one of the two will be counted. This is not very likely unless you are trying to do it, so no worries there.

Step 7: The Schematics - Additional Notes

Not shown on the schematics are several things I had to do later. The first is I connected a switch via diodes to the master reset pins of all of the 74LS93 counters on the board because sometimes they would power up in an indeterminate state. This allows you to reset every counter to zero before coin counting. To do this you need to use some other gates such as inverters or what I used, diodes, to connect to all the reset pins because you can't just connect them all together.
If you know enough to build this circuit and get it working then you know enough to work this out on your own- (hint connect all master reset pins to to +5V via a diode and momentary push button switch) you don't really need this, most of the time the circuit works fine after power up.

The second thing is I built a 555 oscillator (Square wave) to manually clock the master counter circuit for me. This was built with 2 speeds so you can clock the circuit slow or fast - you don't need this it is just for test purposes, to help debug the circuit and also to be used if you already have a known amount of money in the jars and you want increment the counter manually from power up. You can find a million versions of a 555 square wave oscillator on the internet, so I won't repeat it here.

The third thing is I put in a battery back up circuit after losing my count in a power bump. A 5V wall wart is used to power this circuit. If you add 2 diodes going to a largish 6V lead acid cell you have instant back up, with 6V - 1.4V (2 diode drops) about 4.6V but it keeps it alive. Because the power rail is normally at +5V and the battery is only at +6V the diodes are reverse biased when AC power is on which stops the battery from draining.

Also not shown on this schematic are LEDs added to the output of each coin counting logic, to show when the counter increments, useful during the inevitable debug phase of these projects. And also not shown LEDs added under the counter jar lids only there to light up the jars at night. On the last schematic you will see the power supply cct. You should put a small capacitor across the power rail at the +5V and gnd pin of each 74LS93 IC to suppress switching noise.

Step 8: Building It


1. Layout the master counter and display circuit on one of the pcb boards. Make connections on the rear by soldering point to point with the 30 AWG wire wrap wire . Follow the first circuit diagram.

2. Layout the coin counter and summing circuit on the second pcb board. Make connections on the rear by soldering point to point with the 30 AWG wire wrap wire . Follow the second, third and fourth circuit diagram.

3. If you are using the same kind of Ikea jars used here, they have a plastic gasket in the lid to seal the jar. But for our purposes these are in the way. They are held on by the rivets which also hold the handles on the lid. Use a drill to drill out these rivets and remove the gaskets. Re-attach the lid handles using 4-40 nuts and bolts. Do his for all 6 tall jars and the large jar.

4. Cut a coin slot in the tall jar lids. I used a dremel tool to do this, or you can drill it and use metal nibblers. Drill a hole in the lid for the wire from the main counter too. Put a rubber gromet in the hole.

5. Attach the 4 conductor telephone wire to the photo gate and heatshring the connections. Optionally connect an LED to the +5V and Gnd wire for lighting effect. Run the wire out through the grommet. Connect the wires to the DIN plugs.

6. Mount the photo gates under the coin slot and hot glue into place. Also hot glue the LED to the bottom of the lid. Repeat these procedures for each of the 6 coin jars. Put a dab of hot glue on the edge of the lid at two spots across from each other (180 degrees apart) to make the lid fit tightly now that you have removed the gasket.

7. Drill holes in the large jar lid for the Din jacks, fuse, power jacks and switches and install this hardware. Connect wires to all of these items in preparation for connection to the circuit board, so leave 8 to 12" per wire length to give you enough slack to connect.

8. Connect the two PCB's together (display counter to coin counter and power). Next connect all the hardware on the large jar lid to the correct location on each PCB.

9. At this point use a DVM and check your circuit board connections are all correct. Next install all ICs into the sockets. Power up and test/troubleshoot the circuit.

10. Once working, fasten the two PCBs together using the 2.75" hex standoff spacers.

11. Disassemble the 4 pens so that you have just the outer plastic barrel. If necessary cut them to the right size (depends on what kind of pen you use, but you want the length to be such that the display board is close to or touching the inside bottom glass of the jar when it is assembled. Cable tie these plastic pens to the the hex spacers so that one end of each pen is aligned with the display board and make sure each is perpendicualr to the two pcb boards. See photo.

12. Hot glue the ends of the pens to the rear of the lid. See photo.

That's it congratulations, if all went well you have a fully functioning coin counter!!!

Step 9: Reference Information

Here are some specs and photos to help you.