1.3 Inches RetroPie Zero




Introduction: 1.3 Inches RetroPie Zero

About: Make it yourself if you cannot buy one!

This instructables show how to use a 1.3" Retina grade IPS LCD HAT to make a tiny RetroPie Zero.

Step 1: Preparation

RPi Zero

Both Raspberry Pi Zero and Raspberry Pi Zero W is ok. WiFi version can make subsequent setup easier but in contrast it may draining more power continuously, i.e. shorter battery life.


Waveshare released 2 LCD HAT for RPi Zero, both have a tiny square LCD. The newer version have a 240 x 240 1.3" IPS LCD. It is 261 PPI and within the apple defined retina display range (218 - 458 PPI). This resolution is capable to emulate many retro game console in the CRT TV age, e.g. NES at 256 x 240 resolution, we can cut 8 pixels from both left and right overscan area and make it become 240 x 240.

Pin Header

To closely fit for the Waveshare 1.3" LCD HAT, it require a 8 mm tall 2 x 20 pins header. But I cannot buy one with 8 mm tall, so I will modify from a 12 mm tall pin header.

LiPo Battery

The interior size between RPi and LCD HAT can fit for a 5 mm x 23 mm x 45 mm battery, any LiPo battery with protection circuit that within this dimension should be ok.

Tiny LiPo Charge Board

I have some 10 mm x 10 mm tiny 5 V LiPo charge board in hand. It is small enough for this project, but the limitation is it only can charge the battery up to 50 mA current. A 400 mAh battery require over 8 hours for fully charged.

Power Switch

A tiny power switch.

Wrist Strap

Since this Game pad is so tiny and easy to slip from hand, it is recommended wearing a wrist strap while playing it.


The 3D printed case require four 14 mm M2.5 flat-head screws for assembly.




Step 2: 3D Print Case

3D print the case model you can find in Thingiverse:


For ease of illustration, I print each part in different colors:

  • Layer123.stl - Carbon Black
  • Layer4.stl - Translucent Yellow
  • Layer5.stl - Translucent Orange
  • Layer678.stl - Translucent Red
  • ButtonHead.stl - Translucent Red, Translucent Blue and Translucent Green
  • CrossButtonHead.stl - Gundam Red

Step 3: Direct Battery Power

This tiny gamepad has no room to fit in a step up circuit board, is it possible a LiPo battery direct power the RPi Zero (W) without step up?

There are some unofficial discussion about is it require full 5 V power supply for RPi Zero (W).

According to the RPi Zero reduced schematics, there are only 2 pins direct connected to 5 V, it is USB plug and PAM2306 regulator. All other parts powered by regulated 3.3 V and 1.8 V.

Assume we do not use any external USB device while powered by battery, the key factor is the regulator.

According to PAM2306 datasheet, there are still keep over 90% efficient for 3.3 V output when the input voltage dropped to 3.5 V.

RPi Zero average draw around 100 - 200 mA and the LiPo is around mAh, the discharge rate is around 0.5 C. It can still utilise 90% of LiPo capacity before drop below 3.5 V.








According to my simply test, the battery can last over 90 minutes while WiFi turned on. It should last longer if using RPi Zero.

Step 4: Pin Header Patch

Waveshare LCD HAT use low profile female pin header, it can make the product more slim. But we need a corresponding low profile male pin header at RPi Zero to make it. The male pin header should be 8 mm tall, but I cannot find on the web. So patch it from a 12 mm male pin header.

It require some patient to trim 40 pins the same length.

Step 5: Soldering Work

Solder all pin headers with RPi Zero.

Here are the connection summary of power circuit:

Waveshare Pin 2 -> Charge Board +vin, Power Switch Pin 1
Waveshare Pin 6 -> Charge Board -vin
                   Charge Board -vout -> LiPo -ve
                                         LiPo +ve -> Power Switch Pin 2
                   Charge Board +vout             -> Power Switch Pin 3
  • When Power Switch closed pin 1 and 2, it is Battery Powered Mode
  • When Power Switch closed pin 2 and 3, it is Battery Charging Mode / Power Off


Waveshare LCD HAT pin header is at the bottom, so the pin arrangement is upside down

Step 6: Assembly Layer 4

  • Put Layer 4 under LCD HAT
  • Fit the power switch in Layer 4
  • Put charge board and battery inside Layer 4 frame

Step 7: Assembly Layer 5

