Make Your Own Slot Machine Raspberry Pi

The Raspberry Pi’s size and relative power enables it to be both a useful desktop computer, and one that you can slip in your pocket (if you really wanted to)

Picking up your Pi when you head out of the door is one thing; hooking it up to a monitor and keyboard and such is quite another. What if you could pick up your Pi and this was all attached? That would be a Pi laptop.

I took inspiration from them to create my own artwork for my arcade machine and had it commercially printed on vinyl stickers. Connecting Everything Together. The controller's USB connector will plug into the Raspberry Pi's USB socket. The power connecter for the display will plug into the Raspberry Pi.

There are many ways you can create a Raspberry Pi laptop, such as custom builds, hardware recycling, and even just buying a laptop based on a Pi. Let’s get portable.

Make your own Raspberry Pi laptop

One of the first things people often remark on when seeing a Raspberry Pi is its size, and that goes double for the Pi Zero. Yet, despite their diminutive form factor, Pi boards can be surprisingly complex to convert into a usable laptop, mainly due to their rugged construction and connectors. Here, we’ll overcome some of the obstacles with a bit of clever design and create a useful, portable handheld computer.

You'll need

  • 2000 mAh 3.7 V
  • 3D printer (or use a service)
  • SPDT switch
  • Screws (4-40 and 2-56) and wires

3D print the laptop case

This build is based on an Adafruit project, which provides 3D print files for the enclosure that are downloadable from here. Thingiverse can print them for you, but if you have a 3D printer to hand, you’re set. Expect about an eight-hour print time for all the parts.
Don’t worry about assembling the case just yet, but test everything out. Make sure the hinges fit ‘Lego-style’ to the case and slot together comfortably.

Prepare the PiTFT

The PiTFT features a breakout of many of the Raspberry Pi’s GPIO pins. We can use this to provide power to the Pi. Bend all the breakout pins on the edge of the PiTFT as flat as you can, or snip them off, but not right to the base. Either connect jumpers, or solder wires, to pins 2 (5 V) and 6 (GND). Leave plenty of length.

Mount the battery

Wrap the battery in some duct tape to keep it safe, then lay it along the Pi, wires away from the USB and Ethernet ports. Now attach the PiTFT to the GPIO header of the Pi. You should end up with a battery ‘sandwich’ with the battery’s wires free of the assembly. Be careful that the battery is safely insulated from the Pi’s components.

Thread the wires and mount the speaker

Before you insert the assembly into the printed case, run two wires (one for positive, one negative) between the Pi and the PiTFT. Don’t worry about length: too much is a good idea at this stage. The speaker may need its wires extending to reach the amplifier at the other end of the casing. Once you’re happy, snap the speaker (carefully!) into the mount on the case and screw the PiTFT and Raspberry Pi to the four pillars around the screen aperture.

Hook up the sound

Using the pair of the wires you threaded through the Pi ‘sandwich’, solder them to the ‘Vin’ (positive) and ‘Gnd’ (negative) points on the amplifier. At the other end, following the circuit diagram (Figure 1), solder the same pair to the ground and 5 V lines on the PowerBoost, shortening as required.

Next, connect the speaker’s wires to the amplifier’s output. You may need to extend them to fit. Finally, and very carefully, solder two wires from the A+ and A- lines on the amplifier to the Raspberry Pi board, as shown in Figure 1.

Attach the Power

The PowerBoost will deliver power to the whole system from the battery and also manage recharging. We’re powering the Pi through the PiTFT, so using the wires we soldered on to it earlier, connect them to the PowerBoost as shown in Figure 1, having shortened the wires to fit.
Solder two further wires to EN and GND on the PowerBoost. These need to connect to the SPDT switch. Thread the wires through the opening for the switch, solder one to the centre pin and another to one of the sides.

Install the Software

