Using a Raspberry Pi to play MAME games powered from batteries with a 3.5" LCD display. The controller is encapsulated with the Raspberry Pi computer in a small hand held case. The display and batteries are encapsulated in a small hand held case. The two cases can be plugged together or unplugged freely.
The video here demonstrates the project which this article describes how to build.
The article breaks the project down into several stages:
This project is relatively simple, but can be taken in a variety of directions depending on the builders requirements. The project builds on several previous projects and there are projects currently queued waiting to extend this project in new directions.
Voltage Regulator Circuit
The system runs off of a battery pack of 6 x AA Ni-MH rechargeable batteries @ 2400mAh. This will produce 6 x 1V2 = 7V2. This is enough to power the LCD display and audio amplifier directly.
The Raspberry Pi however must have a regulated 5V supply, this is critical. So a 5V regulator is used to provide a regulated 5V +/- 4% from the 7V2 supplied by the batteries.
The regulator circuit is one of the simplest electronic circuits. It uses only a 5V regulator IC and two capacitors to prevent electrical oscillation occurring in the circuit.
5V is passed back to the Raspberry Pi via a plug and socket placed in the case next to the audio plug and socket. The power is then applied to the 5V and 0V pins on the Raspberry Pi GPIO header.
A very basic audio amplifier circuit has been added to boost the audio signal up to the voltage supplied by the battery pack. This amplifier is as simple as it gets and won't provide very good quality sound. But for an on-board amplifier it should be good enough.
There is very little space in the case, so the left and right audio channels have been combined into a mono audio channel. This means only a single audio speaker is required in the case.
A piezoelectric device has been used as a speaker as these are very compact. However piezoelectric transducers are only really good for producing tones which resonate within the device itself. Reproduction of sound is not very good and the 7V2 from the battery pack isn't really good enough to drive the piezoelectric device. Some time will be spent later on to find a decent audio device for the system.
Audio Amplifier Circuit
LCD Interface Circuit
The LCD module is easy to wire up. The module was sourced from a car reversing camera display. It should be powered from 12V, but it will operate on a voltage as low as 5V. This is not the case for all LCD displays sourced in this way, some will only operate from 12V.
In this case I wire the 12V wire directly to the 7V2 on the battery pack. 0V to 0V on the battery pack. There are two AV inputs on the LCD, I wire AV1 directly to the Raspberry Pi RCA connector. It is important to remember the 0V line is common to all parts of the system.
The Raspberry Pi enclosure and software is taken from a previous project, full details of the project and how it is built can be found by clicking this link:
The components are placed on a board which just sits in the case. There is very little room in the case as the display has a PCB behind it which also has to fit. So care has to be taken when placing tall components to ensure they do not interfere with the taller components on the LCD board.
Luckily there are not many components and they can generally be fitted close to the edge of the board.
The battery pack is connected to the strip board using a connector which needs to be cut short in order to fit. Disconnecting the battery pack allows the strip board to be removed from the case.
The battery pack connector has a hole blocked and pin removed to enforce polarizing and prevent the connector being connected the wrong way around.
At the front edge of the strip board, a smaller piece of strip board is placed at a right angle and fixed using a right angle header strip. Connectors are soldered directly onto the smaller board at a pitch which will allow this case to plug directly into the Raspberry Pi case. This is done to ensure good mechanical stability when connecting, disconnecting and when in use.
Note that the connectors all sit at different heights and to achieve this well the Raspberry Pi needs to be offered up to the strip-board at the time of mounting the connectors.
There are several good features with this design.
The Raspberry Pi can still be disconnected from the display at any time and used for an alternate purpose or project.
The project does not need to be used as a gaming device, it can be used in other projects with different requirements.
The battery pack has an integrated switch built in, this is very useful and I recommend these battery holders.
There are currently some aspects of this project which are undesirable, this is because the project has evolved and lessens have been learned which will be applied in future projects.
The original project was designed to be used with the HDMI project, which means the keys are arranged upside down for this project. A workaround has been made in this project by getting MAME to rotate the display by 180 degrees.
For the same reason the battery pack has been mounted on the display for this project. In future projects the battery pack will be mounted on the Raspberry Pi case.
At this time the Raspberry Pi Model A is not available. The Model A should be used in battery applications because of it's much lower power consumption compared to the Model B.
Using a switch mode regulator to improve battery life.
There is a switched mode regulator available which is pin compatible with the 7805 regulator and a similar size. The 7805 regulator is supposed to be roughly 55% efficient where as the switch mode regulator TSR 1-2450 is supposed to be roughly 95% efficient. In testing, running this project from a fully charged set of batteries the switched mode regulator lasted 26% longer.
Raspberry Pi Model A Released Yesterday - improved battery life.
The purpose of the Model A Raspberry Pi has always been to provide a low power option at a lower cost. In testing, running this project from a fully charged set of batteries the Model A lasted 50% longer.