This is a toy I made for my son's 3rd birthday. It is a "Space Shuttle Command Center," essentially a glorified light switch box :)
Inspiration came from a 99-volt light-and-switch box my step-brother's dad made way back in the day, and also from this incredible Mission Control Desk project.
The box is divided into 2 parts: one controlled by an Arduino powered by a USB phone charger, and the other side is a simple parallel circuit powered by a 9V battery. The 9V side is 6 switches with LEDs (on the bottom right) then the Arduino side is an LED bar graph controlled with a potentiometer, a countdown timer started with a momentary switch (big red button), the engine light (an LED behind the transparent image of the shuttle taking off), and the audio chip from a greeting card that plays at T-minus Zero.
To build this project you will need:
- 1/4" plywood (probably a 4x4 foot sheet)
- 1/2" plywood (probably a 4x4 foot sheet)
- a few scraps of wood
- wood glue
- Four 2-inch mending plates (for the countdown timer border)
- 1" wide strip of aluminum (for the border around the photo)
- adhesive transparent inkjet printer paper such as this
- 08" acrylic sheet (plexiglass) cut to 4x6"
- Red, white and metallic spray paint
- Water-based urethane coating
- spring loaded clasps
- Lots of resistors
- 22-gauge wire
- soldering iron and solder (radioshack)
- 10k ohm potentiometer
- Arduino UNO
- Arduino Screw shield
- Big red arcade button
- Sparkfun LED bargraph breakout board
- Common cathode 4-digit 7-segment display- I used the SH5461AS
- simple perf board to mount the 7-seg display (Radioshack)
- Adafruit perma-proto breadboards
- 3 toggle switches
- 1 DPST switch
- 3 different color pusher LED switches like this one
- Switch cover like this one
- LED holders like these
- Recordable greeting card module, I used this one
Here's how I built it:
Step 1: Build the Box
The box is made of plywood. The sides are 1/2 inch ply and the top, bottom and main surface panels are 1/4 inch ply. I used a router to "rabbet" the end pieces to make a more sturdy box. In retrospect, I would more precisely lay out the holes on the surface panel (where all the switches are mounted) instead of essentially eyeballing it. The box is 12" x 12", about 3-1/4" deep, and the top is about 1-1/4" deep.
The edges are glued with wood glue, and the top and surface panel are screwed down. The bottom is attached with a piano hinge on one side, and machine screws that insert into T-nuts on the other side, so that I can access the circuitry and replace/charge the batteries when needed. The t-nuts are pounded into a small 2x1" scraps of wood that I glued into 2 corners of the box. There might be better ways to close the bottom but this works.
On the surface panel I cut out holes for 3 toggle switches, with 3 LEDs in holders above, then above those, 3 LED pusher switches. I also cut a hole for the potentiometer, and a long vertical hole for the LED bar graph, a hole for the momentary switch, hole for the 4-digit 7-segment display, and finally a 4x6 hole for the image of the space shuttle taking off. I also put an extra hole in the surface panel (originally the timer was going to be set by a second pot) but I covered that up with a triangular piece of wood with a space shuttle decal on it. These were all achieved with drill bits, a jigsaw and/or a Dremel tool.
I spray painted the box top, bottom and surface panel with a metallic spray paint, and the main part of the box with a bright red paint. I finished it with a couple of spring loaded clasps and a little handle. I also put a strip of weather stripping along the front edge to prevent little fingers getting smashed.
The shuttle decal on the top of the box was purchased from Amazon. I printed the labels for each switch on the adhesive transparent sheets and cut them out. The labels I used were taken from pre-launch transcripts found here. The other decals were all found in the public domain online and printed on the adhesive transparencies. I had to put the decals I made onto a white background though, since the "white part" of the image is just clear, so it would be whatever color is underneath.
I covered the box with a few coats of water-based spar urethane, so my son would not peel up the stickers right away! The water-based is good since it can go over painted surfaces and will not yellow, according to the paint store
Step 2: Build the Circuits
9 Volt Side
The LEDs with switches were pretty straightforward. However I wanted a "Master Arm" switch that would engage the 9V battery side as well as the Arduino power source at the same time. I got a dual-pole single-throw toggle switch and covered it with one of those red flip-up switches to protect it from accidental activation. (Also, the box won't close if the switch is flipped up, so you can't forget to turn it off.)
So, the 9V battery has a positive wire going to the switch, which then continues to a green LED to indicate power is on. The 3 toggle switches that control the red LEDs, and the 3 pusher switches are just wired up in parallel, through one of the Adafruit perf boards. I actually soldered the positive lead on the red LEDs to the switches, just because they wound up being so close together. The red LEDs have 200 ohm resistors, and the pushers have their own internal resistors, so no need to add more resistance to them.
The power for the Arduino comes from an iPanda portable phone charger. I tried to power the Arduino with a 9V battery but it did not seem to provide enough juice. I read online somewhere that you can use the phone chargers so I tried it out. (Basically plug the USB cord from the Arduino that would normally go into your computer, into the charger.) I did have to sacrifice a USB extension cord. I cut the extension cord, ran the red wire through the Master switch, reconnected the black ground wires, and snipped off the white and green data wires. Works like a charm! I am not positive how long this battery will last, but it is supposed to provide 2300 mA hours, so should be a decent amount of time.
The potentiometer (via the Arduino) controls the LED bar graph breakout board. This board, from Sparkfun, has 3 10-LED bar graphs that are soldered onto a board, red, yellow and green.
The pushbutton is wired into the Arduino to control the countdown timer, and the 7-segment display countdown timer is soldered to a perf board. All of the wires from the 7-seg display go to one of the solderable boards from Adafruit. The segment pins all have a 100 ohm resistor, and the 4 digit pins are just plugged directly into the Arduino. It is a common cathode display, so when the voltage is low to the digit pins, that turns the digits on.
There is also an LED that is connected to an analog pin on the Arduino. This LED goes behind the transparency photo of the shuttle launch, which is laid onto the plexiglass sheet. It turned out to be too transparent, so I placed a sheet of white paper behind the plexi. When the timer hits 0, the LED activates and it kind of looks like the shuttle engine is blasting off.
Finally, I used an audio chip from a recordable greeting card to play a sound when the timer reaches 0. I thought it would only be able to play one sound file, but it turns out that for some reason, if I put multiple files on the chip, the arduino will play a different one each time! So I placed 4 mp3 files on there, downloaded from NASA's website. They are all various sound bytes from the Discovery launches. The chip came with a button that is supposed to activate the audio. I clipped off the button and put the positive wire into the Arduino, and the other wire into gnd. When the timer hits 0, the Arduino sends a little pulse into the positive wire, simulating a button press and activating the audio.
Step 3: The Code!
OK, box is built, circuits are soldered, time for the code.
A word of warning!
I am a first-time coder and this code is a hot mess. I tried to go back in and delete parts that were irrelevant but I am sure there are still wasteful things in there. I also cut a bunch of corners on things I did not understand, so they are done in a clunky way. Nevertheless, the code works!
A note on what it does:
- Potentiometer controls the LED bargraph, making it go up and down. If you turn up the "power" too high, the 7-seg display flashes the word "bugs" and the LEDs go crazy (The Sparkfun "bugs" feature). This lasts for 30 seconds. If the power is turned down it will go back to normal operation. If power is left too high the bugs will repeat.
- Button starts countdown timer. If pressed while running it will reset to 15 seconds. After timer hits 0 a button press will reset it.
- When timer hits 0, an LED lights up behind the "screen" and an audio clip plays.
Code is attached in this text file: