Circuit Connections

To build a little Adafriend cube, we will follow this (rather complicated but color coded) circuit diagram:

The circuit for the Adafriend runs on a Pro Trinket 5v with a lipo backpack that allows the user to charge the internal battery and switch it off with a slide switch. The vibration sensor is connected to analog pin A0, and the buzzer to D10, and the IR receiver and LED are wired to their digital pins too, D11 and D3 respectively, as well as power and ground. Finally, the LED matrix is wired to power and ground and the I2C lines, SCL and SDA.

Assembly Instructions

3D Printing

The first order of business in building an Aafriend is to 3D print its sturdy shell. I highly recommend a 3D printing service for this, or a resin printer if you have one, as the tolerances for such a complex little guy are quite tight and the model requires a few overhangs. I used Sculpteo, but Shapeways or any other service would be just fine too. To 3D print the models yourself, download the stl files here, and print with your highest quality settings with the best support material option for the job. Really these models are designed for only the highest quality printers, and a service is ideal.

Tap Screw Holes

Once your models are printed, clean them up, and then tap all screw holes by carefully aligning and screwing in a 5mm M2 screw into each hole, backing up a bit with every twist tighter. Make sure to tap all 11 holes!

If you order your models online, make sure to clean out the holes of any excess material first. Tweezers or light taps work nicely.


With your 3D prints ready, we can move on with the build!

Preparing Components

Pro Trinket

First, secure your Pro Trinket in a vice or on a safe work surface. Then, fill pins D10, D11, A0, A4, A5, GND, and D3 with solder as the photo shows. Your Pro Trinket is now ready for wiring, set it aside.

LIPO Backpack

Next we will prepare the LIPO Backpack module.  First, using flush cutters, cut the soldered pins of the JST connector, behind and in front. The plug takes up too much space inside the cube. With the connector removed, reflow the solder joints and remove the remains of the pins. Add more solder if necessary to clean up the pads. Then cut the small jumper trace between the two power switch holes pointed out with tweezers. Flip the board over and solder the jumper on the back to allow the cube to charge at the full 500ma speed. Next, fill the power switch holes with solder to prepare them for wires.

Gather 2 lengths of pin headers that come with the various parts of this project, one single pin, and a set of 2. Make sure they are short ones, not long ones. Fit the set of 2 into the 5v and G holes, align them, and solder. Then using pliers, remove the black plastic spacer from the single pin as it gets in the way of the screw we'll fit into the Pro Trinket. With the spacer removed, align it in the "Bat" hole of the module and solder as before. The LIPO backpack is prepped, set it aside.

LED Matrix

For the LED matrix, secure the backpack and identify the side of the pcb with a white dot. Bottom left shown here. Then find the side of the white LED matrix module with the printed text on it as shown. Insert the matrix into the pcb with the printed text on the same side as the white dot, and solder on the other side of the pcb. Then fill the 4 interface holes with solder.

Strip and tin 4 approximately 3" lengths of thin wire, and heat the 4 interface holes on the matrix to insert the wires in the back of the matrix. Then add solder to the other side of the pcb for a strong connection. Cut any protrusions with flush cutters and reheat so the joints are as flat as possible. The matrix is prepared, set it aside.

Vibration Sensor

To prepare the vibration sensor, secure it in a vice and cut the leads to a short length as shown. Then tin the leads and cut and tin two ~1" lengths of wire and solder them to each lead. Shroud each connection in a short length of heat shrink tubing and shrink it with heat. Then cover both connections in another length of tubing and shrink that to prevent bending and breakgages. Set aside the prepped sensor.

Slide Switch

Secure the slide switch, and cut off one of the pins. Then tin the others, and solder two ~1.5" wires to the pins, and protect them with heat shrink tubing. The switch is prepped, set it aside.

IR Led

Secure the LED in a vice and trim and tin the connections, keeping track of + and - by leaving the longer lead longer. Then cut and trim two 1" legths of wire and solder them to the led. Secure the connections with heat shrink tubing. Set aside the prepped LED.

IR Receiver

Secure the receiver in a vice, and bend the leads to a 90 degree angle towards the back of the sensor. Trim the leads short as shown and tin them. Then solder one 1", one .5", and one 2" wire to the leads as shown. Then heat shrink the connections and set aside the prepped sensor.

Final Assembly

With the individual parts prepared and wired, the cube can start to come together!

IR Receiver Power Switch Installation

First, insert the IR receiver sensor into its slot in the wall of the bottom half of the cube. Hot glue it in place. then do the same with the power switch in its place at the bottom of the cube as shown.

Pro Trinket, LIPOLY Backpack, and Power Switch Wiring

Screw the trinket to the case with 3x 4mm M2 machine screws. Then place the LIPOLY backpack in its designated holes as per the circuit diagram and photos and solder it in place. Then using tweezers, solder the two power switch wires to the two holes in the backpack.

IR Receiver Wiring

Solder the right (from the back) lead of the IR receiver to D11, the center lead to GND right next to it, and the left lead to Bat on the LIPOLY backpack. Check your work to see if it matches the last image.

Vibration Sensor Installation and Wiring

Using pliers, insert the vibration sensor into its anchor, and solder one wire to A0, and one to ground, it doesn't matter which.

IR LED Installation and Wiring

Push the 5mm LED holder into the IR LED hole next to the IR receiver, then insert the ir LED from inside, pushing it outwards. Solder the - leg, or shorter one, to GND, and the longer + leg to D3.

Piezo Buzzer Installation and Wiring

Solder the piezo buzzer's red wire to D10 and the black wire to GND. Twist the wires together and tuck the black head of the buzzer under the Pro Trinket to keep it out of the way. Check your work to see if it matches the last image.

LED Matrix Installation and Wiring

Fit the LED matrix into the top half of the case, and screw it in place with 4x 4mm M2 machine screws. Bring both halves together as shown to solder them together. Solder the matrix's VCC wire to Bat on the LIPOLY backpack. Solder the matrix's GND wire to Gnd on the Pro Trinket. Solder the matrix's SDA pin to A4 on the Pro Trinket, and the matrix's SCL pin to A5 on the Pro Trinket. Check your work with the last image.

Carefully fit the case together with the matrix wires on the side of the IR components. If the case doesn't fit relatively smoothly, cut away excess hot glue from the IR receiver sensor to fit the case together. Then separate the halves again.

Cut off the JST connector from the LiPo battery and strip and tin the wires. Solder the red wire to the + connection of the LIPOLY backpack, and the black wire to the - connection. Then your cube is all wired up! Align the halves as shown with the battery parallel to the matrix, then close up the cube and screw it together with 4x 5mm M2 machine screws Your Adafriend is complete!

With your Adafriend assembled, we can move on to giving it life! (Code is life)

This guide was first published on Jun 28, 2016. It was last updated on Mar 08, 2024.

This page (Wiring and Assembly) was last updated on Jun 16, 2016.

Text editor powered by tinymce.