I had just created the PCB for my CYD arcade cabinet (Here), sent it off, then thought "What about a handheld version" so drew up a PCB. It essentially uses the exact same control method as the cabinet. Same i2c controller, same button mapping.
Since its a handheld it would be pretty pointless without a battery. I tried to keep the project easy and cheap so tried a basic TP4056 as its tried and tested but I wasnt sure if it would work as it only outputs the battery voltage, not boosting to 5v but as far as I was aware the CYD ran on 3.3v anyway. So I ran a test with a 500mAh battery using a TP4056 and the CYD, my goal was about 1.5hrs to call it good enough to continue. I got 2.5hrs from fully charged to it cutting out. I would say that was 'good enough'. Lets face it, no-one is gonna be playing it for that amount of time!
I tried to keep the case design simple and minimal. It does make it quite long since the screen is portrait but it is what it is, obviously I could had widened with dead space on the inside but decided to keep to long and slim. Lets call it a unique feature.
I did also incorporate the marquee LED's, there wasnt enough room for all the LED's so technically its missing one so the animations can be a little off but its mostly there and you probably wouldnt notice. Not sure how many handhelds have marquee LED's but its optional anyway.
Ordering the PCB'sDownload the gerber file and send to your chosen PCB supplier, used the stock setting, so 1.6mm PCB. You can choose whatever colour PCB you want, I went with yellow for the final PCB's to match the Cheap Yellow Display PCB as close as possible. PCBWay have kindly supplied the PCB's and 3D prints for this project, I choose yellow to match the original PCB colour of the CYD and it was an almost perfect colour match, the quality of the PCB's were also very good. You can visit them at www.PCBWay.com
Compiling GalaginoI would start off by flashing the CYD first, it's not super easy to compile as you need to supply the required rom files to be compiled. I would recommend taking a read through the software section of the official Github: https://github.com/harbaum/galagino this covers the roms needed and how to convert them to the required format. This is only needed to be done once, you dont need all the roms if theres certain ones you dont want. You will also need to install the Adafruit MCP23017 library, you can do this from library manager.
A few tips on compiling, use Arduino IDE however the latest ESP32 core v3.x doesnt work properly, so downgrade this to v2.x, its recommended to use 2.0.9. You may also run into issues with space when compiling, if you do, set the partition scheme to 'Huge APP'. Once compiled and flashed via Arduino IDE and you will see the menu screen, it should be black, if its white there are options to invert this in config.h via #define TFT_INV_OFF, either commenting out or not. I dont have an original single USB CYD to test and I'd imagine they are not that common these days as were not sold for long before the 2USB version was released but it should work fine via the inversion.
Obviously when you compile you will need to use my fork which has all changes to the i2c and also CYD options preset. https://github.com/DynaMight1124/galagino-MCP23017/tree/CYD-MCP23017
Control PanelNow that the CYD is flashed, its time to build the control panel. Its not super hard to do but make sure all components are soldered flush and aligned, so it fits into the shell properly.
Its up to you which side you solder first, I tend to do the control side first so I can place the PCB on a flat surface to line up the buttons as well as I can, there isnt a large tolerance between the SMD buttons and printed buttons so you do want to make sure the buttons are soldered flat to the board.
As for the i2c board and the TP4056 charging board, you need to solder these flat to the main PCB. You can flood fill if you wish but personally I've been using pin headers and snipping. Its probably easier to show with pictures.
Heres the charging board. I did the same method for all 4 points to ensure its solid.
The i2c board is similar as per pics, obviously make sure you solder all required points, I've only soldered the minimum here, the main row for the controls then the 4 top ones for i2c communications. You can solder every point if you want. Its better to do more than needed than miss some that are needed :)
Solder the I2C header. note that the wire colours are not the usual so make sure you match. Red is actually 3.3v but the rest dont match, but the board does match the header.
Marquee LEDTheres also an optional marquee LED using 6 LEDs cut from a WS2812B IP30 144 LEDs per meter stripe. If you wish to use this, solder the JST connector as shown and plug into the connector at the top by the USB ports. Note that the wire colour doesnt match the usual combinations of ground/power/signal etc. Red = Power, Green = Ground & Black = TX/IO1 on the CYD. You can always repin the JST if that bugs you :)
The case has been designed with FDM printing in mind so print both sides of the case face down. When printing with FDM I prefer to use a textured build plate as it takes away the layer lines but if you prefer a smoother surface you can still print face down.
The final 3D prints for this project were provided by PCBWay, I used the exact STL files so if you want a really clean case then I would recommend sending away to be professionally printed as it really does give an amazing finish and look amazing as you can see below, especially with the clear back.
So yeah, the sound... it isnt great. The CYD has known issues with sound due to poor design. The fix is here: https://github.com/hexeguitar/ESP32_TFT_PIO#audio-amp-gain-mod I have done this mod and it makes a massive difference and is highly recommended almost to the point where I would say its essential. You can also place a 10k resistor across two legs of the sound chip, although this is still pretty terrible, just not as terrible as stock.
It also now appears that some new CYD boards come fixed from the factory, so its possible your new CYD will have good sound from new! You should be able to tell this by looking at R7 and R8 (if your board has a R7/R8 silkscreen then its likely to be the bad version), if they have a 0 ohm resistor then its the old version with poor audio, if they have different resistor values similar to this pic then its likely to be the corrected version and doesnt require this mod:
Its time to place everything into the case and complete the final solder joints.
Speaker needs to be connected. Power from the control panel to the CYD, 5V from the control panel needs to go to S3 on the CYD and GND from the control panel to S1 on the CYD, use decent size wires since it carries power.
I placed double sided tape on the MicroSD slot to hold the battery in place. Note that Aliexpress isnt always the best for buying batteries, they are not part of their Choice service so I didnt link directly, I tend to find eBay better. The one I used was a '503035 3.7v lipo'
You can the wiring thanks to the clear back shell provided by PCBWay.
Screw together with the countersunk bolts and you're done. Charge via USBC and the LED's on the charge board will turn off when fully charged. I wouldnt recommend charging and playing at the same time.
As for mods, if you find the LED's too bright, you could always add paper between the LED's and case. I lowered them as much as I could.
Now to enjoy playing on it for 10 minutes before placing it in a drawer and never playing it again :)
Comments