Arduino Powered Poker Table

Arduino Technology
Arduino Powered Poker Table

Arduino Poker Table

Build summary from the maker, Justin Trzeciak:

I made a poker table with RGB LEDs at each seat. They sit underneath white polycarbonate such that the light is diffused across the whole section. The LEDs are on a strip, but they are digitally addressable. That way, each of the 96 individual lamps can be controlled using only two output pins of a microcontroller. I used the Arduino UNO R3 along with the ethernet shield for this project. With the ethernet shield, I was able to make a web app to control the table. I originally wired up some switches and potentiometers to control the lights, but the web app turned out to be far more intuitive. Also, I chose to do a web app over a mobile app or desktop application for its cross platform nature. The programming is executed on three different levels.

From end-user to table, the first step is the client side code on the web page, Javascript. Along with the jQuery library, this code accepts all the information from the user and passes it to the web server. For the manual page, it simply passes the along the colors that correspond to each seat. For the tournament page, however, the Javascript actually does all the work to determine how to shift the colors each hand. It looks at who is still in, where the dealer is located, and incorporates the rules of Texas Hold ‘Em to determine the order of play for the next hand. Having the client-side code handle the tournament functionality is good and bad. Nothing is stored on the Arduino, so, on one hand, if the page refreshes, the status of the game is lost. On the other hand, as computers and browsers get faster, so will this functionality. Plus, manual and tournament mode could be easily switched back and forth by simply changing browser tabs.

The next step is the PHP or server side code for the web page. It’s sole function is to be the link from the web page to the microcontroller. This code resides and is executed on my home server. There might be a way, but I don’t know how to do network socket programming straight from Javascript. The PHP pulls in the data from the web page as a POST request. It is also worth noting that the web page uses AJAX. That way, the page doesn’t refresh every time a new configuration is submitted. Then, the data is repackaged for the Arduino and sent away across the network.

Finally, all the Arduino has to do is take the message it received from the web page and adjust the lights accordingly. The controller itself sits in a small, HTPC case under the table top. Using the computer case was convenient. It provided an enclosure, 12V power supply for the controller, 5V power supply for the logic and lights, a small speaker to play with, and USB ports on the front to wire as chargers. The extra room in the enclosure was nice for prototyping too. All the circuitry is still connected with a solderless breadboard. It’s not the ideal configuration, but I didn’t know for sure if everything was going to work right for the get-go.

If I ever made another table, I would make all the electronics more compact. It would be very cool to get a custom PCB for microcontroller and all the external circuitry together. Also, embedding the web server on a Raspberry Pi inside the table would be helpful. In addition, I would have to change the design for some of the carpentry. I had never made anything this complex, and finer details did not come out quite like I had hoped. New brackets to join the boards between the polycarbonate and felt would one of the necessary changes. Pictures can be found at jrtrzeciak.wordpress.com and the code at https://github.com/jrtrzeciak/pokerTable.

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Tagged

Ken is the Grand Nagus of GeekDad.com. He's a husband and father from the SF Bay Area, and has written three books filled with projects for geeky parents and kids to share.

View more articles by Ken Denmead
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK