Sunday, March 22, 2020

Pokereno Scoreboard

After completing the Pokereno table I decided it needed a ticket scoreboard to hang behind the machine to indicate which hands would pay tickets. After all, how are kids supposed to learn how to play 5-card stud if you don't start teaching them the hands when they are little?


The Bay Arcade had this sign posted on the wall. The 30 wins for a Royal Flush was based on the fact that at the Bay Arcade each ticket represented 3 wins.

Our new sign uses almost the same scoring as the original except we are calculating a 1 win per ticket and I moved the Full House to the same win level as a Flush since a Full House is actually a higher hand than a Flush in poker. Was this a fail when they made their sign?


I also have added a 10c logo because the Pokereno can now be played with a genuine Bay Arcade Token or a genuine U.S. Dime. My fail is the explanation under Two Pair, I wrote "Two of the Same Suit, with Two of the Same Suit" where it should have been "Two of the Same Rank, with Two of the Same Rank". My card pictures were correct but my cut-n-paste of the explanation was my fail.



Tuesday, February 18, 2020

Pokereno in Play

Playing the Pokereno with replacement Arduino Board


Pokereno Sketch

This post is not meant to be a tutorial on how to write an Arduino Sketch... but if you want to see how this was programmed I have posted a zip file with my PokerenoFinal.ino file.


The Game Stats has 3 modes:
  1. Waiting for Coin Drop
  2. Waiting for drawHand to be populated with 5 cards
  3. Calculate Win
The first key is to assign every card in the deck a number from 0-51... (This logic was used from another Poker sketch I located on Arduino.cc the author was not attributed so it remains so in my sketch.) This allows the checkWin calculation to know if we have all Hearts or a Straight etc. 

// Used to calculate hands in checkWin 
// cards are value 0-51 // 0-12 Hearts // 13-25 Spades // 26-38 Diamonds // 39-51 Clubs
const char* cardDeck[] = {
 "Ah","2h","3h","4h","5h","6h","7h","8h","9h","Th","Jh","Qh","Kh",  
 "As","2s","3s","4s","5s","6s","7s","8s","9s","Ts","Js","Qs","Ks",  
 "Ad","2d","3d","4d","5d","6d","7d","8d","9d","Td","Jd","Qd","Kd",  
 "Ac","2c","3c","4c","5c","6c","7c","8c","9c","Tc","Jc","Qc","Kc"
};

The next key is to tell the Sketch the 0-51 value of every card on the Pokereno table
// Backglass map to the position of the Cards 0-51 value 
const int cardValue[6][6] = {
  {34,9,23,37,25,39},
  {21,48,10,50,12,26},
  {8,35,49,11,25,13},  
  {47,9,36,50,51,0},
  {8,22,23,11,38,39},
  {21,35,36,24,51,26}
};

The first card in the upper left corner is a 9 of Diamonds (34),  the next card is 10 of Hearts (9). You notice there are 6 cards in each of the 6 rows just like the backglass. When the balls roll into one of the holes the switch goes to ground and the Optisolator sends a 5V signal to the Arduino. The sketch listens until 5 are populated and then it calculates the poker hand using the sub-routine checkWin. This triggers the number of wins tripping the relays controlling the Winner Lamp, Bell and Ticket dispenser.

A fair amount of the settings you will see in the Sketch (like cardFace & winName) are simply to provide "English" words to use in the serial output for debugging. I've commented on the sketch to help me remember what I did. If you use this for a project let me know. Don't forget Arduino arrays always start with 0.

Saturday, February 8, 2020

Wiring the New Pokereno Logic Board

Since I was going with a no-solder design. I started with a piece of plywood and about $250 of parts and accessories. The primary components are:
  1. One (1) Arduino Mega $20 
  2. One (1) Electronics-Salon Screw Terminal Block Breakout Module $30, 
  3. Five (5) Alzard 24V to 5V 8 Channel Optocoupler Isolation Boards, $75 ($15 ea)
  4. One (1) 8 Channel 12V 5V Relay Board Module $12
  5. One (1) 12V to 5V DC converter. $10
  6. Two (2) Corsham 22/44 Pin Extenders (one cut down to 12 pins with a Dremel). $50 ($25 ea.)
  7. 22AWG Solid Core wire in 10 colors. $35.
In a perfect world, I would have had 50 wire colors I even considered re-using the old harness but decided it would be better to use solid core wire that would allow me to easily use Dupont pins to connect to the Corsham Pin Extenders and the Relay board. Everything else is connected to screw blocks (no soldering).
The 36 card leads were pinned with 3 ea. 6 pin Dupont connectors and run to 36 of the 14V leads on the Alzards. (I had to stack them 3 high and 2 high to fit in the Pokereno cabinet.) The 5V output from the Alzards were connected to pin_53 throught pin_14 (INPUT) on the Arduino.

