Marbel counter - best way to do it

Need some guidens with a project.

First of all: I'm a newbie on electronics so please bear with me

I need to make a marble counter, ie count the number of marbels (14mm in diameter) passing.
All the marbels are white or orange. Sometimes there is a space between the marbels but sometimes it is not. I need to be able to count upp to 7 digits.

Shall i use photoresistor? A light beam that be broken when the lower part of the marbel is passing?

Any hint or links to project like this is highly appreciated.

tellblom:
First of all: I'm a newbie on electronics so please bare with me

I'll bear with you, but please let's keep our clothes on.

tellblom:
Shall i use photoresistor? A light beam that be broken when the lower part of the marbel is passing?

That sounds reasonable.

Have you tried googling around? It seems like projects similar to this one exist all over the place. Surely you can find some examples to get you started.

If the marbles are touching eaxh other that may me a problem for a photo interruptor.

Could experiment with a reflective sensor though mounted above.

Maybe consider having the marbles roll through a tube that has a micro-switch to activate a counter.

if you only want to count marbles, then life is easy.
if you want to count them and also classify by color, still easy, but not as easy
if you need to count, classify and separate, a bit more difficult.
if you need to count, classify, separate and do all that in the time it takes for a marble to fall, well, that is a bit harder.

it can be done, but you have to tell us what your real needs are.

Boardburner2:
If the marbles are touching eaxh other that may me a problem for a photo interruptor.

Could experiment with a reflective sensor though mounted above.

Just count, nothing else.

I think it's worth a try with placing it in the red areas as dave-in-nj suggest

Marbles passing in line somehow?

With a reflective IR sensor you can make the sense volume very small, led points across in front of the sensor where an object present would reflect the IR into the sensor.

Watch for the change in detection state, count those.