Game Boy Zero Guide Part 2

Welcome back!  If you’ve been following along then hopefully at this point you have a modified case with X/Y button holes ready to go, because we’ll be using those this week.  For this part of the guide you’ll be cutting up and tapping into the original controller board from your (hopefully alread-broken) Game Boy, wiring it up to a Teensy LC board, and programming that to act as a keyboard.

A question about this project I get a lot is “Why did you use a Teensy in stead of just using the GPIO pins on the Pi?”  It’s true, you can use the GPIO pins and a driver like mk_arcade_joystick and skip the Teensy.  There are a few good reasons to do it the way I did, though:

  • We’ll be using a couple of the GPIO pins that mk_arcade_joystick normally uses for PWM audio later on, and it’s kind of a pain to change the pins that mk_arcade_joystick uses (you have to compile it yourself if you do rather than using a pre-built one).
  • The Teensy makes it much easier to change how your controller works.  You can reprogram it to act like a joypad, keyboard, or even a mouse easily.
  • If you ever need/want to reinstall a fresh copy of the latest RetroPie or try a different OS, there is no configuration you need to do to get the controller working; the OS just sees it as (in our case) a keyboard!

So, in my eyes, if you have room for it (which we do) then the Teensy is super handy.

Anyway, let’s get started.  Here are the tools I used this week:

Part 2 Tools

First we’ll need to remove some things from the board.  All we really care about is tapping into some traces around the buttons, so you don’t need to be too terribly careful while removing stuff.

Remove the screen and the chip just below the screen from the front:

Screenshot 2016-04-24 10.42.33

Removing chips like that can be kind of a pain.  What I do is put a big glob of solder across all the pins on either side, which lets you heat up an entire side at one time and lift it up.

On the back, remove everything except for the staple-looking bits (they are bridging some traces on the other side that we’ll be using).  Make it look about like this:

Controller board back

Now cut the board using a Dremel so it is right at 5.5cm tall (which should fall right at the top of the screen connector).  It should go without saying, but the dust generated by cutting this is not something you want to be breathing in or getting into your eyes, so do it outside and use protection!

Cut controller board

 

We need to remove the excess solder from the area where the X/Y buttons will go.  The easiest way to do this is with a desoldering braid (you can get one for a couple bucks on amazon).  Just rub it around on the parts with excess solder using the tip of your soldering iron and it will wick it away:

Desoldering braid

When you’re done that area where the X/Y buttons will go should be nice and flat:

Desoldered button area

Now we’re going to tap into the traces on the board so we can wire it up to our Teensy.  Below is a high-res image of the board with the traces labeled (click to enlarge).  There are also a few traces we need to bridge to create a shared ground (white with red circles around them below), which will make it easier to wire up to the Teensy.

Traces

Gently scratch off the top layer of small areas of each of the traces labeled above using something like a small flathead screwdriver, exposing the copper underneath.  Don’t scrape too much or too hard, or you’ll wind up going right through the cooper part.  It doesn’t matter too much where along those traces you scrape, just make sure you don’t do it in a spot that a rubber button base will be laying.  Also try to space them out enough that you won’t accidentally bridge them when you go to solder it.  Here’s how mine looked:

Exposed Traces

Fair warning: it can be a pain in the butt to solder onto these things.  Applying a bit of soldering flux can help a little.  For the bridged ground connections, you don’t necessarily need any wire, you can just put a big enough glob of solder on it to make the connection.  It’s not pretty, but it works:

Bridged Ground Traces

When you go to actually solder wires onto the board, it helps a lot if you get really thin and flexible wire.  It’s also handy if you can get a different color wire for each button, so you can write down which one represents which button.

Soldered traces

These connections are pretty delicate, so first check and make sure they are solid (you can use a multimeter to measure resistance across one end of each wire to the corresponding black button pad and make sure it’s a good clean connection).  There is a great thread in the forums with links to guides/videos about using multimeters if you’ve never done that before.  After you’ve checked that, apply some hot glue so you don’t accidentally break any of the connections.

Glued connections

Now we need to add contact points for our X/Y buttons (watching the accompanying video will really help with this part).  First cover that area in electrical tape so none of the metal bits interfere with what we are about to add.  Make it as flat as possible, and make it wrap over the top onto the other side.  Then mark where your buttons are by putting your board in the front half of the case, and marking the board with a sharpie.  This is what you should end up with:

Marked X/Y Locations

