USB Gamepad Extension for Jelly 2 Phone.
by Jayden17 in Workshop > 3D Printing
1183 Views, 11 Favorites, 0 Comments
USB Gamepad Extension for Jelly 2 Phone.
Hello! My name is Jayden and I just completed my second year as a Robotics and Manufacturing Engineering Technology Major at Rochester Institute of Technology (RIT). Over the summer I chose to tackle various projects to try to continue learning new skills and growing my existing skillsets.
One of my initial project goals was to do something for Retro gaming, as I have always enjoyed old games such as Pac-man and Super Mario Bros. This leads to my SNES-style USB gamepad for the Jelly 2, a miniature phone. I believe it should also be compatible with the Jelly 2E and the new Jelly Star. I purchased this device a few months back, in hopes of limiting distraction while still retaining essential apps such as Spotify and Android Auto. Somewhat ironically, seeing the odd USB placement and convenient size I saw the potential to make my own gamepad extension for the device.
Supplies
Tools
- 3D Printer
- Soldering iron
- Multimeter (recommended for troubleshooting)
Consumables
- Solder
- Flux
- PETG and TPU filament
Components
These are the components I used. Most of the links are from where I purchased them. I had the USB C to C cable and header pins on hand.
- RP2040-Zero Microcontroller development board (chosen due to price + HID ability)
- 6x 8mm Tactile Pushbuttons
- Xbox controller thumbstick
- 2x 6x6x10mm right angle pushbuttons
- Joystick breakout PCB
- Gamepad PCB
- Header pins (4 more than included with rp2040)
- Mavic air 2 USB C to C cable
- Unihertz Jelly 2
Digital Files (Printables or Cults3D)
- Gerber files for PCBs
- 3D models of case and buttons
- Firmware
Conceptualization
I first made some sketches tracing over an existing SNES controller. And I was able to kind of figure out how I wanted the controller to fit with the phone. I drew several variations of the controller and picked the version I felt most comfortable with.
Case Design
I chose Fusion 360 to design my controller, it is very flexible with the ability to have a design history and helped make changes quick and easy. I'm not going to dive deep into the design and exactly how I modeled it. But I will go over some design highlights.
- I loaded the sketches in as canvas and added a Jelly 2 CAD model, thanks @MakeRig from Pintables!
- I modeled the shell of the case, around the jelly 2
- Modeled so the screen is centered horizontally.
- Cutouts around the camera and home button.
- Space for power and red button cut into the case.
- Split case to have separate back.
- Added holes and guides for the buttons and joysticks
- Created buttons based on guide holes
- Created snaps for front and back based on this Fusion 360 tutorial from Adafruit.
- Created PCB footprint
- Based on positioning off of the joystick, decided to move to a separate PCB to keep buttons from becoming too far away.
- Use projection of the holes to position components on the PCB.
- Both in assembling in Fusion 360 and EasyEDA component locations
- Added railing and snaps for the PCB
- Railing swept around PCB
- Added rectangular holes to footprint, snaps stick through them.
- Added USB hole and guide
- Although I tried to measure it, it took a few prints before I had good alignment
Of course, there were a lot of revisions along the way, and as I got lazy making quick adjustments, some of the CAD ended up being a bit messy, so there are some components that are hidden that are still referenced somewhere in the design. If interested .Stp and Fusion360 files are available with the other digital files.
Electronics Design
I originally just attached a few buttons to a prototype board and wrote a similar Arduino sketch as I show in the firmware section. After I confirmed that I could in fact use the pico as a gamepad via usb with the Jelly 2 I proceeded to move to an EasyEDA project to design the pcb.
I created two PCBs. One was for the joystick to make it fit better within the assembly than the existing breakout board to do this I used the PCB here and manipulated their design to fit within my size constraints. I also added more header pins purely to act as extra support for the joystick.
The second was the game controller pcb itself. In this case, I first needed to design a schematic, which was fairly straightforward, there is a community library on EasyEDA which made life simple. I then just made the necessary connections to the microcontroller after examining the proximity of the pins to the buttons on my footprint. I later changed a couple but had a good start. I attached a photo above.
I accomplished component positioning by importing in a dxf of the footprint (from Fusion360) I made with landmarks for the parts and then lining everything up to be approximately the same as the footprint. I then deleted the landmarks on the inside of the PCB outline. I chose to manually route the connections, as I was striving to make a design I could cut on my CNC with a 1-sided PCB board and auto-routing could not find a solution.
Making Gamepad PCB
So when it came to manufacturing the PCB I initially tried utilizing a CNC machine with and generating isolating routing code in FlatCAM. The thumbstick PCB is quite simple and provided little issue, however, fitting all the traces on one side, leveling the surface, and having it all work when I was done ended up being a nightmare, I did have a good board, but I found soldering more difficult and ended up destroying traces anyways and it had a horrid look as I attempted to solder everything from one side. Although I learned some new software and even experimented with leveling the g-code for the copper, I ultimately decided that in this case at least it would be best to outsource the boards.
So I sent my Gerber files to JLCPCB and being through EasyEda, there was a deal that allowed me to purchase them for around $22 after shipping. The default options were fine for these PCBs. The Gerber files are available on the same pages I hosted the case and buttons.
Soldering Components
Soldering with the custom-ordered PCBs was straightforward. The buttons just clip in and can then be soldered. I pushed pin headers for the rp2040 to be about halfway up on each side to save space.
Firmware
Firmware was actually kind of an afterthought in this project. At first, I had an Arduino sketch with a gamepad library for the RP2040, it worked but had limited game compatibility, fortunately, I found GP2040-CE firmware. I built the firmware for my pinout and inverted the analog joystick. This firmware is much more compatible and feature-rich than my original solution.
Following their instruction I first dragged over the nuke_fs file to format the rp2040 before sending the firmware. You will need to enable analog for the thumbstick with the web configurer. To access the web configurer hold start, connect the game controller and open a web browser to 192.168.7.1/. You can also remap pins there.
Testing
A quick and easy way to test all the inputs was to use https://gamepad-tester.com/ to test the gamepad.
My board had an issue with the pins on the bottom header (no clue why, other boards seem OK), so I corrected that by bridging them to other working pins. I then used the web configured in the firmware to correct my board.
3D Printing
This design is actually a very easy support-free print. I believe it took around 6.5 hours for the case and another 1.5 hours for the buttons in TPU. I originally made the buttons PETG too, they were quite noisy and simply switching to TPU remedied that issue.
My Print Settings
- PETG Casing
- TPU buttons (a lot quieter than using hard plastic
- .2 mm Quality setting in Prusaslicer
Assembly
- Place buttons and USB cable
- Angle pcb so that the left and right triggers are lined up with buttons.
- Push pcb past case snaps
- Push pcb into pcb snaps
- Position cable
- Clip the bottom case on.
Game Setup
Depending on your application you may need to manually map the gamepad. Generally, there would be an option where you would create a profile for the gamepad where you select each button and then press the equivalent on the gamepad. You can also remap the pins to your needs with the web configuration tool.
I also found a cool app: Console Launcher, which can be auto-launched when the extension is attached, using an app like tasker.
Play!
Thats all! If you decide to make your own I would love to see it. Also, any suggestions and feedback are always appreciated. Thanks