3DPCBoy – build your own handheld gaming platform

Description

The 3DPCBoy is a project I have been working on during my spare time for a couple of months. It originated as a test to see how a 3D printer can replace the need for a PCB and over tons of iterations, it has evolved to the 3DPCBoy – a cute handheld Arduboy compatible gaming device that cost around $10, is easy to build and fun to play with.

I think it is a great educational project since it involves several different areas:

  • 3D printing
  • Soldering
  • Electronics (microprocessor, display, switches)
  • Programming
  • Gaming

This project is standing on the shoulders of giants and I want to give credit to Arduino, Arduboy and its game development community. There are over 100 different games to download for free and you can modify them or even develop your own games.

rendering showing the 3DPCB with integrated diamond shaped wire channels.

3DPCBoy is using a rather unique approach – is not built around a glass fiber PCB like most electronics. Instead it uses a 3D Printed Circuit Board (3DPCB). This makes it easier to replicate, less expensive and you don’t need to wait for a PCB delivery. If you want to know more about 3DPCB, or use it in your own project, you can read about the development here .

The 3DPCBoy is not fully Arduboy compatible – to simplify the design I did some modifications:

  • Only PIN5 is connected to the beeper (the other side to GND)
  • I removed the RGB LED (might be added in the future)
  • CS pin of the OLED connected to GND (since the SPI is not shared)

Feel free to modify the design! With a CAD software, you can easily change the switches, layout, buzzer, add LEDs or build a snap on cover. I have included both .stl files for printing and .step files for tinkering (see documents section at the end of the post).

3DPCBoy has evolved over several iterations and is now easier to assemble.

Build it

This post describes the assembly process step by step and is suitable for most people. I have tried it on absolute beginners, kids and experienced developers. If you can identify the hot end of a soldering iron, you are good to go ;)

Equipment:

  • 3D printer (FFF/FDM with PLA filament)
  • Solder station and solder tin.
  • Basic tools: needle- and cutting pliers, knife, glue
  • Micro USB cable
  • Computer to run Arduino IDE and upload games to 3DPCBoy

Part list:

  • 1x 3D printed front 3DPCB (I used PLA)
  • 1x 3D printed battery holder (PLA)
  • 1x 0.96” monochrome 6-pin SPI OLED (not 4 pin I2C version, nor 7 pin spi)
  • 1x Arduino pro micro
  • 1x 1000mAh Li-ion battery (3.7V), or less capacity
  • 1x piezo electric disc (12mm in diameter)
  • 1x slide switch
  • 6x round push switches with low activation force.
  • 5x 20cm 0.3mm copper wires (strands from one RK-wire)
  • 1x Li-ion battery charger (USB-C)

The most expensive parts are OLED, Pro micro and battery – all can be bought and shipped from china for around $3 each. If you have trouble finding specific parts, let me know in the comments section – I can probably alter the design if needed.

Print the 3DPCB and battery holder

For the 3D printed parts, I sliced the stl model (see documents section further down) in Cura and printed on a BCN3D with a 0.4mm nozzle and the following settings:

  • 0.15mm layer thickness
  • 205deg C for the PLA
  • 100% infill
  • No support

When you have all the parts, you are ready to follow the assembly guide with some tips along the way.

­­Position, cut and bend switch wires.

Place the 6 switches in the 3DPCB.

Cut the switch pins about 3mm above the board.

Ensure the switches are in the bottom position and bend the cut wires to lock them in position.

Solder 6 signal wires to the switches and the CPU (Arduino pro micro)

Every switch has two connections, one is routed to the CPU and one is connected to ground and shared with the other switches and components. Let’s start with the ones that goes directly to the CPU.

Solder one end of a copper wire to the bent switch. This is done by placing the copper wire next to the switch wire and heating them briefly while adding solder tin. Yes, it would be easier if you had three hands, but you can either use “helping hands” to hold the copper wire in place, or if you are skilled, use your fingers to hold the wire and add solder at the same time. A tip is to first clean the soldering iron and add a tiny bit of tin directly to the tip to transfer the heat when soldering. Try to be quick and avoid heating up the components and 3D printed plastic. Use a ventilated area and avoid breathing the fumes from soldering or melted plastic (if any). Avoid excess amount of solder tin, no part should extend the flat surface.

Once the copper wire is soldered. Place the CPU board in its slot and thread the free end through the hole at the end of the guiding grove of the 3DPCB and then through the corresponding CPU hole.