Now we are going to apply 4 strips of copper tape.  The inner two strips will overlap on the other side and will be a shared ground connection.  The outer strips should run parallel to the inner two, close enough that when our buttons are pressed they will bridge the outer strip with the corresponding inner one (again, watch the video, it’s much easier to just see it done!):

Front:

Copper tape front

Back:

Copper tape back

At this point I put the board back in the front half of my case, along with the buttons, and tested with my multimeter to make sure the buttons actually bridged the connections.

Now on the back side, solder some more wires to the center, inner and outer copper tape strips.  Also solder  a small bit of wire from the middle strips to a nearby trace bridge (the staple looking bits).  It should look something like this:

Controller finished back

And a finished shot of the front (I actually forgot to do the Start/Select buttons until after I did all of the above, so that’s why this is the only shot that shows them finished.  Oops!):

Controller Board Front Finished

Alright, now it’s time to wire this thing up to your Teensy!

I’m using the ground pin, along with digital inputs 0-11.  The order is Up, Down, Left, Right, A, B, X, Y, Start, Select, L, R (we’ll be wiring up L/R in another guide after we mount them in the case).

Wired up Teensy

Once all the buttons are wired up, put the board into the case along with all the buttons and rubber bases — it’s time to program it and test it out!

IMG_2530

First install the Arduino IDE, and then install the Teensy software.  The latest version of the Teensy software (which is 1.28 at the time of writing) is not compatible with Arduino 1.6.9.  You can either download Arduino 1.6.8 to use with it, or download the beta of version 1.29 of the Teensy software.

Make sure to run the Arduino IDE once and then exit it before installing the Teensy software.  After that’s installed, download the Arduino project I wrote, which will turn the button presses into keyboard events.

Open up the .ino file.  In the Tools menu in the Arduino IDE select Board, and select Teensy LC.  In the Tools menu again, select USB type, and select “Keyboard + Mouse + Joystick”.  Now click the checkmark in the top left to verify/compile the sketch.  If it doesn’t complain about anything, hit the right-pointing arrow right next to it.  This should open up the Teensy Loader app, and it might prompt you to click the tiny button on the Teensy itself.  Do that if it prompts you, and it should upload the code, and you should be good to go!

Now you can plug it into any computer (or in my case a Game Boy Zero!) and try it out!  It should be sending keypresses for w,s,a,d and a few other keys as you push buttons.

Finished GBZ Controller

If you run into any problems or get stuck, jump in the forums and ask for help!  Lots of nice people are already showing up there sharing advice, tips and tricks, etc.

Next time I’ll go over mounting the screen and the Pi Zero, as well as the bracket that we’ll make to reuse the original screw posts.

Don’t forget to register for the one I’m building in these guides!

Free contest software by Rewards Fuel
wermy Written by:

