The Casino Cam (CTAI Howest)
by roelremmerie in Circuits > Raspberry Pi
16 Views, 0 Favorites, 0 Comments
The Casino Cam (CTAI Howest)

Do you like card games? Does AI or Internet Of Things peak your interests? If you answered yes to any of these questions you came to the right place.
The Casino Cam is a table where you and your friends can play the famous Catalan - French card game of Manilla. A phone camera records your game and at the end of each round you don't have to count your points, the table does it for you! In this Instructable I will explain how you can make the table and run the game.
If you are not familiar with the game of Manilla, you can learn more here.
Supplies



Tools you need for building the table
- Roll of duct tape
- Large ruler (100 cm)
- Box cutter
- As much cardboard as one can find. (Check with stores if they have some cardboard to spare)
Electroncis
- smartphone (android operating system)
- pc or laptop
- raspberry pi
- USB-c power
- ethernet cable
- lcd display
- 4 small cables to connect the lcd display to the raspberry pi
Create the Table















Before we get started:
- cm stands for centimeters.
- Use a ruler to cut straight with your box cutter.
- Images are placed in chronological order. Use them to follow allong with the steps.
- Pillars
- Take two longer pieces of cardboard hat have an edge that can fold in the middle.
- Cut out two longer pieces of equal height (+-80cm) and 15 cm width.
- Cut out 5cm by 3cm holes at 70cm height on each pillar.
- Table base
- Stack multiple layers of cardboard carefully together at 4cm of height.
- Cut out an 80cm by 80cm square (like a cake).
- Use tape to your hearts content to hold it all together.
- Cut out 2 holes at opposite corners (2cm deep) that can hold the pillars upright. These holes should be 2cm away from the edge and the same thickness as the pillars
- Table edge
- Stack three layers of carboard edges (8cm width) resembling the outline of a square (80cm by 80cm outside / 64cm by 64cm inside)
- Use tape to hold it together.
- Cut out identical holes for the pillars as on the table base. Make sure they line up.
- Phone camera housing
- Fold a piece of cardboard 4 times.
- Cut out a hole for the camera.
- Use a simple line of tape to secure the housing.
- Beam
- Use cardboard residue edges (5cm width) and stack them together to form a 120cm by 5cm by 3cm beam.
- Wrap tape around to hold it together.
- Make sure it's strudy enough.
- Felt
- Cut out a 75cm by 75cm square from your green felt.
- Cardboard assembly
- Place the felt in the center of the table base.
- Place the table edge on top of the table base and felt.
- Slide the pillars into the holes of the table edge and table base.
- Slide the beam through the phone camera housing.
- Slide the beam with phone camera housing through the holes made in the pillars.
- raspberry pi assembly
- carefully inspect your raspberry pi and lcd display pins.
- We will be using pin numbers 3, 4, 5, 6 on the raspberry pi.
- We will be using pin numbers 3, 2, 4, 1 on the lcd display. (yes that is strange number order well noticed by you.)
- Use the 4 small wires to connect the pins from the raspberry pi to the lcd display. Use the strange lcd pin order (8c.) to properly connect the wires to the corresponding pi pins (8b.). Make sure you get this right to not fry your pi or lcd.
- Full assembly: slip the lcd under the table edge.
- (BONUS) Disassembly: slide all the loose parts out of eachother. Easy peasy.
Raspberry Pi Code
Follow each step carefully on your raspberry pi.
Install python 3.11 on your raspberry pi
Create a directory named casino-cam in your home directory on the raspberry pi with the following structure
Make sure your working directory is the casino-cam directory. Use vscode ctrl+shift+P to activate the command pallette. Search for "Python: Create Environment" then follow the steps to create .venv virtual environment based on the requirements.txt file. Check out this link for more information.
Your directory now looks like this
go to your home directory and create the following file: casinocam.service
Now execute the following commands
Copy This File to /etc/systemd/system as Root User
Test the File by Starting It
Stop the Service
Enable the Script to Start Automatically After Booting
Now reboot your Pi
Set Up Droidcam


- Download droidcam client from dev47apps on your pc or laptop.
- Download droidcam from the google play store on your smartphone.
- Open droidcam on your smartphone and droidcam client on your pc.
- Find the browser ip cam access port on your phone and fill in the phone ip and port in on the droidcam client.
- Press connect (your phone is now registered as a webcam)
PC Code
Follow each step carefully on your pc or laptop.
Due to Instructables' constraints I cannot upload my trained model weights. Please contact me if you wish to use them.
Create the following folder structure
Change line 16 to match the ip address your lcd is now displaying.
Make sure your working directory is the casino-cam-game directory. Use vscode ctrl+shift+P to activate the command pallette. Search for "Python: Create Environment" then follow the steps to create .venv virtual environment based on the requirements.txt file. Check out this link for more information.
Open your terminal in the casino-cam-game directory and execute the following commands.
Activate the virtual environment
Run the app using gradio
now navigate to http://localhost:7860 and enjoy the game!