Now tighten the wire while placing it in the grove.

Turn the board over and solder the wire to the CPU board while keeping the wire tight.

Cut the wire close to the PCB and reuse the loose section if it is long enough.

Repeat the process six times (solder, thread, solder, and cut)

Repeat for the remaining switches
All switches connected on one side

Add the ground wire

Now it is time to solder the ground wire connecting the other pin of the switches. Start by threading the wire through the battery hole and leave 3-4 cm wire on the other side. Then add the wire in the grove and solder the first two pins when the wire passes them.

Add the piezoelectric disc (speaker) and fold the copper wire until it forms a loop that passes over the copper side of the piezo electric disk. Then solder the wire to the disk (avoid contact with the white center of the disc). Since the disk has more surface area, you need to heat it up for a little bit longer, but try to avoid warming it too much since it will melt the plastic. Adding more tin to the soldering tip makes it easier to do a quick solder.

Solder the remaining switches and thread the ground wire through the hole to the CPU (not the OLED). This wire needs to connect both the CPU and the display, so fold the wire and thread it back through the hole. Now solder both wires to the CPU PCB and cut off the loop. Then thread the remaining wire to the display hole on top, again leave a few cm wire for later.

Solder a bit of copper wire to the center of the piezo electric speaker. Please note that the piezo electric crystal is quite fragile and should not be heated for a long period. Clean the soldering tip, add some extra tin, and solder the wire quickly to avoid damage. Then carefully thread the wire through its hole without adding stress to the solder joint. Flip the 3DPCB, solder and cut the speaker wire.

Verify that all keys work

This is a good time to upload a simple keytest program before soldering the display. Set up Arduino environment (Scroll down to Arduino IDE installation instructions) and create a new program with the following test code:

