I have looked forward getting an Arduino board for quite a while now and I have finally come up with a thing I would love to try to make.As the topic title says - I'd like to make a money counter.I have thought about this and have come up with two ideas.First - to use a photo diode. I guess it would be easy to make a coin counter as you could just add one to the coin total when signal is interrupted between the photo diode and the light emitting diode. I am quite new to electronics, but what I remember from school and university classes this is how a photo diode works - current flows through it when there is light? The problem with this one is I have no idea how would I be able to get the size of a coin, so I could make correct calculations on the amount of money.

Second - using some sort of a mechanism where the coin has to be pushed through and the opening of the mechanism determines the value of the coin by it's size.The problem with this one is that I have no idea where to or how to make a mechanism of that sort.

I know that both approaches are quite easy to fool as they do not check whether the coin is real or not and so on.

However it uses a linear CCD sensor which is in effect lots of photo detectors to measure the size of the shadow as the coin passes in front of the sensor. I did not do this for an arduino but the idea should be easily translated. The only snag might be getting hold of this sensor nowadays.

The OUT line would be connected to a digital pin. Assuming you arranged a space between your phototransistor/diode and IR led for the coin to fall through you can get an estimate of the coin's size by recording how long the OUT line goes high when the coin is passing through (see the reference for the pulseIn() function). This assumes that all of your coins are falling through at the same speed.

Discrete photodiodes/transistors are cheap; I would suggest a plurality of detectors arranged in such a way that a coin rolling past them on a slope could be read for its height.

I'm actually a bit ashamed to admit this, but I don't really know the difference between analogue and digital inputs. From what I've understood digital is 1/0 - on/off but the values in analogue differ.If I go with the photodiode approach the digital inputs (if I've understood them correctly) is the best choice in this situation as I could check and compare which sensors are on or off and determine the size of the coin from that.

I also wanted to ask what would happen if the diode would be partly covered? Is it possible to determine the amount of the area covered? For example, 100 would be the diode not covered at all and 30 would be diode covered by 70%. I guess it's not doable like the example I gave, but could it somehow be calculable by the strength of electrical flow going through the diode? Or is the diode not able to do that and only outputs an on/off signal?

I also wanted to ask what would happen if the diode would be partly covered?

Using analogue sensors you would see this half region in the way you want, as proportional. Using digital is is always a 0 or 1. The down side is it takes longer to read an analogue sensor. You can do only about 10,000 reads per second with analogue although there are things you can trade to make it faster.

Do some measurements with photo detectors first and get a feel for how to use them.