Skip to content

Development of a handheld console for PICO-8 games that runs with a Raspberry Pi Zero.

Notifications You must be signed in to change notification settings

isacben/picoboy-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 

Repository files navigation

picoboy

Development repository of a handheld console for PICO-8 games that runs with a Raspberry Pi Zero.

This project is ongoing. An MVP is not available yet.

The picoboy will be available here: https://github.com/isacben/picoboy

TODO list

Pre-study

  • Define requirements (actually, limitations) for an MVP on a PCB
  • Prototype of a game pad using a breadboard.
  • Look for a power supply board and a battery.
  • Look for an audio amplifier board and a speaker.
  • Learn about displays.
  • Look for a perf board and buttons for the game pad.
  • Design an enclosure?

General

  • Test Raspberry Pi GPIOs voltage: should be 3.3V.
  • Test PICO-8 on the Raspberry Pi.
  • Test PICO-8 on the RG35XX.
  • Prototype a display using an Adafruit TFT display.
  • Learn about Eagle CAD

For the MVP

  • Order a Game Boy Color shell.
  • Look for a display that fits on a Game Boy Color shell.
  • Design a PCB based on the Gaboze Pocail (see Similar projects)
  • List MVP components
  • Order display
  • Order RPi Zero W and charger
  • Order audio amp plus components (speaker, headphones jack, volume wheel, capacitors & resistors)
  • Order PCB

Requirements and limitations for PCB version (MVP)

  • PCB that fits in a Gam Boy Color or Pocket shell
  • Holes for RPi headers
  • Power the device by powering directly the RPi (no battery)
  • Connect a display to the PCB
  • Display connector on the PCB?
  • Buttons directly on the PCB (Retrogram from Adafruit will be needed)
  • Amplifier on the PCB with through holes components or the Adafruit PAM8302
  • Volume wheel and headphone jack
  • 8 ohms speaker
  • Power switch?
  • USB (mini?) connector to plug the chord on the PCB and a connection to the RPi
  • Game Boy Color shell with no modifications (hopefully)

Hardware Prototype

  • Install Raspberry PI OS
  • Configure Raspberry PI to boot to console
  • Install PICO-O8
  • Solder the 50 pin connector to the LCD screen adaptor
  • Solder headers for the LCD screen adaptor
  • Test LCD screen with the Raspberry Pi 3 A+
  • Test buttons

MVP Bill Of Materials (BOM)

Part Product Estimated Price
Raspberry Pi Zero 2 W Adafruit $15.00
Raspberry Pi charger Adafruit $8.25
Display Adafruit $14.95
RPi headers ? $0.00
Audio amplifier Adafruit PAM8302 $3.95
Volume wheel ? $0.00
Headphone jack ? $0.00
100uf capacitor (headphones) ? $0.00
100K ohms resistor (headphones) ? $0.00
8 ohms speaker Handheld Legend $3.99
Game Boy Pocket Shell Handheld Legend $7.99
Game Boy Pocket Silicone Membranes Handheld Legend $2.79
Game Boy Color Shell Amazon $20.66

MVP details

Audio Amplifier

The amplifier can consist of a circuit similar to the one present on the Gaboze-Pocaio, using the LM4875M/NOPB. The circuit is basically the example documented in the data sheet.

The LM4875M/NOPB provides a way to disconnect the speaker when headphones are detected.

The circuit itself includes the following components:

Component Description Reference part Value
R17 Potentiometer ?
R18 Resistor ERJ-PA3J151V 150 Ohms
R19 Resistor ERJ-PA3J104V 100 kOhms
C7 Capacitor CL10C221JB8NNNC 220pF
C8 Capacitor CL10A105KP8NNC 1uF
C9 Capacitor CL10A105KP8NNC 1uF
C10 Capacitor 6TPH100MAEA 100uF
J1 Audio Jack SJ1-3525NG-GR -
J2 Speaker SKU PRT-09914 - example 8 Ohms

Headphones jack

The following diagram shows how to connect the SJ1-3525NG-GR audio jack to the LM4875M. Some of my notes are in Spanish.

Audio jack connection

The diagram shows the audio jack pins (1 to 5) and what should be connected to each pin:

  • Pins 4 and 5 are connected to pin 3 of the amplifier (LM4875M), which is the HP-Sense headphone control pin. This control pin deactivates the speaker when the headphones are connected (the switches are open).
  • And pins 2 and 3 are connected to pin 5 of the amplifier (the output), which is the audio source (audio signal).
PIN SJ1-3525NG LM4875M
1 sleeve GND
2 tip 5
3 ring 5
4 tip switch 3
5 ring switch 3

Speaker

TODO

Volume wheel

TODO

Display

Possible displays, based on the Game Boy Pocket shell window size:

Game Boy measurements:

https://www.nintendo.co.uk/Support/Game-Boy-Pocket-Color/Product-information/Technical-data/Technical-data-619585.html

