Backyard games like Cornhole are a lot of fun. But you can make them even better by adding lights and sounds. By hooking up some simple electronics, you can make the board light up and play a victory fanfare whenever someone scores. Here is how to make it.
To detect when someone scores, I am using a basic light sensing circuit. A laser pointer is set up on one side of the hole. On the other side of the hole, a light detector is positioned in line with the laser pointer.
The light detector that I am using is a photoresistor that is wired in series with a 10 kohm fixed resistor. The 10 kohm resistor is connected to 5V and the photoresistor is connected to GND. The center pin between them is connected to an analog input pin on the Arduino.
When the light beam of the laser pointer is interrupted by the bag going through the hole, the voltage at the center pin goes up. This change in voltage is detected by the Arduino and the Arduino activates lights and sounds.
The lights require more power than Arduino can output. So we need to use an external power source. I decided to use two strings of battery powered LED lights.
To turn the lights on and off, I am using a pair of IRF510 power MOSFETs. The gate of the MOSFET is connected to digital pin 6 on the wave shield. The source pin of the MOSFET is connected to the GND pin on the wave shield. The source pin of the MOSFET is also connected to the negative terminal of the light's battery pack. The Drain pin of the MOSFET is connected to the spring of the battery holder.
These are separated and insulated from each other by inserting a piece of card stock between them. With this card in place, the light circuit can only be completed through the transistor. When a HIGH signal is sent from the Arduino to the Gate pin, the transistor connects the battery to the LEDs and the lights turn on.
If you want your game to play sounds, you can add a WaveShield to your Arduino. This will let it play audio files. This shield may be purchased as a kit from Adafruit or fully assembled from the MakerShed. If you choose to assemble it from the kit, you can get detailed instructions from the Adafruit website. For this project, one additional wire needs to be soldered to digital pin 6 to allow it to activate the lights.
Download the zip file. Then unzip/extract the files. Copy the WaveHC folder into the libraries directory of your Arduino program folder. You can find a detailed tutorial on the library and how to use it here.
Step #9: Convert the audio files to the .WAV format
The Wave shield can only play audio files in the .WAV format. So if your sound recorder saves the files in a different format, you will need to convert them to .WAV.
If you have iTunes you can use this tutorial to convert them. You can also use online file converters such as this one.
Regardless of which program you use, you need to convert the file to the .WAV type. The bit resolution should be set to "16 bit". The sampling rate should be set to 22050 Hz (or 22.050 kHz). The audio channels should be set to "Mono."
For simplicity, I changed my audio file to 1.wav. If you use this file name you will not need to modify the code. Then just load the files onto an SD card and insert it into the wave shield.
Step #10: Attach the light sensor circuit to the game board
Now you need to attach the laser pointer and the light sensor to the game board. To do this, I just used hot glue to stick the parts to the underside of the board. Just make sure that the light sensor is perfectly lined up with the beam of the laser pointer.
Step #11: Attach the rest of the parts to the inside of the game board
Now you are ready to play a game. Whenever you toss a bag into the hole, it will interrupt the beam from the laser pointer. Then the lights and sounds will play. I did this with a basic cornhole board. But you can make this work with lots of different games. For instance you could make this same setup with a basketball goal. Try it out and have fun.
My name is Jason Poel Smith. I have an undergraduate degree in Engineering that is 50% Mechanical Engineering and 50% Electrical Engineering. I have worked in a variety of industries from hydraulic aerial lifts to aircraft tooling. I currently spend most of my time chasing around my new baby. In my spare time I make the how-to series "DIY Hacks and How Tos."
When you buy through links on our site, we may earn an affiliate commission.
We'll assume you're ok with this, but you can opt-out if you wish.