Retro Handheld Based on the ESP32 CYD and RetroGo
by DynaMight in Circuits > Electronics
1737 Views, 16 Favorites, 0 Comments
Retro Handheld Based on the ESP32 CYD and RetroGo

This is a ESP32 based retro handheld capable of playing a lot of 8 bit consoles such as NES, Gameboy, Gameboy Color, Lynx, Game Gear, Master System plus also some 16 bit such as PC Engine and a little SNES and MegaDrive but they tend not to run the best. You can also play Doom!
Its based on the amazing RetroGo software by Ducalax, you can see more information about the software here: https://github.com/ducalex/retro-go
The hardware behind this is known as Cheap Yellow Display (CYD) the actual name for the device is ESP32-2432S028R but thats not catchy so the term CYD was made because it was cheap and the board was yellow!! It essentially is an ESP32 with 2.8" LCD touch screen display, SD card slot, speaker output plus some other bits. These days you can buy them from Aliexpress for between $6-10, usually the 'bundle deals' are the cheapest. You can find plenty more information and also other projects here: https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display
The CYD lacks a lot of GPIO since its used by the onboard devices so it makes controls a little tricky but it does have I2C, which then allows an I2C expander board for the controls. I have created a simple PCB that uses a cheap IO expander for the controls but since its a handheld it also needs a battery and a way to charge so I've included this into the PCB too, I've tried to keep it as budget and easy as possible, there are probably better options out there tbh but it works.
The CYD also only has a 4MB rom rather than 16MB to support the full RetroGo package, initially I assumed this would massively limit the packages available and wasnt even sure if there was enough space for the 'core' package of emulators, however this compiled and worked fine and I was able to include everything apart from MSX.
Supplies
You will need to order the PCB, you can choose whatever PCB manufacturer you like, PCBWay or JCLPCB are the main ones based in China. Download the Gerber file from HERE you can use standard settings (1.6mm PCB) in whatever colour you want, I went for yellow to try to match the CYD PCB colour, the ones I used for this project came from JCLPCB, however I also have some yellow PCB's from PCBWay and the PCBWay yellow is a much closer colour match. It doesnt have to be yellow since its in the case anyway!
As for buying the CYD, the below link probably wont be the cheapest you can find, best to check the Related items and try to find a 'Bundle deal' Usually a good amount cheaper. Just make sure its the 2.8" version and looks similar! Sometimes if you keep clicking on other CYD devices then Aliexpress will get the idea you're interested in the device and then offer you a bundle deal, these are usually a good amount cheaper.
Cheap Yellow Display: https://www.aliexpress.com/item/1005006110360174.html
PCF8575 IO Expander: https://www.aliexpress.com/item/1005006661735050.html
4 pin 15cm Mini JST connector: https://www.aliexpress.com/item/1005007646851973.html
USBC TP4056 Lipo Charger: https://www.aliexpress.com/item/1005005676862745.html
4X4X1.5MM SMD Tach Buttons: https://www.aliexpress.com/item/1005005633442363.html
Slide Switch (SS-12F23): https://www.aliexpress.com/item/4001202080623.html
M3 x 16mm Countersunk Screws: https://www.aliexpress.com/item/1005006180128211.html
Ghxamp Mini Speaker 34.8mm*11.2mm*6.0mm: https://www.aliexpress.com/item/33035261832.html
PSRAM APS6404L-3SQR-SN: https://www.aliexpress.com/item/1005006722662043.html or ESP-PSRAM64H should also be fine: https://www.aliexpress.com/item/1005006722662043.html
22k & 47k 0603 resistors for sound mods: https://www.aliexpress.com/item/1005006142628179.html
Battery is a 503035 3.7v lipo battery, I dont always find Aliexpress the best for batteries. I tend to use eBay. Just search for 503035 lipo battery but you can use this link https://www.aliexpress.com/w/wholesale-503035-battery.html
Building the Control Panel













I would recommend soldering the buttons first so you have a flat base to work with, try to ensure the buttons are fairly well centred and flat to the board as there isnt a lot of tolerance between the SMD buttons and the 3D printed buttons.
Once the buttons are soldered then start working on the underside, either the TP4056 charge board or the IO expander, up to you, I did the charge board first. Personally I've been using pin headers as anchors so pushing one end through until its about half a mil through both boards then tacking it in place, do this on a few points then fully solder both ends, once solid snip off the excess pin header and maybe add some additional solder to ensure its solid and secure.
I essentially do the exact same for the IO expander. It makes more sense to use a row of pin headers for this as it keeps everything in line. Check the pics.
Obviously you can do it however you like, you can just flood fill with solder, as long as its a solid connection with no bridges then its all good. If you do flood fill, I would use a multimeter to check continuity to both sides as well as bridges.
After that then its the power switch, be a little careful not to go too crazy with the heat, they are not the best switches to be perfectly honest, they dont have that satisfying heavy click but do the job as long as you dont overheat.
Use some double sided tape to secure the battery, you dont need loads, just a 1cm x 2cm strip or whatever will be fine, then solder to the B+ and B- connections on the charge board.
As for the I2C header, note that the colours dont match the usual red=power and black=ground but I have designed the PCB to match the original order from the CYD. Red is actually power, at least with the cables I bought! so just be careful if the colour order doesnt match. The silkscreen shows which is which.
CYD.... Needs Some Work.. PSRAM