Before going any further, get your operating system ready to go. Raspbian can’t talk to the PiTFT by default, so connect a screen, keyboard and mouse, prep your microSD card with the latest version of Raspbian, and use the Terminal commands listed at magpi.cc/XaeUem to install the necessary software to drive the screen. You need to set the screen to rotate 270° and to mirror the HDMI output. Once rebooted, your PiTFT will come to life.

Main body assembly

Carefully secure the amplifier with 4-40 machine screws. Lay the case back alongside the main body and screw in the PowerBoost. Attach the battery (and then switch off if everything comes to life). Insert a USB WiFi adapter (if required) and the USB receiver for the keyboard. Tuck all the wires away carefully, looking out for shorts. Push the switch into the clips provided. Now place the back cover over the main body and secure with 2-56 machine screws.

Final assembly

It’s time to finish everything off. Snap the keyboard into the printed mount. Having checked everything fits and double-checked orientation, glue the hinges to the body and keyboard mount, then allow to dry. Push the hinges together, then secure each with long machine screws.
Check all the ports line up. Turn on the keyboard, flick the power switch, and after a few seconds the screen should come to life. Congratulations, you have a handheld, rechargeable Raspberry Pi.

Using your laptop Pi

Although the screen is great for gaming, we wouldn’t recommend writing your next great novel on it. That said, the density of the screen makes it comfortable for a bit of web browsing or using the Terminal. The bonus of audio makes for a cool little radio too.

You can power the system using the usual connector on the Pi, but this will not charge the battery. Instead, connect to the micro USB port at the base on the main unit. Don’t forget, you’ll need to keep the keyboard topped up too.

If you find the Raspberry Pi does not appear to be shutting down correctly, don’t worry. The screen does not refresh correctly on shutdown so appears to freeze. Just wait a few seconds, then switch off.

Speaking of Pi

The tiny Raspberry Pi is a convenient and unobtrusive tool for serving up slide shows.

I've always wanted to bring just a little box to a presentation, plug it in to the projector, and start talking. Why tote a bulky laptop? Or, what if you want to do something else with your laptop, like search for supporting documents while you are in the middle of your talk? Off-loading your presentation to a Raspberry Pi simplifies logistics and saves podium space.

My presentations regularly discuss small components, printed circuit boards, and electronics modules, and I like to show those devices to the audience as I point out important features and give commentary. So, I built a small device to show both slides and views of these electronic components in real time. In this article I show how I built my Raspberry Pi presentation machine.

The Concept

The Raspberry Pi has an HDMI output that will connect to most modern slide projectors of big-screen TVs. I'll also use a webcam – in this case, a Logitech C310 webcam – to capture live video of the components I'm describing in my presentation. In a more conventional setting, the video camera might point at the speaker or at some event or procedure that the speaker is describing. Of course, my Pi also needs a monitor, keyboard, mouse, and a reliable USB hub (see the 'Hardware Configuration' box for more details).

Raspberry Pi model B [3], with 512MB RAM, two USB ports, and 100MB Ethernet running on a 5-volt, 1-amp wall wart. An HDMI port is hooked up to a Sanyo DP42841 42-inch 1080p LCD big screen TV as a monitor. The idea is to hook up the presentation machine to an HDMI projector at events.

Edimax EW-7811Un 150Mbps wireless 11n nano-sized USB adapter

Logitech HD webcam model C310

Cables Unlimited USB2.0 four-port-powered hub, which has its own 5V at 1-amp wall wart

2GB USB stick containing the Impress presentation

Logitech USB mouse

Standard USB keyboard

SanDisk Ultra II 15MBps, 4GB SD card

Build Your Own Raspberry Pi

The rest of the ingredients are all software, including:

  • LibreOffice Impress [1] – The slide presentation tool built into the free LibreOffice suite, which is available for download from the Raspbian repositories
  • GUVCView [2] – A tool used for capturing webcam video and rendering it to a form the Raspberry Pi can channel

As I'll show in this article, my solution also depends on the power of the Pi to support multiple desktops. Figure 1 shows my prototype presentation machine.