void setup() {
pinMode(17, OUTPUT);
pinMode(A0, INPUT_PULLUP);
pinMode(A1, INPUT_PULLUP);
pinMode(A2, INPUT_PULLUP);
pinMode(A3, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
}

void loop() {
digitalWrite(17, HIGH);
if (digitalRead(A0) == LOW || digitalRead(A1) == LOW || digitalRead(A2) == LOW || digitalRead(A3) == LOW || digitalRead(7) == LOW || digitalRead(8) == LOW) {
digitalWrite(17, LOW);
tone(5, 262, 20);
}
delay(20);
}

The program above will play a beep for every key you press. If a key does not make a beep you probably have a bad solder connection.

Add the slide switch and fold the pins while holding the switch in bottom position. Solder a wire to the top pin and thread it to the battery hole.

Connect the display

Now it is time for the connection of the display. Since the OLED display covers the CPU board, all wires will be soldered only to the CPU and thread through the display holes. Leave a few cm for the display. The first wire in the picture above needs to cross another wire and is therefore threaded on the other side.

Tighten the threaded display wire, leave a few centimeters and repeat for the remaining display signals.

I almost forgot, solder a copper wire to the middle pin of the slide switch, thread through the hole to the CPU, solder, and cut from the other side.

don’t forget the second wire to the slide switch…

Before adding the display, double check that nothing is missing:

  • Check that all switches are connected
  • Check that all wires are inside their groves
  • Check that all wires are soldered to the CPU board an cut close to the solder (4,5,6,7,8,raw,gnd,vcc, a3, a2, a1,a0, 15,16 should be soldered.)
  • Check that no solder joint is protruding the flat back surface (might risk short-circuit against the battery)

Thread the wires to the display (without any crossings)

Place the display in position

Tighten, solder and cut the display wires

Add the rechargeable battery

Now it is time to connect the battery. Place the battery in the 3D printed case and remove the insulation of the red and black wire according to this picture, ***WITHOUT LETTING THE WIRES COME IN CONTACT WITH  EACH OTHER***. If the wires come in contact, they will weld together, short-circuit the battery, burn the fuse, catch fire or explode (maybe all at once ;)

It is now time to connect the battery to the front. Thread the wires through the same holes used to power the front, again ensure that the power wires don’t touch each other.

Fold the top over the battery backside; twin the battery and copper wires together. This ensures contact, and allows disassembly without soldering. Trim the wires  

Fold the twisted power wires into the neighboring empty holes.

These holes are also used for charging the battery and are compatible with a USB-C charging module.

Remove three pins from a pin header and solder them to the charging board (out+, B+, B-)

The charging module is attached to the 3DPCBoy by placing it in the battery holes in the top right corner. The spare upper hole is used to prevent switching polarity when an extra pin header pin is inserted next to the positive side on the charging board.

Installing Arduino and loading games.

Now it is time to install your preferred game on the 3DPCBoy.

  1. Download & install the Arduino IDE.
  2. Download the source code for the preferred game; unpack the folders to your Arduino sketch folder (Ctrl-K in Arduino IDE).
  3. Load the game in Arduino IDE
  • Use the Library manager (Ctrl+Shift+I or Sketch>Include Library> Manage Libraries.) to add Arduboy, Arduboy2 library.
  • Compile the game (Ctrl+R) with the tick box icon in the top left corner. Ensure that all requested libraries are installed (if not, use the Library manager)
  • Connect the 3DPCBoy to the PC with a micro USB cable. Select Arduino/Genuino Micro board from Tools->Board and select the corresponding com port from Tools>Port (the one that says COMx Arduino/Genuino Micro).
  • Upload the compiled code to the 3DPCBoy (Ctrl+U) with the RightArrow icon next to the tick box in the upper left corner.
  • Done!

Program the 3DPCBoy and test that everything is working (power switch, all six keys, speaker and display).

There are two guide holes where pin header pins can be inserted to align front and back before gluing them together with two drops of cyanoacrylate.

Documents


Appendix:

OLED Display:

Display Pin         Pro Micro Pin
GND                    GND
VCC                     VCC
SCL                      15
SDA                     16
RST                      6
D/C                     4

Buttons – Tie one pin of each button to GND and the other pin to:

Button  Pro Micro Pin
A                         7
B                         8
UP                       A0
RIGHT                 A1
LEFT                    A2
DOWN                A3

Piezo speaker: (Arduboy uses pin5 and pin13 for dual tone, pin 13 is not available on the Pro Micro, so it is simply skipped)

Speaker Wire     Pro Micro Pin
1                          5
2                          GND

Arduboy also have an RGB LED that is not included in 3DPCBoy

RGB LED – Tie the anode to VCC. The cathode of each LED should go to an appropriate dropping resistor and the other side of the resistor should go to:

Resistor for Color:          Pro Micro Pin
Blue                    9
Red                     10
Green                  3 (with custom library)   (11 in Arduboy)

Update – New version with standard components

The right version uses components that are easier to acquire.

I have created a new version with the following improvements:

  • More accessible 6×6 TACT switches (select low actuation force)
  • A buzzer with pins (9mm diameter – easier to acquire and to solder)
  • 2 channel audio for better gaming experience.
  • Added SPI CS to support 7pin OLED (still works with 6 pin)
  • Protective frame around OLED and 4 support pins (no need for hot glue)

To enable dual channel audio I recommend to use MrBlinky’s excellent arduino IDE package. Select ProMicro 5V (alternate wiring).

The 4 pin TACT switches made routing a bit more challenging. I rotated them 45deg to keep them close to each other (thumb size).

Licensing

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

22 Replies to “3DPCBoy – build your own handheld gaming platform”

  1. Excellent project and it now has me thinking of other projects I have planned using the 3DPCB approach.

    Are you able to point me to the push switches you have used in this design.

    1. Hi. I’m glad you liked it.
      The switches was bought directly in huaqiangbei during a trip. I selected them for the symmetric design, low actuation force (50g), thru hole and silent operation. I have not tried this switch from panasonic, but it should fit according to the datasheet. https://media.digikey.com/pdf/Data%20Sheets/Panasonic%20Electronic%20Components/EVQ-11_Series_DS.pdf

      I am actually working on a version using components that are more common; standard 6x6mm 4 pin switches & 2 channel audio with a 9mm piezo buzzer. Let me know if you are interested!
      /johan

      1. Definitely interested in a version with the more commonly available components!

          1. Just downloaded the design, can’t wait to build it. Will let you know how it goes.

          2. Printed it but it turns out, the piezo speakers I have are a bit bigger. They didn’t have them here in the local electronics parts store to my surprise, so I ordered them in China…..
            :-(

          3. Outch. It should be rather easy to make it a bit bigger by changing the 3d model or dremel a bigger hole. But it only works if the piezo is slightly bigger…

          4. Hmmm, seems I have misplaced my switches, can’t find them anywhere :-(
            Also, the oled I have has the 4 holes maybe 0.5mm closer horizontally, so it doesn’t fit, height wise it is perfect.
            So that’s a few more setbacks…
            I found some other tactile switches that would be perfect for a project like this, they are either 4 or 2 pin. Here’s a link to them, maybe a nice option if you ever change the model.
            What program did you use to design it, and would you be willing to share the files, that allow me to change it (I could import the stl, but that doesn’t make working on it very easy)
            https://nl.aliexpress.com/item/32668706990.html?spm=a2g0s.9042311.0.0.27424c4dykNUIC

          5. Hi Patrick
            I have also noticed that various OLEDs have slightly different spacing for the positioning holes. For minor adjustments (up to 1mm) you can cut the pins slightly, but it the holes are far away it is better to adjust the model.
            Since the OLED is not identical – double check the pinout to ensure it is matching the wires: GND, VCC, SCL, SDA, RST, D/C (using SPI – SDA and SCL is not the correct names, but used for some reason on the oled)
            I used Rhino3D to model the 3DPCBoy (nurbs). I have included step files which you can use to alter the models without having to deal with the polygon mesh of the stl file. The step files can be read by most solid and surface modelers.

            The switches you propose is quite a bit bigger than the ones im using (8×8 vs 6x6mm). Im sure they can be used, but it will require quite a bit of alteration to the model (and likely a slightly larger outer dimension). It doesn’t mention activation force, i recommend using switches with less than 100g /1N (50g if possible).

            /j

  2. Hi, your work is quite impressive! Congratulations!

    I’m a PostDoc at the University of Florida. Some of my work intersects with what you have explored in this project. (Some images: https://drive.google.com/drive/folders/1-aJy884bMmigvS0HYTbhoU6dcn-4NlrE?usp=sharing)

    I am beginning to work on a scientific article regarding this approach, and I would love to explore opportunities for you and your work to be part of it.

    Once again, great work.

    Appreciated + looking forward,
    Alexandre Siqueira, Ph.D.

    1. Hi Alexandre
      Great to see that the 3DPCB idea is spreading.
      The article sounds interesting – Let me know if there is anything I can do to help!

  3. Hi Johan,
    There are several possible levels of engagement. I would love to talk to you more about it.
    Is it possible for you to send me an email? I can’t really locate yours.

    Appreciated,

  4. Hello, amazing work, I love 3DPCP concept! :-)
    I’m wondering about the power to the Micro, are you using the 3.3v version, correct?

    1. Hi
      I’m using the 5V version. In theory 3.3V should work (OLED is specified for 3-5V), but unless I’m mistaken the 3.3V version is using a slower crystal. This will likely have an affect on the performance. Running 5V at high speed from a battery is actually outside specification, but seems to be working well (same as Arduboy)

  5. Hi Johan, beautiful design, and very interesting regarding the 3DPCB. This is my first time encountering it and it makes so much sense for hobbyists and prototypers. Will you be providing the STL of the 3DPCB for this project? It would be great to try it out and see a “working model”. Thank you.

      1. Hi Johan, I finished it but was confused by your routing of the 2 wires of the piezo in your new design. At first I just followed your routing which connects the 2 wires to pins 5 & 6. The button test didn’t work though and I realized that if pin 5 is getting the signal pin 6 must be tied to gnd. I added a jumper to connect pin 6 and the 2nd piezo wire to gnd, edited your test program and the button test worked (yay!). After finishing connecting the display and uploading an Arduboy game I was not getting anything on the display. On review of your pin info I realized that pin 6 is the screen reset so being tied to gnd was not what I wanted. I cut the jumper to gnd (but pin 6 was still connected to the piezo) and when I turned it on I saw “Arduboy” on the screen but only once. Now no header and no game. I tried disconnecting pin 6 from the piezo but no help. Any suggestions?

        1. ok, so I was a little confused about the pins (long day, lol). Anyway, pin 6 is not connected to anything right now but, following your routing, pin 4 is going to reset instead of DC. Is the problem that Arduboy expects pin 4 to go to DC and 6 to go to reset? I could do that by jumpering them, your thoughts?

          1. Update: I realized that DC was good (connected to pin 4) but reset was going to pin 2 instead of 6. I connected pin 6 to pin 2 and now it works!

Leave a Reply

%d bloggers like this: