A Card Dealing Machine for Bridge
Bridge is a card game where teams compete against each other playing the same hands. Usually the boards are being dealt in the first round(s) and then passed around between the tables. Small computers at each table (“bridge mates”) allow to enter the result after a game has been played. Based on the score of all other teams the players can see how well they did.
After a board has been played for the first time its card distribution must be entered into the bridge mates (or noted on a piece of paper). This process can be avoided if a tournament uses pre-dealt boards. And that is where a card dealing machine comes in.
This project describes the construction of EasyDeal, a cheap dealing machine for Tournament Bridge or for Bridge teaching.
Functionality
EasyDeal receives (or generates) a desired card distribution and then distributes a deck of 52 cards to the four players (North, South, East, West). EasyDeal reads and recognizes the small pips (symbols near the corner of each card) and puts the cards for each player into a separate bin.
The person organizing the tournament – or a Bridge teacher who wants to prepare hands for his classes – manually loads one or two card decks into EasyDeal and then tells it to start dealing. EasyDeal will automatically stop after each deck and turn the rotating receiver bins to the “unloading” position. The user removes the cards of each hand and puts them into the N-E-S-W pockets of the bridge board envelopes.
It takes about 45 seconds to deal the cards of a single deck.
See it in action
Watch this video to see the machine in work.
Do it yourself
Professional Bridge card dealing machines sell at relatively high prices (3000 USD and more). EasyDeal is aiming at less than 10% of this price, assuming that you have a 3D printer or get the CAD parts printed by some friend or via a web service.
Components
The dealing machine consists of a rotor with four bins receiving the cards, an engine rack with motors and a camera and a card house where the user fills in the (unordered) decks. The stepper motor in the engine rack is controlled by the distributor (an Arduino Uno). The camera is attached to the dealer (a Raspberry Pi computer talking to the distributor. The user talks to the system via a web browser and a wireless connection.
Mechanical Components
- engine rack
- housing
- wall for stepper motor mounting
- camera holder
- card outlet directing to the receiving rotor
- card house
- tray for card decks; the bottom card will be picked up by the pickup motor which presses a rubber wheel against the card. The pip of the bottom card is read by the camera.
- As soon as a card has been thrown out the pickup motor will stop and retract a little bit. This is helpful because the card directly above the picked card might have moved somewhat out of position together with the card picked. A small retraction ensures that this card will be in the correct position to have its pip being read.
- rotor
- rotating disc with four card receiving bins (N,E,S,W)
- light sensor fo find the zero position (N facing the card outlet)
- electronic compartment
- mounting place for Raspi
- mounting place for Arduino
- holes for cable connections
- transportation box
- base plate with grips
- aluminium box
Electrical Components
- “pickup” : stepper motor with rubber wheel for card pickup
- “select” : stepper motor with gear and toothbar for trolley mvmt.
- —-
- “distributor” : Arduino Uno connected to a USB port of Raspi
- stepper motor shield and two drivers (A4988)
- power supply for motors (12 V 2A)
- —-
- “dealer” : Raspi (model 4)
- “cam” : camera connected to Raspi via USB
- power supply for Raspi (5V 2A)
Software
- motor control on the distributor; coordinates the motor movements and optimizes speed operating motors in parallel where possible. Handles acceleration and deceleration. The software takes simple commands like “deal a card to bin #2” via its serial connection; it signals certain states to the dealer like “image can be taken” or “ready to deal next card”.
- application software on the dealer, including deal generation and deal upload API, serial communication to the distributor, camera control and image recognition
- system components (web server, WiFi client) on the dealer.
- Here you can find the sources and a (home grown) framework on which the sources are based. The Arduino poart ist quite staright forward and you should be able to run it more or less easily. The Raspi software based on the berry framework may look more complicated than you expect. Feel free to change whatever you want and let me know!
Network
- The dealer acts as a WiFi client, assuming that it will be part of a WLAN network.
- In a standalone environment the user could use a mobile phone as a WiFi hotspot.
User Device
- a mobile phone, laptop, tablet or desktop computer running a browser and having a WiFi connection
Workflow
- After power on the card receiver will rotate to its starting position and the Arduino will wait for commands from the Raspi.
- The Raspi will connect to a WiFi network, activate the camera, start its web server and the application.
- When the Raspi receives the “ready signal” from the Arduino it will scan the bottom card and show that card in the Web UI
- Then it will wait for incoming requests from web clients.
- The user connects to EasyDeal via a browser and issues commands.
- While commands are being processed the Web UI will show the progress. It will show the four hands of a deal “growing” until each hand has received 13 cards.
- Then the Raspi will tell the Arduino to move the trolley into unloading position.
Cost Calculation
- Mechanical CAD parts: 20 USD for PLA filament and ~ 40 hours of printing time
- Some LEGO parts: wheels for waggon (item #A44a), wheel carrying bars, Rubber wheels for card pickup and card push, 15 USD
- two aluminium connectors for wheel fixing on stepper motors: 10 USD
- transportation box (aluminium) ~ 50 USD
- Arduino, v3 shield and four A4988 motor drivers: 40 USD
- Three stepper motors NEMA 17: 25 USD (or smaller version)
- Power supply 12V for steppers: 30 USD
- simple camera with manual focus lense : 30 USD
- Raspberry Pi with 5V power supply, SD card 50 USD
- CAD files (STL): open source
- Arduino platform: open source
- Motor control application: open source
- Raspi software (Raspbian etc.): open source
- EasyDeal application software: open source
Alltogether less than 300 USD.