This LED beer pong table blows minds, and if you do it correctly, no fuses. The fully functional model both detects where a ball bounces and enhances your partying experience with a music-sensitive light show. As you will see, our current version only lights up in time with bass and the ball-detection element will be added in a few months. If you try to recreate this table, brace yourself for soldering. A lot of soldering. We have broken down this instructable into the basic electronics involved, the coding for the microcontroller, and the larger wiring layout.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Building 1:8 Prototype
This table required only a few different components that anybody attempting this project needs to be familiar with.
The important electronic components:
· Light Emitting Diodes (LEDS): Emit light in a variety of wavelengths when a given voltage difference is put across the two leads.
· Darlington transistor: (Two transistors in series–the emitter of one transistor connects into the base of a second transistor)
· Arduino UNO Microcontroller: Converts digital commands in the form of computer code to voltages recognized by the Shift Registers.
· 8 Pin Shift Register: Each pin can be controlled to be high voltage (LED “ON”) or low voltage (LED “OFF”), so if every pin is connected to one LED, we can control 8 LEDs independently. The way that it does this will become important when considering the coding challenges.
· Photoresistor (These will be explained further in the “Ball Detection Section”
The basic premise of our layout was to be able to control as many LEDs as possible while keeping the total current within safe and manageable limits. We drew heavily from 8x8x8 LED cube designs. As I mentioned before, 1 shift register has 8 pins that can control 8 LEDs, so with 8 shift registers we can control an 8x8 square of 64 LEDs. To be able to control even more LEDs, we wired 8 LEDs to each pin of each shift register, in essence making 8 squares of 64 LEDS each for a total of 512 LEDs. In order to control each square of 64 LEDs, we wired the cathodes of all the LEDs in each square through the collector of a Darlington transistor. Thus for 8 squares, we required 8 darlington transistors. The emitters of the 8 darlington transistors were connected to ground via a 10 ohm resistor and the bases of the darlington transistors were controlled by a demultiplexer which acts similarly to a shift register. By cycling through the 8 squares faster than the eye can detect, it appears that the whole table is on while drawing 1/8 of the current. With this setup, the current never exceeds .64A. Making 1 8x8 square as a prototype is a good place to start to work out wiring and coding bugs.
Step 2: Ball Detection
We decided to implement a light-based ball detection system for cost and simplicity reasons. A pressure-based system would require many piezo wafers that would be exposed on the table and risk being damaged. By placing fluorescent light bars on one side of the table, we can detect the shadow cast on the other side of the table by a ball striking the playing surface. The photodetection circuit is merely a voltage divider and relies on photoresistors, whose resistance dramatically decreases when exposed to light.
Thus, the ball casts a shadow on the photoresistor, the resistance will increase, and the green wire feeding into the Arduino will measure a higher voltage.
Of course this design will only allow detecting the ball’s position in one dimension which is certainly one of the drawbacks to this approach.
Step 3: Construction: Grounds
Our table was 96” x 24” with LEDs spaced 1.5” along the width and every 3” along its length. We used 2, 30” x 48” pieces of particle board with 4” and 2” on either side of the LEDs. The particle board was wood glued onto a frame of two 2x4x96 long pieces and three 3x4x30 cross pieces. The particle board was spray painted black, and drilled to make space for the LEDS. Horizontal strong wires were super glued to the underside of the table that were each soldered to the cathodes of one row 8 LEDS. These rows were connected in sets of 8, to make a common ground for 64 LEDS. A long wire from this strong wire then connected to a darlington transistor in our circuit board.
Step 4: More Construction: Adding LEDS and Connecting Anodes
The next step was the long process of meticulously soldering each anode of the 512 LEDs to the proper shift register pin. We used 8 different colors of wire and cut 8 ~20ft lengths of each for a total of 64 wires and over 1,000 ft total. We arrranged these wires into 8 bundles containing one of each color. Each color represented a pin position and a position on the table. Each bundle represented a different shift register. Each wire wrapped around the table to connect 1 LED from each square, (8 total). Duct tape came in very handy for maintaining some kind of order underneath the table. By drilling holes in the middle cross pieces and feeding the bundles through these, the wires were kept from sagging.
Step 5: Individual LED Control
We used the alternate LED control scheme described in this 8x8x8 LED cube instructable in our table. We used eight shift registers with a common clock and the Arduino PORTD functionality to efficiently control 64 LEDs at a time. We then choose which of our eight 8x8 squares to control by choosing a transistor to turn on with a multiplexer/depmultiplexer. We use pins 0-7 on the Arduino for each of the shift register inputs, one pin for the common clock, and four pins to control the multiplexer/demultiplexer. The main difficulty we found in perfecting this was finding the few LEDs whose leads were touching and the one LED that was put in backwards. Each of these caused their square to malfunction, as they allowed the whole square to be grounded when it was not supposed to be. Debugging these took a while because we have a lot of LEDs to look through, but after fixing these small issues our table worked perfectly!
Step 6: Bass Response
We wanted our table to respond to the bass that plays in your party environment, so that it parties with you. We used a small microphone you can find for cheap over at Adafruit coupled with a digital FIR filter we made by following this great tutorial and using this tool that is linked there. Our first prototype was to hook up the microphone and a single LED to our Arduino board to make sure that we could accurately detect bass. Once we had that, we simply combined the code for controlling our table with this prototype, and we had a bass-reactive LED table. We decided to have a bit of fun with our table's reactions, so we programmed in four different patterns that our table would randomly choose between when adequate bass was detected. This was probably the easiest part of the project, because once we had a table where we could control individual LEDs, it only took a couple hours to add the microphone and get the cool effects you can see in the above video. Here is our code for the bass reaction, including the FIR filter. We chose to have 0-200 Hz frequencies trigger our table, but your preferences may vary. If you want to have different frequency sensitivity, just modify the filter, but the reaction code should still work.
Step 7: Future Steps
There are a few finishing touches that we would still like to add to our table so that our parties reach their full potential:
As mentioned before, we still need to add the ball detection element to our table which will involve a small amount of construction to our table to protect our photoresistors and fluorescent lights and a small amount of wiring to connect everything with our arduino. We will likely need to use a second arduino and several multiplexers to monitor the amount of photoresistors required to span the table.
We also need to complete the surface of our table which currently is just our exposed LEDs. We bought four, 1/8" x 24" x 24" pieces of clear extruded acrylic from tapplastics.com which we sandblasted but have not yet secured to the table. We encourage anybody attempting a similar project to experiment with different plastics on their own to see which varieties offer the best combination of aesthetics and bounce.
Step 8: Conclusion
Whether you are an experienced upperclassman or new to the glory and anguish of beer pong, this is your chance to add a new chapter to the ancient tomes of partymeteorology (the study of party atmospheres). The study of partymeteorology has long been overshadowed by disciplines such as Physics or Biology, but while there may not be a nobel prize awarded in the field of partymeteorology, know that you are helping the world in a way that the scientists probing the fabric of our universe and synthesizing better medicine are not.
Check out this page in the future for updates to our table!
Step 9: Acknowledgements
We would have injured ourselves or others by now if it were not for the following:
Our wonderful Department of Physics and Astronomy
Our fellow classmates