I skipped pin_18 through pin_21 because they are used as interrupts on the Mega. (I wasn't sure if I would need interrupts for the coin-drop detection, more about that in the programming post.)

From the lower connector the pins were connected as follows:
  1. Token-In - to Alzard 14v to Ardiuno pin_5 (INPUT)
  2. Ball Release  - to Relay_2 to Ardiuno pin_11 (OUTPUT)
  3. Dime-In  - to Alzard 14v to Ardiuno pin_6 (INPUT)
  4. Lamp Coin-In - to Relay_1 to Ardiuno pin_12 (OUTPUT)
  5. Bell - To Relay_3 to Ardiuno pin_10 (OUTPUT)
  6. Tickets  Disp - to Relay_4 to Ardiuno pin_9 (OUTPUT)
  7. Lamp Winner - to Relay_5 to Ardiuno pin_8 (OUTPUT)
  8. Lamp Game Over - to Relay_6 to Ardiuno pin_A13 (OUTPUT)
  9. skipped
  10. 14V+ - to 8 screw junction block
  11. Ground - to 4 screw junction block
The Arduino pins were selected based on their contiguous locations on the Electronics-Salon Screw Terminal. I skipped pin_13 because it "flutters" during the Arduino boot sequence.

The Arduino no-solder replacement for the Pokereno logic board. 10 lbs of Electronics in a 5 lb sack. This design is neither practical or cheap, but it is a DIY project.
The left column shows the Arduino Pins connected on the Optocoupler and the Relay.  

Next up was programming the Arduino (writing a sketch) to play Pokereno!

Saturday, January 18, 2020

Siedel Pokereno Wiring Diagram

The Next step was to figure out what the other 13 pins did that lead to the small edge connector. Someone with a little experience could have likely figured this out in 10 minutes but I chased each wire and made a wiring diagram.
I removed all the components from the spare side of the machine (remember this was a twin, so I have an extra set of replacement parts). I cut open the harness and traced each wire. (I spent slightly more time than 10 minutes.)

Siedel Pokereno Wiring Diagram/Schematic.
The 13 pin edge connector is on the right edge. This is where the Arduino will operate the Pokereno.
The significant thing about the Pokereno is the backglass lamps all work without the logic board plugged-in. They are hardwired to the power supply. If one lamp is out, replace the bulb. If none of the lamps light, replace the power supply.

Tuesday, January 7, 2020

Replacing the Pokereno Circuit Board with an Arduino

Shortly after filming the video playing the Pokereno I started losing functions on the Pokereno motherboard. I patiently waited a couple of years hoping a Pokereno would be parted out on eBay... but I had no such luck So I'm working on replacing the entire motherboard with an Arduino Mega. These are ~$20 on eBay and can be programmed to "Listen" for input and trigger output to relays.

The Mega has 65 pins so I can use the Arduino to monitor the 1) coin drop 2) the 36 card positions and then send signals to the 3) Coin-In, Winner, and Game Over lamps as well as trigger the 4) Bell and 5) Ticket Dispenser. Sounds easy right? Given the fact I'm an electronics novice, I prepared to eat an elephant.

First I mapped all the cards to the 22 Pin edge connector. Following the wire colors and verifying with a multimeter I figured out which pins on the edge connector went to the negative side of the bulb sockets.
The 36 cards are wired to the 22 pin (long) edge connector. The lamps are wired to the 14V+ lead on the transformer. When the balls drop into the deck holes the lamps are brought to ground and light up with about 10V of power and the 5 corresponding leads on the edge connector go to ground.
The edge connector is wired in 3 sets of 12. The drawing has the pin number below the corresponding card face. The squares are the backglass lamps the circles are the deck switches. As an example, I drew in one connection for pin 22.
Next up was to come up with a way to send the ~12v ground signal to the Arduino which can only handle a maximum 5V signal. The community at arduino.cc helped me come up with this. Using a couple of resistors I could create a voltage divider to reduce 14v --> 5V
Here we have a working concept, I will need 36 of these to tell the Arduino when a card lights up. After 5 are lit the Arduino will go to the scoring routine and then wait for another coin drop.
Since I'm not equipped to build a nice circuit board with 36 voltage dividers, I decided to stack up 5 optoisolators. I got the 24V --> 5V versions and they trigger just fine with the ~12v signals when the bulbs go to ground.
My buddy Jeff (Bezos) says he can send me an optoisolator for $12. I decided to use 5 of them eliminate the 36 Voltage Dividers.