counting how many cards there are in a deck

Hi everyone, i'm working on an automatic shuffle machine for regular poker decks. Aside from the shuffle, i'd like it to count how many cards there are in the stacked deck to check if anything is missing.

the problem is that i cannot figure an easy way to count cards without building overcomplicated mechanic (like passing cards one by one through a photointerrupter, or making slotted wheels like money counting machines).

measuring the height of the stacked deck is prone to errors due to the precision needed, even a slightly bent card would screw everything.

another approach i was thinking about, is to make some kind of marks with ir/uv ink on the side of the deck so that it could be detected by the machine without visibly marking the cards (i play with good friends, we're not concerned about someone cheating with polarized lens or shit like that), but even that way, after the shuffle i'll have a sort of QR code made by randomly distributed dots that i don't know how to count.

does someone of you guys have any idea how to approach the problem?

i'm working on an automatic shuffle machine for regular poker decks.

How are you shuffling the cards?

measuring the height of the stacked deck is prone to errors due to the precision needed, even a slightly bent card would screw everything.

Bending a card doesn't change its weight.

PaulS:
How are you shuffling the cards?

it's a 3 tray system, right/left and a middle one positioned below. the deck is manually split in two half and put on two trays right/left. each tray has a "conveyor belt" on the bottom that shoots cards toward a middle tray, that's easy but it does not pick cards one by one, more often than not it shoots 2-3 cards together but that's not a problem. i'm working on a system to automatically resplit the deck and reposition the two half onto the right/left trays.

PaulS:
Bending a card doesn't change its weight.

i was talking about measuring the height of the deck

M4L4:
measuring the height of the stacked deck is prone to errors due to the precision needed, even a slightly bent card would screw everything.

using the weight could be interesting but i would still need a really precise measurement

M4L4:
using the weight could be interesting but i would still need a really precise measurement

Not really. You could hack an inexpensive 100 or 200 gram weigh scale and hook it up to an Arduino via an HX711 ADC or use a scale that has RS232 output (which the Arduino can read via a MAX232 or similar).

DaveEvans:
Not really. You could hack an inexpensive 100 or 200 gram weigh scale and hook it up to an Arduino via an HX711 ADC or use a scale that has RS232 output (which the Arduino can read via a MAX232 or similar).

interesting, i'll look into that.

thanks

If you already know the weight of a full deck, another thought is to compare to this known weight.
Think of this like a balance scale.