This is a common screen for the Game Boy Color:

LCD-39575-003/111
Size: 3.2”
Resulotion: 480X360
Type of Screen: LCD
Type of Flex Ribbon Connector: Clip

In the end, I will use the Game Boy Color shell, because there is more room for modern displays. The Pocket requires displays that are not available anymore.

The best screen for the Game Boy Color is Adafruit's https://www.adafruit.com/product/1774

Game Boy Pocket Shell

Screen area measurements:

Area Width Height
Display area (with screen protection frame) 4.9cm (49mm) 4.4cm (44mm)
Screen holder 5.7cm (57mm) 5.8cm (58mm)
Max screen size 5.9cm (59mm) 6.5cm (65mm)

Game Boy Color Shell

Area Width Height
Display area (with screen protection frame) 4.4cm (44mm) 4cm (40mm)
Screen holder 5.6cm (56mm) 5cm (50mm)
Max screen size 5.9cm (59mm) 7.1cm (71mm)

RetroPi

To configure wifi see the following links:

Configure SSH:

https://retropie.org.uk/docs/SSH/

  1. Boot to RetroPie
  2. Enter shell by pressing Ctrl + F4
  3. cd /boot
  4. sudo touch ssh
  5. sudo reboot now

Interesting way to connect the RPi to a PCB: pogo pins

https://www.adafruit.com/product/5382

Buttons

Buttons location on the PCB for the Game Boy Pocket (will not use)

Grid is configured to 0.5mm (Alt 0.125mm)

Button X Y Angle
UP 12.2 44.4 270
DOWN 12.2 29.4 90
LEFT 4.7 36.9 0
RIGHT 19.7 36.9 180
A 62.47 38.7 180
B 48.42 34.21 180
START 40.655 16.01 0
SELECT 29.055 16.01 0

Connection with the Raspberry Pi

To create a virtual keyboard using the GPIOs of the Raspberry Pi, I am using Adafruit's Retrogame software:

https://github.com/adafruit/Adafruit-Retrogame

Note this repository is in maintenance mode.

This is a tutorial on how to install Retrogame:

https://learn.adafruit.com/retro-gaming-with-raspberry-pi/adding-controls-software

Display

In the end, I will use Adafruit's https://www.adafruit.com/product/1774

But this was my investigation:

A good idea might be to use a capacitive touch screen, such as the Waveshare 3.5inch DPI LCD:

DPI displays seem to be more appropriate, since this type of displays have a faster refreshing rate (compared to the SPI displays). Also, the capacitive screen would be useful to use PICO-8 Splore to look for games.

There is selection table at the bottom of this link:

https://www.waveshare.com/product/3.5inch-RPi-LCD-B.htm

This display connects on top of the Raspberry Pi as a hat, which make the handheld device too thick:

Display on top of the Raspberry Pi

This is a tutorial on how to connect and configure a display similar to the one mentioned above:

https://www.youtube.com/watch?v=vCAGzLGTUk4&t=11s

There is also a 4 inch square display, which would be perfect for PICO-8, but it might be too big. It is also more expensive:

https://www.waveshare.com/4inch-DPI-LCD-C.htm

Another option is to use something like the Adafruit PiTFT Plus 320x240 2.8" TFT + Capacitive Touchscreen. The HAT uses the high speed SPI interface on the Pi. This will require a tool called fbcp (framebuffer copy). See Pocket PiGRRL:

https://www.adafruit.com/product/2423

The Adafruit PiTFT 2.2" HAT Mini Kit - 320x240 2.2" TFT - No Touch could also be a good option:

https://www.adafruit.com/product/2315

Power

For the MVP, I might not install a power booster nor a battery!

For the MVP, this wall power supply can be enough:

https://www.adafruit.com/product/1995

Since the battery will provide 3.7V only, we will need a circuit that can boost the battery voltage up to 5V and 1A (for a Raspberry Pi Zero, at least).

We also need to charge (constant current and constant voltage) and a protection circuit (over discharge and short circuit).

Thi video shows how to use the following components:

https://www.youtube.com/watch?v=VczNDDkFiAI

tp4056 MT3608 3.7V lithium battery switch: https://www.adafruit.com/product/805

Interesting videos:

Audio

The easiest option is to use the Adafruit PAM8302:

https://www.adafruit.com/product/2130

This is the wiring tutorial:

https://learn.adafruit.com/pocket-pigrrl/pam8302

Another option is to make a circuit using the LM4875M/NOPB:

https://www.digikey.com/en/products/detail/texas-instruments/LM4875M-NOPB/1871687

This looks pretty simple, and it is implemented in the Gaboze-Pocaio as well!

Enclosure

Ideas for enclosures:

Similar projects

Other resources

About

Development of a handheld console for PICO-8 games that runs with a Raspberry Pi Zero.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published