Introduction: Arduino Servo Foosball
by David Joy and Andrew Gothard
Step 1: Introduction
Our objective: To create a Foosball like game using Arduinos, servos and its arms, and wooden pieces.
Why: We decided that this project would give us the chance create something interesting and usable while allowing us to work with a broad range of topics, such as, wood working, coding the Arduinos, 3-D printing, and wiring.
Step 2: Materials Needed
- Arduino (including redboard and breadboard)
- Laptop (if Arduino must be connected to run)
- 4 servos and disks
- 8 3D printed servo arms
- 8 buttons
- 8 10k ohm resistors
- Sufficient wiring
- Access to a 3D printer
- Wood (see specific sizes in building the board section)
- Ball (a table tennis ball works well)
- Super Glue
- Screws and drill
Step 3: Creating the Servo Arms
- Use Onshape to design servo arms to use in order to hit the ping pong balls in the game.
- Make each arm 6 cm long with a part that extrudes down 2.5 cm. (Be sure that the extrusion extends so it can rotate around the servo itself.)
- Use the a circular servo piece to attach the arms onto and place the center line of the first one, that points to the center of the board, parallel to the goal sides of the game board.
- Place the center line dividing the second arm at an angle of elevation of 129 degrees to the first servo arm.
- Next place 4 servo's 5 cm above each of the diagonal guide boards and 9.75 cm from each of the side walls closest to the servo. (There should be two on each side.)
- Then we drilled a hole for the servo wires to fit through and glued down the servo with super glue.
Example of our servo arm: https://cad.onshape.com/documents/5f6eb41ccc33b434...
Step 4: Creating the Board
- Make a 54x36 cm wooden base. (This accounts for the thickness of the walls.)
- Then cut a four 14 cm diagonals and two 30 cm sides. (These walls should be 2 cm thick and 4 cm or greater.)
- Next draw lines that are parallel to each side two centimeters away from the wall to create a new rectangular box.
- Then at each of the four corners of the rectangle measure 10 cm along each side of the rectangle and draw a line between those two point. This line is the line for the diagonal wall pieces.
- Once complete measure 5 cm above each diagonal and draw a line that is 9.75 cm long and is perpendicular to the side board.
- Draw or trace a rectangle that is centered at the end of the line that matches the servos base.
- Then draw a line between each pair of diagonals that is parallel to the goal sides.
- Cut a sloping surface that slants toward each of the goals between the two diagonals and the line drawn across them in the previous step.
- Drill a hole for each servo close to the servos base and in between the servo and the side wall.
- Screw each of the wall pieces down and use super glue to hold down the servo.
- Super glue the servo arms to the servo by placing the servo arm on the inside of the board parallel to the goal sides.
- Next connect the wires for the servo underneath the board.
Step 5: Electronics and Programming
- "The electronics for each player consist of 2 servos, 4 buttons, 4 10k ohm resistors, an arduino, and sufficient wiring.
- On each arduino, connect the positive (black plus) column to 5V and the negative (red minus) to ground.
- Place four buttons on the breadboard where you want them.
- Test to make sure you can push the buttons comfortably before continuing.
- For the one on each button (that a contact is in) connect a 10k ohm resistor between that row and the positive column.
- On each of the same rows, connect a wire to the appropriate pin.
- Pins 2 and 3 control the servo in pin 9 and pins 4 and 5 control the one in pin 10.
- To wire the servos (you will need to have them glued on for this step), connect the white wire (signal) to pin 9 or 10 (depending on which buttons should control it). Connect the black wire (power) to the positive column and the red wire (ground) to the negative column."
"Download the program attached and upload it to both arduinos. The program initializes all servos and inputs, then checks for buttons pressed every 20 milliseconds (50 times per second) and adjusts the servos accordingly. After the program is uploaded, each servo will turn for 1.5 seconds to confirm that they are wired correctly, and will end at 90 degrees."