Coin/Money Counter

kollinsb

Member
I have a couple of questions that may be very stupid but I feel you guys are very nice to us lower tier dudes so I’ll ask away.

I am currently working on a project that I expect will get pretty complex, at least to me. It will be a coin/money counter. I have looked at brainstormed on several different ideas on how to do the electronics part of it and would like your opinions.

Your input/ideas would be MUCH appreciated!!!

1. Information will be displayed on a 16x2 LCD. A push button will allow the display to change between total number of coins, number of quarters, $$ in quarters, etc… The information would be gathered as follows:
i) Will run off external power. (plug in to wall)
ii) Variable w0 is the total dollar amount in the bank.
iii) Variable w1 is the total number of coins.
iv) Count the number of currency inserted and store them in the variables (b4(pennies), b5(nickels), b6(dimes), b7(quarters),b8(dollars))

I have everything drawn out and the initial test is good but there are some issues and some things I simply just don’t grasp.

1. The whole splitting w0 in to b0 and b1 thing. WOW. Crazy stuff. Anyone care to take another stab at it for me?
2. In order to count the coins I was planning on doing a simple switch (one I took off an old printer) but would some type of optical switch be better? I’m making an order and don’t mind ordering what’s needed but just looking to understand.
3. Is there a good way to allow for error checking when/if the switch gets stuck in the closed position so it doesn’t see 10,000 nickels instead of 1 stuck nickel?
4. I am currently using a 28x1 for the project. Would this project pose any need for an X2 part (fingers crossed)since I am going to have to use a 14m (I believe) for the inputs to be sure I don’t miss any coins inserted. (I also have a 40x1 and an 18x)

My apologies for the long post!

Code is at home and I'm at work. This outlines it well though.

Thank you!
 

Rickharris

Senior Member
If you sort the coins mechanically your problems will be much reduced. Most coins can be sorted by size and or weight. Just my 2c worth.
 

hippy

Ex-Staff (retired)
On w0 and splitting into b0 and b1, the best starting point is to view it as a binary 16-bit word drawn with bit0 on the right through bit15 on the left. Variable w0 consists of those 16 bits, b0 consists of the bits bit0 to bit7, b1 consists of bit8 to bit15.

These are all overlayed onto each other, so change bit0 then so does the lsb of b0 and lsb of w0 etc.
 

BeanieBots

Moderator
I'm sure this exact project has already been done and posted here.
Might be worth a search.

As for W0 being made up from b0 and b1.
Consider a simple two digit decimal number.
Imagine you keep adding one to the number.
Each time the units gets to 9, it gets reset to zero and the tens is incremented.

A word (W0) is like a two digit binary number. Each time the 'units' (lower byte) carries over, just like the decimal version, it gets reset to zero and the 'tens' is incremented by one. Except with bytes, the carry happens when it reaches 255+1 rather than the decimal version 9+1
 

Tricky Dicky

Senior Member
Money Box circuit

Hi Kollinsb

Attached is a circuit one of our 16yr olds did as a GCSE project this year. It is not very sophisticated but worked. The circuit used 8 IR opto isolators behind 8 slots for the number of UK coins. A Picaxe 20M was used to send a series of pulses to 4 chained 4026 decoders which displayed the total on four 7-seg. displays.

Richard
 

Attachments

Andrew Cowan

Senior Member
I've done the same as Richard's student, only putting all 8 optocouplers in one slot. A real pain to align, but effective.

A
 

nbw

Senior Member
A coin counter like this with good accuracy would be useful as a 'credit' mechanism for a home-grown arcade machine, or cookie jar, or.... !!
 

Dippy

Moderator
I never did take that Science Museum "Robot Bank" money box apart completely.
At £12 it's accuracy on coin detection was excellent.
 

westaust55

Moderator
A solution to avoid all that counting – send me all the money postage paid :D

On a serious note, as the PICAXE only works with positive integer number, you will have to keep the total value in variable w0 as cents/pennies and then divide by 100 and also extract the modulus portion when the total value in the format $XX.XX is required. That does limit you to a total of $655.35.
 

goingsolo

Member
http://picaxe.pertneer.com/misc.htm has a bank using a 18 pin PICAXE - probably an 18X (my guess). There is an emeil address at the bottom of the page. He/she has an LCD display; reads 4 coin slots; reads 5 push buttons to display coin totals and bank total; detects if the lid is open and flashes an LED and alarm when the lid is open.
 

kollinsb

Member
That site is filtered here at work but I'm going to try and get there on my Blackberry to see if it's what I'm looking at doing. Sounds like it.

No one said it would be cost effective for me to do it but if I can do it and it be something that's unique or cool, I'm game.

TY for the input.

Great site!
 

nbw

Senior Member
Although the max would be 655.35, you possibly have a third byte to count say, 100-overflows. e.g. when the word gets to 10,000, increment byte 3 by one. You could get 100.00 x 255 that way. And then of course, if you get tons of cash, you could look at using a 32-bit co-processor :)
 

inglewoodpete

Senior Member
Now there's a thought. Then I could put on a "grey ghost" suit and write out parking tickets for anyone who won't use my machine.

I wonder if anyone has thought of that before ;)
 

kollinsb

Member
My project keeps growing. Inglewoodpete, do you have it the project documented or outlined anywhere?

I made my order today so I'm hopeing to get the parts this weekend.
 

inglewoodpete

Senior Member
Being a one-off (possibly a prototype - who knows what the future holds?), I have built the circuitry on stripboard ("veroboard"). The hardware and software have been built specifically for the NV9 (notes) and EM800 (coins) -our model is the 860, using the simple Parallel Output protocols each unit defaults to. I'd prefer to use MDB or CCTalk protocols but I would have had to develop PICAXE code from scratch and the lead time did not allow me that luxury.

I made my order today so I'm hopeing to get the parts this weekend.
Do you mean the NV9 and/or the EM800? Otherwise, my documentation would not be much use to you.

Peter
 
Top