Figure 1: The Raspberry Pi serves as a quiet and compact little presentation machine.

The Raspberry Pi Setup

Make Your Own Slot Machine Raspberry Pi

The software described in this article runs on nearly any Raspberry Pi Linux. I used Raspbian [4] because I like the simple, uncluttered look of its desktop (see the 'Software Configuration' box for more). If you haven't done so already, download Raspbian and burn it to an SD card, plug the SD card into the slot on the Raspberry Pi – make sure everything is connected properly, including your keyboard, mouse, WiFi USB adapter, and the powered USB hub – then, turn on your projector or big screen TV and power up the Raspberry Pi.

Make Your Own Slot Machine Raspberry Pi

Raspbian – Debian Wheezy

Version: January 2014

Release date: 2014-01-07

Default user/password: pi/raspberry changed to <xxxxxxx>

URL: www.raspbian.org

Raspberry Pi Make Image

Kernel version: 3.10

After the Raspberry Pi boots, raspi-config starts automatically, and you can do the initial configuration. When you select Expand Filesystem, a pop-up dialog appears labeled Root partition is resized. Select OK. Next, in the Change Password pop-up, type OK and enter a new password. Select Enable Boot to Desktop/Scratch.

Because video streaming is a resource-intensive task for a little computer, I chose to overclock my Pi for the maximum performance. Select Overclock and up the clock speed to 1GHz, 500MHz core speed, 600MHz SDRAM speed, and 6 overvolts. Type Finish then click Yes to reboot. Log in as pi with the password you set up earlier at the graphical login screen.

Make Your Own Slot Machine Raspberry Pi Game

Once the desktop appears on the Raspberry Pi screen, click the WiFi Config icon to bring up the wpa_gui window and click the Scan button to look for your LAN. Double-click your LAN under the scan results and click the Add button on the pop-up screen. Finally, click the Connect button on the wpa_gui screen before closing the window. You'll need the WiFi connection to download and install LibreOffice Impress and the GUVCView software.

You might have to monkey around with your router settings to get the Raspberry Pi to connect to your network, particularly if you run encryption, access point authentication, and other safeguards. Of course, you could also use a wired Internet connection to download the software.

I hacked the Logitech web camera to get access to the focus ring. I needed to adjust the focus down to about 4 inches. The Logitech C270 focus adjustment tutorial [5] showed how to remove the glue spot securing the focus ring: unscrew the lens for closer focus; screw in the lens to focus at infinity.

For the initial testing, I rested the C310 on a table, pointing the camera at a spare Arduino balanced on edge with a white sheet of paper for a backdrop (see Figure 2). Some type of stand, possibly with a few white LED lights, will give me a steadier image and is on the to-do list.

Figure 2: The camera views an Arduino Yun board I plan to discuss in my presentation.

« Previous123Next »

Make Raspberry Pi Kit

Raspberry pi slot machine software

Make Your Own Slot Machine Raspberry Pi Emulator

Buy this article as PDF

Pages: 6

Buy Raspberry Pi Geek

UK / Australia

Related content

  • Generation 2 of the Conference Presentation and Manipulation Apparatus

    The doctor upgrades a conference slide projection apparatus and adds a retro-clicker with some Python code to keep his talks moving forward.

  • Control Rasp Pi slide shows wirelessly

    Take a Presentation Machine slide show clicker from wired to wireless.

  • Up close with the Banana Pi

    The Raspberry Pi has spawned a new generation of imitators. One of the top contenders is the Banana Pi.

  • Raspberry Pi 3 Model B in detail

    The Raspberry Pi 3 changes the game with its fast, 64-bit CPU and support for WiFi and Bluetooth.

  • Raspberry Pi 1 and 2 compared

    The Raspberry Pi 2 looks just like its predecessor, the Rasp Pi 1 B+, and has lots of similarities. However, the freshly hatched second generation is much faster.