Create your own dX: Overengineered Electronic Die

Make your own dX: Overengineered Electronic Die! Here is how I made the second version using a custom PCB but not using a piezo sensor. (The first version used an Adafruit Trinket. I have since made a third version adding a piezo sensor.)

I used the following things:

Programming

Before wiring dX, we'll have to program the ATtiny85 using an Arduino as an ISP. This is fairly complicated, but also fairly straightforward once you get past the 20 or so steps required. :)

  1. Download and install Adafruit Arduino 1.0.5. (You could also use the official Arduino IDE, but you would have to hack it to support ATtiny and install the Adafruit TinyWireM library yourself.)
  2. Download and unzip ATtiny microcontroller support for the Arduino IDE.
  3. Locate your Arduino sketchbook folder. Create a new folder called hardware inside the sketchbook folder, if it doesn't already exist.
  4. Copy the attiny folder (inside the attiny-master folder unzipped in step 2) into the hardware folder.
  5. Launch Adafruit Arduino 1.0.5.
  6. Open the ArduinoISP sketch from File → Examples → ArduinoISP.
  7. Connect your Arduino to your computer.
  8. Select your model of Arduino (or a compatible model) from Tools → Board → <model name>.
  9. Select the port corresponding to your Arduino from Tools → Serial Port → <port name>.
  10. Make sure the programmer is set to Tools → Programmer → AVRISP mkII.
  11. Upload the ArduinoISP sketch to your Arduino. (When I first tried this, I got a java.lang.NoSuchMethodError: gnu.io.CommPortIdentifier.open error. My solution was to use Arduino 1.5.5 instead, just for this step. This is not Adafruit's fault; the official Arduino 1.0.5 has the same issue.)
  12. Disconnect the Arduino. (We're going to be hooking things up to it.)
  13. Insert the ATtiny85 into the breadboard.
  14. Wire the Arduino to the ATtiny85. Connect Arduino 5V to ATtiny85 pin 8, Arduino GND to ATtiny85 pin 4, Arduino pin 10 to ATtiny85 pin 1, Arduino pin 11 to ATtiny85 pin 5, Arduino pin 12 to ATtiny85 pin 6, and Arduino pin 13 to ATtiny85 pin 7.
  15. Add a 10μF capacitor between Reset and Ground on the Arduino (not on the ATtiny85!). Make sure the side with the − stripe is the one connected to Ground.
  16. Download and open the dX_pcb sketch. (Now we're finally getting somewhere!)
  17. Connect your Arduino to your computer (again).
  18. Change the board setting to Tools → Board → ATtiny85 (internal 8 MHz clock).
  19. Change the programmer setting to Tools → Programmer → Arduino as ISP.
  20. Use Tools → Burn Bootloader to set the ATtiny85 to operate at 8 MHz.
  21. Upload the dX sketch. After a while, you should see the "Done uploading" message. If you see a message about avrdude: please define PAGEL and BS2 signals, you can safely ignore it. If you see any other errors, double-check your wiring and try again.
  22. Pull the ATtiny85 off the breadboard. You're done with programming; on to wiring!

Wiring

Now with the ATtiny85 programmed, we can assemble the custom PCB.

  1. Take the Adafruit Mini 8x8 LED Matrix w/I2C Backpack out of its packaging.
  2. Place the LED matrix over the silkscreen side of the Backpack (the side that does not have the controller chip on it). The Mini 8x8 LED Matrix is symmetric, so it can go in either way, but I like to align the printed text on the LED matrix with the "From Adafruit" text on the Backpack. Again, do not cover up the controller chip!
  3. Solder the 16 pins of the LED matrix and clip the leads.
  4. Insert the four-pin header that comes with the Backpack into the breadboard. Place the Backpack on top and solder it to the header.
  5. Take the dX custom PCB out of its packaging.
  6. Insert the diode into D1 on the PCB, making sure the stripe on the diode is aligned with the stripe on the board.
  7. Solder in the diode and clip the leads.
  8. Insert the 8-pin DIP socket into U1 on the PCB and solder it in.
  9. Insert the 3.3v voltage regulator into J2 on the PCB, making sure the pins match the labels on the PCB. Double-check the datasheet to make sure. (The reason there are four holes for a three-pin part is because there are two possible pinouts for a voltage regulator.) Solder it in and clip the leads.
  10. Insert a 10μF capacitor into C1 on the PCB, making sure the − stripe is aligned with the − sign on the board. Solder it in and clip the leads.
  11. Insert a 10μF capacitor into C2 on the PCB, making sure the − stripe is aligned with the − sign on the board. Solder it in and clip the leads.
  12. Find or cut off a female header with 4 pins.
  13. Insert the 4-pin female header into J3 on the PCB and solder it in.
  14. Find or cut off six female headers with 3 pins each.
  15. Remove the center pin from each 3-pin female header.
  16. Insert the 3-pin headers (with the center pin removed) into the switch contacts on the PCB, oriented vertically. Solder them in.
  17. Take one slide switch out of its packaging.
  18. Cut and strip a length of wire approximately 2 inches (5 cm) long. Solder one end to the pin marked + on J1 on the PCB. Solder the other end to an outer pin of the slide switch.
  19. Take the JST extension cable out of its packaging.
  20. Cut the JST extension cable approximately 2 inches (5 cm) from the socket end (where the battery plugs in). Separate and strip the wires.
  21. Solder the red wire of the JST extension cable to the center pin of the slide switch.
  22. Solder the black wire of the JST extension cable to the other pin on J1 on the PCB.
  23. Insert the ATtiny85 into the 8-pin DIP socket, making sure the notch faces upward.
  24. Insert the LED matrix into the 4-pin header with the Adafruit logo to the left.
  25. Take three very tall tactile button switches out of their packaging.
  26. Insert the button switches into the 3-pin headers.
  27. Connect the 3.7v 150mAh Li-Poly battery to the JST extension cable.
  28. Turn on the slide switch. The LED matrix should display the letters "dX" for about 10 seconds. Press the buttons to make sure they all respond. If everything checks out, you're done with wiring!

Assembly

  1. Turn off the slide switch and disconnect the battery.
  2. Take the dX enclosure out of its packaging. Locate the middle piece.
  3. Insert the slide switch.
  4. Feed the JST connector through the hole.
  5. Place the PCB on top with the button switches on the bottom.
  6. Install the faceplate.
  7. Connect the battery and install the backplate.
  8. Turn on the slide switch. Enjoy! Here is the instruction manual.