Put Layer 5 over Layer 4

Step 8: Plug in RPi Zero

Step 9: Assembly Layer 678

Put Layer 678 over RPi Zero.

Step 10: Put Screw Into Screw Hole

Step 11: Put Buttons Head on LCD HAT

Step 12: Assembly Layer 123

Put Layer 123 on the LCD HAT.

Step 13: Screw Up the Screws

Step 14: Assembly Cross Button Head

Put the cross button head into the cross button.

Step 15: Download RetroPie Image

Download RetroPie image here:


Select "Raspberry Pi 0/1" option to download the image for Raspberry Pi Zero

Step 16: Download Source

2 further source code required for the Breadboard RetroPie:





Simple click "Clone or download" button and then "Download ZIP" from both source web page.

Step 17: Prepare ROM Files

For the non license free game, I think you should only use the ROM that you have the original game.

Or you may find some license free games here:



Step 18: Flash the RetroPie Image

The steps to flash RetroPie image to the micro SD card is as same as flashing Raspbian image. If you are not familiar the flashing steps, please follow the steps provided by Raspberry.org:

P.S. remember to replace the image file name with the RetroPie image.

Step 19: Copy Files

Copy "mk_arcade_joystick_rpi-master.zip", "rpi-fbcp-master.zip" to the RetroPie micro SD just created.

Step 20: Configure Micro SD

We need further config after RetroPie boot, before that, we need to enable DWC2 USB controller to make network connection between computer and Pi Zero.

Edit the config.txt in micro SD, append the follow line at the tail:


Edit the codlin.txt in micro SD, insert "modules-load=dwc2,g_ether" after "rootwait" keyword. The result should be something like that:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=14a75fe9-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether quiet loglevel=3 consoleblank=0 plymouth.enable=0 quiet init=/usr/lib/raspi-config/init_resize.sh

Create a blank file called "ssh" in the micro SD to enable openssh server, e.g. in my Mac:

touch /Volumes/boot/ssh



Step 21: USB Connect

  • Insert the micro SD to Pi Zero
  • Set the power switch to Battery Charge Mode
  • Connect the Pi Zero 2nd USB socket (labelled "USB") to the computer.

Wait around a minute, you should find a new network adaptor in your computer. Type the follow command connect to the Pi Zero:

ssh pi@retropie.local


Default password is "raspberry", you should change it ASAP by "passwd" command

Step 22: Configure LCD

Append to "/etc/modules"


create the "/etc/modprobe.d/fbtft.conf"

options flexfb setaddrwin=0 width=240 height=240 init=-1,0x11,-2,120,-1,0x36,0x70,-1,0x3A,0x05,-1,0xB2,0x0C,0x0C,0x00,0x33,0x33,-1,0xB7,0x35,-1,0xBB,0x1A,-1,0xC0,0x2C,-1,0xC2,0x01,-1,0xC3,0x0B,-1,0xC4,0x20,-1,0xC6,0x0F,-1,0xD0,0xA4,0xA1,-1,0x21,-1,0xE0,0x00,0x19,0x1E,0x0A,0x09,0x15,0x3D,0x44,0x51,0x12,0x03,0x00,0x3F,0x3F,-1,0xE1,0x00,0x18,0x1E,0x0A,0x09,0x25,0x3F,0x43,0x52,0x33,0x03,0x00,0x3F,0x3F,-1,0x29,-3
options fbtft_device name=flexfb gpios=reset:27,dc:25,cs:8,led:24 speed=125000000 bgr=1 fps=60 custom=1 height=240 width=240

Step 23: Enable Fbcp

Extract source files:

unzip /boot/rpi-fbcp-master.zip

Compile and install:

cd rpi-fbcp-master/
mkdir build
cd build
cmake ..
sudo install fbcp /usr/local/bin/fbcp
cd ../..

Create new file "/etc/init.d/fbcp":

#! /bin/sh<br>### BEGIN INIT INFO
# Provides:          fbcp
# Required-Start:    kmod
# Required-Stop:     kmod
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description:
# Description:
case "$1" in
  /usr/local/bin/fbcp &
  ;;</p><p>  stop|restart|reload|force-reload)
  killall fbcp
  exit 0
  ;;</p><p>  *)
  log_success_msg "Usage: $0 start"
  exit 1

Make the file executable:

sudo chmod +x /etc/init.d/fbcp

Set it init at startup:

sudo update-rc.d fbcp defaults

