David Stern's Dave-o-Matic Is a Sneaky Bridge Dealing Bot, Peeking at the Cards for Pre-Set Hands

Taking Portable Bridge Notation (PBN) files as an input, this robot can deal specific hands by recognizing each card in turn.

Maker David Stern has built a card-dealing machine, dubbed the "Dave-o-Matic," powered by a Raspberry Pi 4 and capable of churning out randomly-shuffled cards — or specific hands for a game of bridge.

"Primarily made for bridge, [Dave-o-Matic] will deal predetermined or random hands," Stern explains of his creation. "Predetermined hands are read from a directory containing PBN (Portable Bridge Notation) files. The machine picks each card from the top of a deck in its card hopper, places the card atop a camera, recognizes the suit and value of the card, and then places the card in the appropriate pile."

This card-dealing robot accepts PBN files to serve up specific bridge hands. (📹: David Stern)

On the hardware side, the card-dealing robot is built using a Raspberry Pi 4 Model B single-board computer connected to an Arducam 8MP camera module and an Adafruit Servo HAT. Wooden hoppers hold the cards, with a hole cut underneath one allowing the camera to take a peek at the currently-chosen card.

Once the camera has seen the card, an OpenCV-based image recognition system running on the Raspberry Pi finds suit and value and, if running in specific-hand mode, places the card in the pile determined by the supplied PBN file. The physical act of moving the cards, meanwhile, falls to servo motors, a wooden arm, and a suction pump — which does mean the cards are handled one-by-one, resulting in a somewhat slow approach to dealing.

The software is built using Code::Blocks, OpenCV, and libCamera. (📷: David Stern)

The automated approach does have one key advantage, however: it requires very little in the way of user interaction, beyond placing a deck of cards down in the hopper and pointing the Raspberry Pi to the PBN file. "Cards may be placed in the hopper in any order," Stern explains, "no shuffling is necessary."

More details are available in Stern's YouTube demonstration video; design files and source code had not been publicly released at the time of writing.

ghalfacree

Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.

Latest Articles