This is a electronics assembly guide for those who wish to skip the NFC Reader but still want the front buttons and LED to be functioning. This guide will help you setup the safe shutdown and game reset scripts. You will need the custom usb extender board, front pcb board, and other misc parts. Purchase links are below.
After completing this guide, you can always upgrade your Mini NES to add a NFC Reader.
This guide assumes that you already have an Assembled 3D Printed Mini NES Case. If you have any questions, please post them to the Facebook Mini NES Builders Group.
Tip: You can find combo deals on Amazon for the Raspberry Pi, Heatsink, and Fan.
Note: OshPark is a PCB fabricator. They offer cheap PCBs with free shipping in about 2 weeks. Ordering from them will give you enough PCBs to make 3 Mini NES Cases.
Before we start you will need to make sure you have:
You can follow this guide without the Mini NES Case. However, you should wait before trimming wire lengths until you have the case in hand to compare to.
These tools are useful when following this guide. Approx prices are listed.
Before you begin, watch this video on youtube to become a soldering pro!. Soldering is EASY. If that video is too long, you can learn from any of these videos in just a few mins.
Damage Warning! If you have an SD Card installed in the Raspberry Pi, remove it now!
The 3D Printed Case has a defect that will snap in half the SD card when the Raspberry Pi is inserted OR removed from the Mini NES Case.
You will have two almost identical switches for the Front Panel PCB. Do NOT solder the switches onto the PCB yet! Click the switches up and down to figure out which is the Latching Pushbutton Switch and which is the Momentary Pushbutton Switch.
The Latching Pushbutton Switch is the POWER button.
The Momentary Pushbutton Switch is the RESET button.
Tip: The fit of the switches and the button covers will be very snug and may take several tries, but they will fit with a bit of force.
Set the Front Panel aside for now, do NOT glue into the Mini NES Case yet.
The USB Extender is now assembled. You may re-install the Raspberry Pi into the Mini NES Case.
Note: The use of GPIO3 is important for the Power Switch. The software script takes care of shutdown/halt of the Raspberry Pi. GPIO3 has a hardware feature built into Raspberry Pi that wakes up from halt when shorted to Ground.
There are vents on the Mini NES Case, however, if you want to have play sessions of longer than a few minutes eventually you will want to add an active cooling fan. Wire the fan into the Raspberry Pi power, it will be always running.
With the Front PCB wired into the Raspberry Pi, you will need to install the safe shutdown and enable the Power LED.
Shutdown Script
import RPi.GPIO as GPIO import time import os GPIO.setmode(GPIO.BCM) GPIO.setup(3,GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: if (GPIO.input(3) == True): os.system("sudo shutdown -h now") break time.sleep(0.50)
Note: If you are using a momentary button instead of a latching button for the Power Button, you must update the script to watch for False instead of True.if (GPIO.input(3) == False)
You may also have to make this change if your switch is mounted backwards.
home/pi/NESPi/shutdown.py
sudo nano /etc/rc.local
(sleep 1; python /home/pi/NESPi/shutdown.py)&
Power Indicator LED
sudo raspi-config
Note: Depending on your retroarch version, you may not see the same menu options. Try "Interfacing Options" -> "Serial"
Reset Script
import RPi.GPIO as GPIO import time import os import socket GPIO.setmode(GPIO.BCM) GPIO.setup(4,GPIO.IN, pull_up_down=GPIO.PUD_UP) # Sends "RESET" message to port 55355 for RetroArch's network commands while True: if (GPIO.input(4) == False): print "Reset button pressed.\n" try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.sendto("RESET", ("127.0.0.1", 55355)) except socket.error: print "Failed to create socket" time.sleep(0.50)
home/pi/NESPi/reset.py
sudo nano /etc/rc.local
(sleep 1; python /home/pi/NESPi/reset.py)&
sudo nano /opt/retropie/configs/all/retroarch.cfg
Congrats! Did you enjoy this guide? Please consider donating by paypal to paypal.me/dustinwestaby