Append the follow line in "/boot/config.txt" at the tail:

hdmi_cvt=240 240 60 1 0 0 0

Ref.: https://github.com/tasanakorn/rpi-fbcp

Step 24: Configure Joystick

Extract source files:

unzip /boot/mk_arcade_joystick_rpi-master.zip

Edit buttons definition:

cd mk_arcade_joystick_rpi-master/
vi mk_arcade_joystick_rpi.c

Find the "static const int mk_arcade_gpio_maps[]" row and update to HAT button mapping:

static const int mk_arcade_gpio_maps[] = {6,19,5,26,13,21,16,20,0,0,0,0};

Compile and install module:

sudo mkdir /usr/src/mk_arcade_joystick_rpi-0.1.5/
sudo cp -a * /usr/src/mk_arcade_joystick_rpi-0.1.5/
export MKVERSION=0.1.5
sudo -E dkms build -m mk_arcade_joystick_rpi -v 0.1.5
sudo -E dkms install -m mk_arcade_joystick_rpi -v 0.1.5

Test the buttons:

sudo modprobe mk_arcade_joystick_rpi map=1
jstest /dev/input/js0

Append to "/etc/modules":


create the "/etc/modprobe.d/joystick.conf":

options mk_arcade_joystick_rpi map=1

Ref.: https://github.com/recalbox/mk_arcade_joystick_rp...

Step 25: Copy ROM Files

Copy ROM files from "/boot" folder to "~/RetroPie/roms/$CONSOLE" folder



Step 26: Raspi-config


sudo raspi-config
  • WiFi: 2 Network Options -> N2 Wi-fi -> fill your WiFi details
  • Not wait network: 3 Boot Options -> B2 Wait for Network at Boot -> No -> OK
  • Timezone: 4 Localisation Options -> I2 Change Timezone -> select your timezone
  • Disable serial port: 5 Interfacing Options -> P6 Serial -> No -> No -> OK



Step 27: RetroPie Setup


sudo ~/RetroPie-Setup/retropie_setup.sh

Fine tune for 1.3" LCD: C Configuration / Tools -> 805 configedit -> 1 -> 0 -> 2 Render Resolution -> O Video output resolution -> OK -> Cancel -> Cancel -> Cancel

Change theme to fit tiny screen (require WiFi connected): 812 esthemes -> 14 Pixel-tft -> OK -> 1 carbon -> 2 Uninstall



Step 28: Native Resolution

The LCD HAT have 3 buttons and 1 extra push button in the cross button, it can map to the retro game console that only have 4 buttons (select, start, A and B). The highest resolution for this type of game console should be NES, it have 256 x 240 resolution. It can just fit for the 240 x 240 LCD display if simply crop the horizontal overscan area.

If you only play NES game only like me, you can apply the follow configuration to gain native resolution display.

Append "/opt/retropie/configs/nes/retroarch.cfg":

video_fullscreen_x = "0"
video_fullscreen_y = "0"
video_scale_integer = true

Append "/opt/retropie/configs/all/retroarch-core-options.cfg":

quicknes_use_overscan_h = "disabled"

Step 29: Controller Configuration

Joypad settings for EmulationStation:

vi /opt/retropie/configs/all/emulationstation/es_input.cfg

Input text:

<?xml version="1.0"?>
  <inputAction type="onfinish">
  <inputConfig type="joystick" deviceName="GPIO Controller 1" deviceGUID="15000000010000000100000000010000">
    <input name="start" type="button" id="11" value="1"/>
    <input name="down" type="axis" id="1" value="1"/>
    <input name="right" type="axis" id="0" value="1"/>
    <input name="select" type="button" id="10" value="1"/>
    <input name="left" type="axis" id="0" value="-1"/>
    <input name="up" type="axis" id="1" value="-1"/>
    <input name="a" type="button" id="0" value="1"/>
    <input name="b" type="button" id="1" value="1"/>

Joypad settings for Retroarch:

vi /opt/retropie/configs/all/retroarch/autoconfig/GPIO\ Controller\ 1.cfg

Input text:

input_device = "GPIO Controller 1"
input_driver = "udev"
input_start_btn = "11"
input_exit_emulator_btn = "11"
input_down_axis = "+1"
input_right_axis = "+0"
input_state_slot_increase_axis = "+0"
input_select_btn = "10"
input_left_axis = "-0"
input_state_slot_decrease_axis = "-0"
input_up_axis = "-1"
input_a_btn = "0"
input_b_btn = "1"
input_reset_btn = "1"
input_enable_hotkey_btn = "10"