This is where the cheap part of CYD actually causes us some issues in getting RetroGo to work. Its a fairly intensive app, you have an amazing launcher plus intensive emulators. This requires PSRAM, however the CYD doesnt have this as a cost cutting feature, but we can add PSRAM.
This requires a PSRAM chip to be soldered onto the board as well as two traces cut and rerouted plus the LED to be removed to free up the required GPIO. The official guide is here: https://github.com/hexeguitar/ESP32_TFT_PIO?tab=readme-ov-file#adding-psram however this covers the original CYD with a single MicroUSB port, if you have bought your CYD within the last 18 months or so it will likely have 2 USB ports (they are referred to as CYD2USB) which have a slightly different trace layout.... also to confuse things there is now a newer revision that also has a slightly changed trace layout again!!
So if you have the original CYD with a single USB then solely use the link above, if you have a 2USB version that matches the picture above then use a combination of the pictures to confirm which traces to cut as well as the well written guide in the above link to fit the PSRAM. Obviously note that the picture above shows the traces to cut, you dont cut the wire!
If you have a newer CYD with a slightly different trace layout, just use a multimeter to beep out the traces and cut them and follow the above. Apart from the traces running in slightly different ways they essentially all connect to and from the same places, just routed a little differently.
CYD.... Needs Some Work.. Sound

So another issue with the CYD is the sound, whoever designed it messed up the sound by using incorrect resistors, which gives terrible sound, I mean really terrible. If you're not gonna bother with the mod for the sound then its 'dont even bother buying a speaker' bad :)
Just so happens the same clever person who wrote the PSRAM mod guide also did one for the sound so please follow this guide: https://github.com/hexeguitar/ESP32_TFT_PIO?tab=readme-ov-file#audio-amp-gain-mod
Personally I bought some 22k and 47k 0603 resistors and used those including where it says between 47k and 100k, I did try 47k and 100k and I couldnt hear any major difference.
Also to put a spanner in the works, the newer CYD2USB version I mentioned in the last section does actually have these sound fixes in place. So if the resistors look like the above pic then it means you have a newer board and wont need to do this mod. If you have 0 ohm resistors similar to the above link the you will.
Flashing the CYD

You will need to download the CYD RetroGo image file here: https://github.com/DynaMight1124/retro-go/releases/tag/CYD-RetroGo
Personally I use this program to flash: https://github.com/Jason2866/ESP_Flasher/releases/tag/v3.0.4
The CYD is fairly easy to flash thanks to a dedicated onboard flash chip and 'boot' button. To get the CYD in flashing mode, hold down the 'boot' button while plugging in the USB C cable (obviously while its also connected to a PC/Laptop) it will detect it and show up as a COM port. It may ask you for some drivers, if so, theres information HERE with drivers
Once you're ready with the CYD in flash mode, load ESP Flasher, locate the COM port for the CYD, select the CYD image file (may need to select All Files) and click Flash ESP and it should start flashing.
Note that when it finishes flashing, it'll reboot but you may see the factory menu auto scrolling. This will happen if the control panel isnt plugged in as its looking for an I2C signal. Unplug the power, plug in the control panel and it should then boot properly.
If you are still having control issues, I actually had a made I2C cable when I originally built mine, changed the cables over and it was fine so keep this in mind.
Print Shell & Build the Case

Print the top and bottom shell, they are designed to be printed face down without any supports. I personally like to use a textured build plate as I find it removes all layer lines but you can print it how you like. I used 0.2mm layer height for the case.
Button wise, A and B buttons are identical so print 2 of those and 4 of the middle buttons plus the DPad, I'd recommend printing the buttons and DPad at 0.1mm layer height to get it as smooth as possible.
Now its time to place everything into the case and complete the final connections/solder points.
You will need to connect power from the control panel to the CYD, 5V from the control panel goes to S3 on the CYD, Ground goes to S1 on the CYD. You will want some decently sized wires since it carries power.
I did reduce the wire length on the speaker to make it a little tidier (but also because I damaged the cable around the screw post doh! so if you dont cut, be careful of the routing!)
The STL's are also here: https://www.thingiverse.com/thing:7073904
RetroGo Software
You will need a FAT32 formatted MicroSD card, you dont need a large SD card to be honest, 32GB will be way more than needed but whatever you want to use, also doesnt need to be a super fast card either.
Download the SD files from here: https://github.com/DynaMight1124/retro-go/releases/tag/CYD-RetroGo
Extract the files to the SD card.
This includes the required software to allow the menu system to work, it doesnt include any roms or BIOS files, so you will need to locate these yourself. I have included the shareware version of Doom to get you going tho!
RetroGo itself is very easy to use, left and right to navigate through the systems, A to into a system, B to go back. Theres some menu buttons too as well as start/select for the emulators.
You can find more information about RetroGo and its usage on the main website: https://github.com/ducalex/retro-go
Sound and screen brightness is controlled via the menu. I probably wouldnt recommend charging and playing at the same time as its not a properly integrated circuit, also there will be no warning when the battery is about to die, in my testing the screen will likely start to flicker when the voltage is too low, as the CYD has no onboard battery management system.