36 Comments

  1. CandyManCriminal
    April 25, 2016

    this looks hard

  2. Uke
    April 25, 2016

    Thank you Wurmy!
    It’s awesome you are doing this for the rest of us. Will keep following along and hopefully build mine when I can get a hold of all the parts!

    Also, if kitsch-bent succeds in making his own boards with the extra buttons, will this part of the guide be edited? I know there are more than a couple of us hoping he can figure those out.

    Thank you again!

  3. Felicia
    April 25, 2016

    Thanks for the speedy part 2! We appreciate your dedication to help the rest of us plebs who have no idea how to get this whole project done without you!

  4. chiz
    April 25, 2016

    Excellent part 2 video once again, Wermy! I liked the fact that you didn’t skimp on the explanations for the newbies, e.g., how a solder wick is used, etc., Most tutorials will leave those details out.

    Oh and excellent choice of soundtrack! Very motivating to just pick up that solder iron and go hacking! 😀

    Thanks again for putting this up!

  5. zeke2040
    April 25, 2016

    Nice! Excited to start on part 2!

  6. kean.tran.86
    April 25, 2016

    Fantastic guide! Time to get cracking even though it’s super late! Teensy board has not arrived will be doing prep-work in the mean time. One small suggestion, when cutting the PCB try not to avoid the dust as some PCB boards do have fiberglass and such, not something you want to be breathing in. Alternatively you can use an exacto-knife, make 1 gash line then go over it a few times and you can literally break it off.

  7. kean.tran.86
    April 25, 2016

    *Try to avoid the dust (don’t know how to edit on here)

  8. Fleder
    April 25, 2016

    As good as always. Thanks for doing this! Can’t wait for the RPi0 to be in stock again, finally.

  9. v2px
    April 25, 2016

    Very nice. I really hope I get my hands on a Pi0 soon :3

  10. DeltaShadow
    April 25, 2016

    Can someone explain to me how the new buttons that we are adding works please? I know I could just build it but I want to understand how it works as well. Thanks!

  11. James
    April 25, 2016

    Thanks a lot for doing step-by-step guide for us, Wermy! I’ve never soldered anything in my life and this project will be a great way for me to get into the hobby of electronics. I know I’m not the only n00b watching you and your guides are a TON of help for us! Keep up the great work broski.

  12. Kyle Bean
    April 26, 2016

    Just ordered a DMG-01 and a Pi0! Never done anything like this before. Wish me luck! Thanks so much for the detailed instructions and help. Couldn’t dream of doing this without you Wermy!

    • Guido Santos Pereira
      April 26, 2016

      Its not that Hard. And his Instruction truly are on point for those who are new to Electronics.

  13. Joel T
    April 27, 2016

    This is so cool. Thanks for making the guide. This seems beyond me, but I’m gonna give it a shot anyway. Cheers!

  14. Mike Spadafora
    April 28, 2016

    Waiting for a few components (screen, battery, micro usb breakout) but since they’re on the way and I have everything else, I think I’m going to get started! Thanks Wermy for posting all of this. This is my first RPi project and I’m a little nervous but I’m super excited to see how this turns out. Thanks to all of the other people posting ideas/help and their progress as well!

  15. Andy
    April 28, 2016

    Has anyone had any luck getting a 3.5″ composite display? The adafruit one that wermy listed in his parts page has been out of stock for awhile, and I have a feeling adafruit may be pushing people towards their piTFT displays that use GPIO pins, and may not restock their 3.5″ composites. Is there another source for an item like this?

  16. Yaniv
    April 29, 2016

    Question on this part – “you can use a multimeter to measure resistance across one end of each wire to the corresponding black button pad and make sure it’s a good clean connection”

    As a total n00b to multimeters, what would the number / range of numbers look like for a good connection? What is considered a bad / weak connection?

    Thanks for all your hard work so far!! You’re awesome and it’s appreciated.

    • Yaniv
      May 1, 2016

      nvm, figured it out 🙂

      • Andy
        May 9, 2016

        Yaniv,

        What were you able to figure out for good ranges for decent connections, in this project? Thanks,

  17. April 29, 2016

    Good day! Do you use Twitter? I’d like to follow you if
    that would be ok. I’m definitely enjoying your blog and look forward to new updates.

  18. D
    May 3, 2016

    Hi,

    Sorry but is 22 AWG good enough for the wires?
    More or Less ?

    Thanks a lot for your feedback ^^

    Regards

  19. Andrewt
    May 5, 2016

    Is your colour coding on the hi-res image right for the up/down/left/right buttons? You have right and up reversed?

  20. Larry Frazier
    May 10, 2016

    I have been thinking about starting this project in the summer so thank you for publishing your guides.

    • June 5, 2016

      That’s brilliant, I didn’t like the idea of cutting up the original game boy board. Just seemed a bit messy (cool but messy). Picked up one of those complete boards, hopefully it doesn’t take too long to get here.

  21. james
    June 5, 2016

    thanks, been watching but not doing! finally started on the controls, only had one colour wire so had to take my time going back check the right wires were connected also didnt have a volt meter so it was all or nothing but connected up to my pi and worked first time!
    amazing instructions, especially the simple detail you go into for the teensy part.
    now i just need to sort the screen issue next… 🙁

  22. July 17, 2016

    Wow. Just completed this section (buttons & Teensy wiring & programming) and I can’t believe it all worked on the first time. Thanks so much for providing everything (the arduino project and steps to install!).

  23. Matt
    July 18, 2016

    How do you set up the software? Do you do it on a computer? or do you import it onto a micro sd?

  24. Adam
    July 27, 2016

    If you get chance, please could you put a ‘shopping list’ and also name the tools/parts you used for us newbies? That would be a great help. Thanks

  25. Jordi
    August 14, 2016

    Hi, is posible to use a Game boy color board instead of the classic?

  26. Jordi
    August 14, 2016

    Hi, is possible to use a Game boy color board? Thanks

  27. October 13, 2016

    How did you find out which Pin or which pad’s function? Could you please paste a grid of that function button ? I got a 2.8 inch touch screen. but lack of button pad to control the pi zero to play games.

  28. Daniel
    October 15, 2016

    Hi. I want to do the same project. If i have a arduino nano, can i use it instead of a teensy?
    Thanks

  29. sergio
    October 28, 2016

    Hello anyone knows if the file .Ino teensy also works with version 3.1 or 3.2?

Comments are closed.