Step 30: Speed Up Boot Time

sudo systemctl disable asplashscreen
sudo systemctl disable dphys-swapfile
sudo systemctl disable hciuart
sudo systemctl disable keyboard-setup
sudo systemctl disable nmbd
sudo systemctl disable raspi-config
sudo systemctl disable smbd
sudo systemctl disable nfs-config

Step 31: Optional Tuning

Fine tune "/boot/cmdline.txt":

  • Disable USB Ethernet Gadget
  • no logo
  • fastboot
  • quiet
dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=14a75fe9-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait loglevel=3 consoleblank=0 plymouth.enable=0 logo.nologo fastboot quiet

Step 32: Boot RetroPie

  • Turn off the RetroPie:
sudo halt
  • Unplug the USB cable
  • Set the power switch to Battery Powered Mode
  • Wait around half minute to boot up
  • Follow the screen instruction to config the game button
  • Select the console and game you have uploaded

Step 33: Emulation Station Power Option

Press start button (push down the cross button) to enter the Emulation Station configuration screen.



Step 34: Tie Wrist Strap

Step 35: Enjoy!

It's time to show off what you have made and play with it.

Step 36: Gallery: Color Mix & Match

Big and Small Contest

Runner Up in the
Big and Small Contest

Be the First to Share


    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • Make it Glow Contest

      Make it Glow Contest
    • Baking Contest

      Baking Contest


    Aaron Leslie
    Aaron Leslie

    Question 8 months ago

    Can I have a wiring diagram for the battery to the screen? Anybody's help would be appreciated.


    Question 2 years ago on Step 36

    What is the name of the "Tiny LiPo Charger Board" module?. thanks

    lipo changer.jpg
    Joro Kudo
    Joro Kudo

    Question 2 years ago

    sorry for all the questions but could you please tell me what pins on the waveshare board i should solder because i dont know how you numbered the pins and what their functions are
    and in the picture i can only see 1 soldered wire to the board

    Joro Kudo
    Joro Kudo

    Question 2 years ago

    I have 3 questions

    will a raspberry pi with presoldered pins work (because of the height)

    where do you have got your charge board from (and what model is it)

    and what kind of battery did you use (v mAh )


    Answer 2 years ago

    still work but you need a thicker case
    taobao, no special requirements, just Lipo charge board
    Lipo no special requirement, as mentioned in the instructables, it limited by interior room size


    3 years ago

    for some reason my screen stays blank and it seems to output to hdmi (my tv cant handle the resolution though. i don't see anything but get a low res warning)
    Any hints on where i can locate the problem?
    Dou you by chance have a prebuild image for this?


    Reply 3 years ago

    got it to work by adding "fbcp &" to /etc/rc.local above the word “exit” at the end of the file. but the display looks weird. is that a misconfiguration or is the display broken?


    3 years ago

    Your connection summary of power circuit does not match the pictures at all


    Reply 3 years ago

    It is the same, remember the pin layout of the flipped Waveshare board also flipped.


    Reply 3 years ago

    I forgot that. sorry


    3 years ago

    Dear Sir.

    Nice work. I followed your instructions but for example the game 1942 I cannot see to complete screen, there are black bars at the sides. If I put "rotate=1" in "config.txt" I get image complete (like your video) but it is rotated 90º. How can do it to get a complete image wihtout "rotate=1"?
    I´m using only Mame emulator.

    Thanks in advance


    Question 3 years ago

    What lipo battery did you use for you project because I can't find the lipo battery?


    Answer 3 years ago

    Any Lipo with size 5 mm x 23 mm x 45 mm is ok, I think the one in the photo is a 502035.


    3 years ago

    If I want to add sega Megadrive roms into system. Can you guide how to map the "c" button? (Megadrive have 4 buttons A,B,C and start this quite suit for this thing)


    Reply 3 years ago

    You can reconfigure the input in emulation station setting menu.


    Reply 3 years ago

    menu is too small but never mind i can config via shell :) thank for answer.
    now i move to 1.54" HAT


    Reply 3 years ago

    Trouble is I can't find the charging board you used and the ones that are available are nearly twice thed size and have a usb port.... Thats why I asked you what you used!


    3 years ago

    Simple question

    WHAT charging board did you use?