Animated Space Invaders Clock

by GeckoDiode in Circuits > Clocks

34105 Views, 582 Favorites, 0 Comments

Animated Space Invaders Clock

55dc03de2e7fb6a4bc000487.jpeg
Space Invaders Desktop Clock

Many of us have played the classic arcade game Space Invaders. Here's a way to implement it into your daily life!

This nifty clock is packed with groovy animations and sound effects. It's perfect for your desktop, and will make work/study much more interesting.

Gather Materials

55d9575d50e1b68ba70001e5.jpeg
55da5ce0937ddbfe35000f11.jpeg
55da5eb150e1b6982b000102.jpeg

Parts and Components

Note: You do not have to use Adafruit's Pro Trinket. Any Arduino-based 5V microcontroller should work as long as it has enough I/O pins and fits in the project enclosure.

Tools

  • Soldering Iron (with solder of course)
  • Helping Hands or PCB Vise
  • Needle-nose Pliers
  • Sand Paper
  • File
  • Hot Glue Gun
  • Loctite 5-minute Epoxy
  • Computer
  • Micro USB Cable

Designing the Enclosure

In addition to the inner electrical workings, you will need a nice looking enclosure. This consists of three major parts: the clock body, the clock back, and the clock face. The body and the back are both 3D printed ABS (if you do not have a 3D printer, I highly recommend 3D Hubs). You will need to order the laser cut face with Ponoko; just upload the attached svg file and checkout.

Note: When ordering the laser cut acrylic from Ponoko, it is important that you select "Acrylic - Gray Tint" as the material, "3.0 mm" as the thickness, and "P1" as the size.

Prepare Software and Code

Preferences.png
Boards.jpg
Boards Manager2.jpg
Full Boards.jpg

To begin with, make sure you have the latest version of the Arduino IDE.

You must then install the proper software to support Adafruit microcontrollers (assuming you are using the Pro Trinket). Open up Preferences and paste the following link into the box for Additional Boards Manager URL:

https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Go to Tools > Board > Board Manager and install "Adafruit AVR Boards" under Contributed. Now when you open Tools > Board, you should see a whole list of new Adafruit boards. Select the option for "Pro Trinket 5V/16MHz (USB)", then set Tools > Programmer to "USBtinyISP".

You will also need to install the following libraries through the library manager:

  • RTClib
  • Adafruit_LED-Backpack
  • Adafruit_GFX

For more information on working with Arduino libraries check out this tutorial.


After you have properly set up the IDE, download the attached Arduino file and upload it to your Pro Trinket.

Note: To upload code to the Trinket, it must be in bootloader mode (indicated by a pulsing red LED). To put the Trinket into bootloader mode, simply press the reset button.

Downloads

Preparing the Breakout Boards

IMG_2408.JPG
IMG_2387.JPG
55dbe31c15be4d2608000231.jpeg
IMG_2474.JPG
55dbe2312e7fb676fb000bb4.jpeg
IMG_2427.JPG
IMG_2449.JPG
IMG_2485.JPG
IMG_2507.JPG
IMG_2534.JPG

You will need your soldering supplies for the next three steps. While your iron heats up, start cutting off the number of header pins needed for each breakout, then solder them on. Using a breadboard helps a lot.

When soldering the LED matrices onto their backpacks, make sure the side with printed text is on the same side as the silk screen circle. On the back, short the I2C address pads as follows:

  • A0 (address 0x71)
  • A1 (address 0x72)
  • A0 and A1 (address 0x73)
  • None (address 0x70)

The Real Time Clock breakout requires some extra assembly. Start by melting a small lump of solder onto the battery holder pad (this will give the coin cell a nice and snug fit). Next, solder each component into their respective locations marked by the silk screen.

Don't forget to snip off any component leads.

Note: You may need to file down the sides of the backpacks so that the matrices sit flush next to each other.

Solder Up the Display

55dbea7f15be4d2b3f000f5a.jpeg
IMG_3643.JPG
IMG_3646.JPG
IMG_3649.JPG
IMG_3651.JPG
IMG_3652.JPG
IMG_3662.JPG

Lay the LED backpacks out from left to right so that the I2C addresses are in decreasing order. Solder up some hookup wire so that the Vcc pins of each backpack are all connected and a longer length of wire extends from the leftmost backpack. It is a bit tricky to get the the heat-shrink tubing on in the right order (see pictures above) so be very careful. Repeat for the GND, SCK, and SDA pins.

Solder Up the Main Board

55dbf34515be4d2b3f000f85.jpeg
IMG_3621.JPG
55dbfa5115be4d2b3f000f9f.jpeg

Now for the main circuit board.

First, solder the Pro Trinket and RTC onto the proto-board. Then solder hookup wire to connect all 5V and GND pins. Also connect the I2C lines (SCK and SDA). Next add the speaker to digital pin 9 and the pull-down resistor to digital pin 4.

Once again, snip off any long leads.

Note: In some of the photos the placement of the pull-down resistor is erroneous. It should be connected to pin 4.

Putting It All Together

IMG_3696.JPG
IMG_3702.JPG
IMG_3667.JPG
IMG_3707.JPG
IMG_3675.JPG
IMG_3679.JPG
IMG_3738(1).JPG
IMG_3721.JPG

Fit the DC jack through the hole on the clock back and secure with the included nut. Then solder the leads to the Vbat and GND pins of the Pro Trinket.

Use the glue gun to hot glue the LED matrices into the clock body (it will be a tight fit), and solder the four long wires to the 5V, GND, SCK, and SDA pins of the Pro Trinket.

Install the button and secure it with the included nut. Solder one wire to positive power and the other to digital pin 4 of the Pro Trinket.

Finally, gently fit the proto-board and speaker into the clock body, snapping the clock back into place.

You have finished all the soldering for this project so take a quick break and grab a snack :)

Final Touches

55dc01d92e7fb676fb000c2c.jpeg
IMG_3751(1).JPG
IMG_3753(1).JPG
IMG_3754.JPG
IMG_3759(1).JPG

The last thing to do is to attach the clock face using some Loctite 5-minute Epoxy.

It helps to roughen up the area you will be gluing, which can be accomplished with a file.

Following the directions on the bottle, apply a thin line of epoxy around the bevel of your clock. Carefully place the acrylic face on top, aligning the edges with that of the body. After the glue is set, you can lay the clock face down to dry.

Going Further...

Yoo hoo! You just built your very own Space Invaders desktop clock!

I hope you enjoyed this project, but don't stop there. I encourage you all to implement your own ideas and make this project even cooler!

In conclusion, I would like to give a special shout-out to the great Tomohiro Nishikado, designer and creator of the world's greatest arcade game.

EXTRA: I have added some modified files which should provide a better fit for the LED matrix backpacks. Keep in mind that they have not been physically tested yet, so their function is not assured.