Introduction: Electronic Scoring for a Bean Bag Toss Baseball Game
This Instructables will explain how to automatically keep score electronically for a Bean Bag Toss baseball themed game. I will not be showing a detailed construction of the wooden game, those plans can be found on Ana White’s website at:
These plans are very good and detailed. These plans are what I used to fabricate my game. I made a couple of modification to the plans. The first modification I made was to widen the bottom board to better catch the fallen bean bags. My second modification was to use ½ inch plywood instead of ¼ inch plywood.
The baseball themed bean bags can be purchased on Amazon. See the web site:
https://www.amazon.com/gp/product/B00IIVJHSY/ref=p... After constructing the game’s wooden structure, I laid out the baseball “diamond” and where the scoring holes would be. I used a 4” hole saw mounted in my portable drill to cut these uniform scoring holes. Each hole edge was then sanded smooth.
Step 1: Electronically Counting the Bags
I needed to find a way to count the bags as they passed through each scoring hole. Remember, each hole has a different scoring value, with the “Home Run” hole having the highest point value. I first thought of using a mechanical switch, such as a momentary arcade coin door switch with a long trip wire. I had used these in skee ball machines, but I didn’t think they would work as good with cloth bean bags.
I settled on an Infrared (IR) break-beam sensor to detect bags as they passed through the scoring holes. I used a great product from Adafruit Industries called a “IR Break Beam Sensor – 3mm LEDs”. The Product ID is 2167:
They are sold in pairs (emitter & receiver) and offer a simple way to detect motion. They work up to 10 inches apart and can be powered by the Arduino 5V power supply. You can use these with the Arduino built in pull-up resistor, so a separate resister is not needed. The emitter sends out an IR beam and the receiver, directly across from it, is sensitive to this IR light. If something solid passes through the beam (like bean bags) the beam is broken, and the receiver can be programed to let you know.
Step 2: Installing the Sensors
I turned over my wooden game to mount the sensors. I needed to mount the IR sensors on the underside of the plywood play board so they would not interfere with the free-falling of the small bean bags. A 1” diameter hole was drilled on opposite sides of each scoring hole to a depth of 3/8 inches (another good reason for using 1/2” thick plywood). The IR receiver and emitter were placed just inside the rim of the hole so the bags would not hit them. They were mounted permanently with a small metal bracket and a wood screw, so they were aligned perfectly across from each other. Once the IR sensors were all mounted, they had to be wired and soldered to a central perforated hobby board with common ground and 5V connections. All wiring was tacked down and attached securely against the inside of the game board to not interfere with the falling of a bean bag after it goes through a scoring hole.
Step 3: Electronic Scoreboard Design
Next, the scoring area (Home & Away) at the top of the game board had to be modified to display an electronic scoreboard. The scoreboard would consist of 4-digit, 7-segment LEDs for each team’s score and a single digit, 7-segment LED would be used to track the innings. The 4-digit, 7-segment LEDs are from Adafruit Industries. They are called “1.2” 4-Digit 7-Segment Display with 12C Backpack – Red”. You need two of these and the Product ID is 1269. See below:
The oversized (2.3”) single digit 7-segment LED was a generic purchase from eBay. Any oversized display will work and must be wired correctly for a common cathode or common anode based 7-segment LED.
A 2 ½” x 18” opening was cut in the plywood. The edges were sanded smooth. A corresponding mounting board was cut from 1/8” thick plywood to a slightly larger size then the opening. This would allow for it to be mounted to the inside of the game board. This is the board that the two 4-digit, 7-segment LEDs and the oversized single-digit, 7-segment LED will be mounted to. The inning display will be mounted in the middle with the two scoring displays centered on either half of the game. I will mount the “Away” team on the left since they will “bat” first. I will also mount a green LED on the scoreboard to light up every time a bag goes through a scoring hole.
Step 4: Control Buttons
We will need three buttons to control the flow of the bean bag toss game. All buttons will be mounted on the outside of the game in a recessed position to protect them from being accidentally hit by a thrown bean bag.
The game’s on/off button will be mounted at the top of the game. The on/off switch will be connected in line with a 9-volt DC battery source that powers the Arduino Uno board and all other electronic components.
The two other momentary buttons will be mounted on each side of the game. The left side button will be the “Reset” button. This button is pushed to zero the scoreboard displays and program variables in anticipation of starting a new game.
The right button will be the “At Bat” button. Each “team” or player will have 9 bags to throw for each time “at bat” or half inning. Since all bean bags tossed will probably not go through a scoring hole, I could not consistently count the bags tossed to determine when a half inning was over. I needed some other way to switch which “team” or player was “at bat”. This will be done manually with this “At Bat” switch.
Once a “team” or player tosses 9 bean bags, weather they go through a scoring hole or not, the “At Bat” button is pushed to bring the opponent (opposing player) up to bat (throwing).
Step 5: Component Bench Set-Up
The bench set-up is shown in the picture below. Pull-up buttons were used on the bench to mimic the break-beam IR sensors. I use a 4-line LCD monitor on my test bench to track variables and make sure the code controlling the scoreboard is working correctly. I like using this in place of the serial monitor.
Only one 4-digit, 7-segment LED display is shown on the bench, but both “Home” and “Away” score displays were shown to work correctly. The 3 game control push buttons were also tested and shown to work correctly.
Step 6: Code
The Arduino code to control the flow of the game and add up the scores correctly is shown below:
Step 7: Putting It All Together
The last step was to secure all the components to the game board and connect all the wiring to each. Everything was securely mounted to the plywood and the connections (wiring) was kept as low of profile as possible so as not to interfere with the bean bags falling through the scoring holes. The scoreboard displays were connected to the Arduino and corresponding power supplies. A 9-volt battery was used to power the Arduino. I used 1/8” thick hardboard for the back of the game. This board was attached with 6 wood screws.
Step 8: Game Stand
I wanted my game to be portable, so I did not hang it on a wall. I made two side legs out of 1 ½” PVC pipe. They were attached to the side of the game with full threaded T-Track screws with knobs
that screwed into T-Nuts embedded in the side of the game (below the push buttons on either side).