Introduction: Mega Drive Pi

When I bought my Raspberry Pi camera module I got a free Model A Pi with it and ever since then I have been trying to think of a project that I can use it in.
I saw a few tutorials online where people had installed the RPi into Mega Drives and Nintendos, but most of them seemed a bit more hacked together than I was happy with and lacked a couple of things that I wanted, so I decided to have a go myself.
I didn't think about uploading this until it was finished, so all of the photos have been taken after the project was complete, hopefully I've managed to show everything though.

Things I used...
Mega Drive - purchased from a local gaming shop
Raspberry Pi Model A - Model B or B+ would work fine (or better) but both of mine are used for other things
Shutdown circuit - Mausberry (https://mausberry-circuits.myshopify.com)
Wifi adapter - Amazon
Powered USB hub - an old hub that was laying around
SD card reader - cheapest one I could find from poundland
HDMI female-female coupler - Amazon (http://www.amazon.co.uk/HDMI-JOINER-COUPLER-CONNECTORS-electronics/dp/B003RIPURU/ref=sr_1_1?ie=UTF8&qid=1408132818&sr=8-1&keywords=female+female+hdmi+coupler)
Dual USB socket - Maplin (http://www.maplin.co.uk/p/dual-usb-a-socket-to-10-pin-motherboard-header-backplate-015m-a83cx)
2 USB plugs - Maplin
Sugaru - Amazon (http://www.amazon.co.uk/Sugru-black-Pack-of-8/dp/B007VXJM58/ref=sr_1_sc_1?s=diy&ie=UTF8&qid=1408133210&sr=1-1-spell&keywords=Sugaru)
Leads/wires - HDMI, USB (RPi power lead), USB (hub to RPi), hub power lead, ribbon cable, various wires
RGB LED
Header pins and female plug

Step 1: Make Space and RPi Mount

Firstly I ditched all of the the original circuitry from the Mega Drive.
I noticed that the cartridge input slot took up quite a bit of headroom, so I cut it back as much as possible without stopping the sprung flaps from working.
I then decided where to mount the RPi, I went for the right hand side as I meant I could use the expansion slot cover to access the headphone socket and composite video if needed.
I used one of the existing mounting holes in the Mega Drive and fabricated a bracket for the other hole, using a small off cut of acrylic and sticking it in place with Loctite (I was really surprised at how strong the glue was!!).

Step 2: Mount the Front USB Sockets

I wanted to be able to connect USB devices to the controller ports, so I got a USB plate from Maplin and hacked it about to fit in place. I used the metal plate as a shelf, screwed it to the Mega Drive and secured the sockets in place with LOTS of hot glue. I probably didn't need to use as much as did but I wanted to make sure they were strong as they will get more use than anything else.
The USB sockets came wired to a female header plug, but I wanted to be able to plug them into my USB hub, so I cut the plug off and wired individual USB plugs to each socket.

Step 3: Mount HDMI and Power Sockets

One of the important features for me was for the Mega Drive to be powered by a proper power supply that powered the USB hub and the RPi, the easy way to do this was plug the RPi power into the USB hub and the have the USB hubs power supply as the main power.
I couldn't find a way of placing my USB hub so that the power socket was at the back of the Mega Drive and all the leads fitted nicely, so I dismantled the hub, desoldered the power socket and added some wires to give me some flexibility over where it was mounted.
Next was making the hole at the back of the console big enough to fit the HDMI socket. I wanted the sockets to be where the original power and video sockets were, so I cut the panel out until they both fit (it was a real mess, but I made it good once the sockets were in place).
Once this was done I made a small bracket out of acrylic that would hold the HDMI socket and power socket in place, the bracket was screwed to exiting mounting holes and the sockets were secured to the bracket with more hot glue.
After the sockets were mounted I had to make it look more presentable so I used black Sugaru to fill in all the holes and smooth off the back of the console. In the end it looked a lot better than I expected.

Step 4: Switches and LED

I wanted to be able to used the original switches to turn the RPi on and off and reset it if necessary, but I wanted to make sure that the RPi was properly shutdown before it was turned off. I found some excellent circuits online at Mausberry Circuits (https://mausberry-circuits.myshopify.com) that did exactly what I wanted, I bought the one that allowed me to use my own switches and wired it up to a latching switch for the power and a momentary switch for the reset, I held the switches under the original buttons using Sugaru.
I also mounted an RGB LED and wired it up to make a power indicator (the wires just connect to a 3.3v and a ground GPIO pin, so when the RPi is on the LED is on, in the future I plan to make full use of the LED and connect it to other GPIO pins so that a python script will make it change colour).

Step 5: SD Card Slot

I realised quite late on in the project that if I wanted to change the SD card or if it got corrupted and needed to be re-imaged I would have to take the whole thing apart to get to it. I therefore decided I needed a way of moving the card slot to somewhere more accessible.
I found SD card extenders online, but was to impatient to wait for one to be delivered, so decided to make it myself. I bought an SD card reader from poundland and soldered a ribbon cable to the terminals and then soldered the other end of the cable to a strip of header pins.
I then did the same thing to the RPi, but with a female header plug.
I used a dremel to cut a slot in the back of the Mega Drive and mounted the card reader inside, using more hot glue.
After connecting it up and testing it I realised that the SD card slot on the RPi has 2 contacts that detect wether a card is in the slot and whether it is write protected. You can buy dummy SD cards, but again I was too impatient, so I made my own out of an old credit card.

Step 6: Assembly

Finally I just had to put it all together..
I started with the USB hub, plugging in the front sockets, Wifi adapter, RPi power cable and connection cable.
Then I mounted the RPi itself, coiled the HDMI cable on top of the USB hub and plugin it all in.
Finally I connected the switches, LED, and SD card ribbon cable.

All in all in pretty pleased with how it turned out!