Last year was the first Champlain Maker Faire. No one really knew what to expect, least of all me. I went with everything I had ever made, perhaps 15 or 18 separate projects. A canoe. Guitars. Stirling engines. LED light controllers. The pPod. Magnetic spin toys.
This coming September is the next CMF, and I’m already trying to design some new things. Lots of ideas, but not sure exactly what will come of them. LED reaction time games. Magnetic ferrofluid. Smoke ring vortex generators. More magnetic spin toys. My emphasis will be on integration of 3D design, 3D printing, Arduino firmware, and desktop software, the tools of the trade in rapid prototyping.
One idea was a reaction-time game where a series of lights were displayed, and the player has to touch each light as it is illuminated. I found some inexpensive SMD RGB (red green blue) LEDs and set to work. You can see all of the parts here:
The idea was for each light to have an RGB LED and a touch switch. I created a translucent white plastic “button” on my 3D printer, set up so that a metal washer could be press fit into a circular slot. The LED would shine through the center of the washer, and the player would touch the washer.
This is my first attempt:
It worked, but once we tried to dummy up a game surface, it became clear that the buttons were too large. We moved down a size and came up with this:
Refinements included omission of the raised surround that we had with the larger button, and wings on the bottom to ensure that each button ended up at the same height after we pressed them into the game surface. My girlfriend, Cassidy, agreed to create some game art around the illuminated buttons, so it was important that the buttons were a little “proud” of the game surface, to preserve the artwork. Note the small hole under the washer to accept the wire needed to transmit the touch back to the Arduino.
The underside contained a rectangular cavity into which a small PCB (printed circuit board) would be press fit. Another rectangular cavity was required inside the first to accommodate the LED. Printing the parts required that the cavity be on the bottom, which then required that some support material be designed into the part, as can be seen here:
The SMD RGB LED can be seen here, along with one of the PCBs with the LED soldered in place. My friend Ralph Lemnah made the circuit boards for me.
Once the buttons were made, I needed to write the firmware that went into the Arduino, and then the desktop software that would drive the Arduino. An Arduino Mega has roughly 50 available I/O pins, and with 4 pins per LED (red, green, blue, and switch/washer) I could only support 12 LEDs. Other approaches came to mind (shields on the Arduinos to increase I/O pins, and LEDs already set up for serial control, but I decided to stick with the Mega).
I wrote the Arduino firmware so that it would handle a variable numbers of LEDs, and so that it would accept a light pattern from the desktop controller, and return switch touches. This allowed the bulk of the game logic to reside in the desktop software. Since I wanted players to log in so that I could keep track of who was the fastest, it seemed better to use the desktop as the controller than to try to put the entire UI in the Arduino.
With the Arduino firmware debugged, I then wrote the desktop software and we tried to play a small version of the game (4 LEDs). The results were underwhelming. The game just seemed too easy. Perhaps it would have been sufficiently challenging had we implemented all 12 LEDs, but I decided to change course.
Cassidy came up with a different game, where only one LED is illuminated, and the illuminated LED moves linearly in a circular array of LEDs. The challenge is to predict when the LED will arrive at a particular button and press the button while the LED is lit. If you press the button before the LED is lit, when the LED arrives there, it just bounces off and goes in the other direction. This is easy when the LED is moving slowly, but very difficult when it is moving quickly.
Rather than building the entire game in hardware, as I had the first time, I first wrote a desktop program to simulate the new game. With that simulation in hand, we realized that if we had the light move faster and faster as each successful touch was made, the game would eventually become almost impossible to win.
I then revised the original 4 LED prototype board so that it would play the new game, and verified that it worked as anticipated.
Since colors are no longer important for this game, I intend to switch back to simple white LEDs, which will allow me to have 25 LEDs in this game. Next project is to design the new buttons and implement the new game board.