Skip navigation
1 2 3 Previous Next

Raspberry Pi Projects

243 posts

We recently went on holiday and I took my laptop & VGA cable with me. It was my intention to hook it up to the TV and play some media on it to keep the kids happy on rainy days (pretty essential in the UK!). It turned out the TV had the VGA port covered up by the mounting bracket, so we ended up putting the laptop on a chair and watching videos from there; it did the job, but there was a perfectly good TV I could have used.

 

At home we have a Fire TV Stick that runs Kodi, but the problem with Fire TV is that it has to have an internet connection, otherwise it refuses to run any apps. I'd rather not have to tether it to my phone all the time.

 

Next time I'll be more prepared; I've put together a compact and flexible setup consisting of a Raspberry Pi 2 running OpenElec (and Kodi) together with a set of cables allowing me to hook it up to pretty much any TV. The Pi runs Kodi really well; the OpenElec distribution boots really quickly & has good Wifi and BlueTooth support.

 

Cable-wise, I've got a 1m standard HDMI cable, which will be used in most situations.. with a 2m HDMI extension lead if I can't get the Pi near enough to the TV (some accommodation doesn't have power sockets where you'd expect them). I've also got a RCA lead, with a SCART adaptor as well.. so that helps if we get stuck with an older TV, which is a plus point for using a Pi 2 with composite out.

 

For media storage I've gone with a USB3 Flash Drive with a capacity of 64Gb, which gives us more to play with than the microSD card, and it's super-fast for copying media from a PC. As soon as you plug in the flash drive, Kodi will show it in the menus.

 

At first I chose a compact/travel USB-based keyboard instead of Bluetooth in case OpenElec 'forgot' the keyboard and I'd have nothing to navigate the menus to re-pair it. But then I bought a numeric keypad from eBay for £2. The keypad isn’t instantly recognised by Kodi, but an easy way to get it up and running is to use the Keymap Add-on. Attach a normal USB keyboard and the keypad at the same time, start the add-on, and use the keyboard to activate the remap process. From there, it’s dead simple to map the keypad to the different Kodi functions.

 

So that's it.. nothing groundbreaking or overly difficult to put together. The whole system is small enough to fit in a small travel bag & gives us a lot of flexibility when dealing with different hotels/accommodation. You may just find the TV accepts the USB flash drive and can play back whatever is on it.. but at least you'll have all the gear you need if it doesn't

 

 

 

Kit list;

 

1 x 2m HDMI extension cable

1 x 1m HDMI cable

1 x Raspberry Pi 2

1 x 8Gb MicroSD card

1 x Compact USB travel keyboard

1 x RCA to SCART adapter

1 x 3.5mm plug to RCA lead

1 x 64Gb USB3 Flash Drive

1 x USB power supply + cable

Originally posted on: Pi Zero Case One-Minute Mod – Frederick Vandenbosch

 

A 1-minute mod for the official Raspberry Pi Zero case, inspired by the ZeroView.

 

Requires:

  • Raspberry Pi Zero (W) with official case
  • Raspberry Pi Camera module
  • Hobby knife
  • Two suction cups

 

mod.jpg


Follow me:

logo_128.png1490017350_facebook_circle.png1490017353_twitter_circle.png1490017359_youtube_circle.png1490017357_instagram_circle.png

Hello! I'm currently designing a project based off of the Nintendo Switch and modern gaming tablets, It's called PiTab (Pie-Tab) and it uses the Raspberry Pi 3 Model B. It has two slots for controllers on the sides, and a screen in the middle. It also has a 3.5mm headphone jack, an HDMI out, and a rechargeable battery.

Why have a rechargeable battery? It's made to be taken with you on the go, not just at home! There's two ways to play; connect it to the dock, or play as a handheld.

You can also play with any bluetooth/USB gamepad supported by RetroPie.

 

I probably won't make the "PiCon" controllers on the sides of the console, as I'm not good at that kind of stuff...

 

LINKS:

http://www.tinyurlcom/teamdoom

https://www.gofundme.com/PiTab/

 

Concept Art:

 

Console PiCons.png

Console Front.png

I'm looking at building an AoIP link using a pair of suitable Rpi's with Wolfson / Cirrus audio boards.

 

Audio In/Out would be analog. The Ethernet link would be extended using Ubiquity wireless long range access point devices set up as a wireless bridge.

 

I'm getting a wee bit lost trying to determine the most suitable combination of Rpi board, audio board, and OpenOB version. I also have a strong preference for a board combination that is drop-in compatible with an existing & readily available case such as the Camdenboss Wolfson board case (from what I can gather, this seems to be designed for the older Rpi boards which are no longer available?).

 

My intention is to set this up as a more or less embedded system that I can plug in, turn on, and send / receive audio.

 

I'd appreciate some help figuring this out. I'm not really concerned about having the latest & greatest, but rather the combination that is most likely to just work, with as little troubleshooting & fiddling around as possible.

 

# I work as an audio / light tech, and also as wireless installer for a small ISP using Ubiquity equipment. Although I prefer to use Ubuntu based Linux OS's such as Mint for my daily computing, I'll be the first to admit that I'm not much of terminal / code guy - my configuration requirements for work are VERY basic. I can get a bit of help from our chief technician, although his available time is limited. I can however follow sufficiently clear instructions

In the previous parts of this series we've setup a shared network folder and some network nodes. Now we can actually get on with installing and using Blender.

 

Installation

To install blender the following is needed.

 

sudo apt-get install blender

 

Running Blender

As Blender is a graphical program, it made sense to attach a screen to my controller node and launch the application. It takes a while to launch but eventually it returned the default scene of a cube and a light. Even on the Pi3, it's pretty slow to use from the graphical interface so I'd not want to have to use this for creating the scenes on the Pi. The menus are unresponsive and even just navigating the file structure is a challenge.

2017-02-04-222352_1360x768_scrot.png

I downloaded some sample files and rendered the first one. A couple of minutes later it appeared.

2017-02-04-223435_1360x768_scrot.png

Command line

It is also possible to run Blender from the command line to render either single frames or animated sequences. You'll need to use the UI to design the models and animation first and you can set the output parameters here but some of the output details can be changed at the command line.

 

The command line returns a strange error which I've not worked out yet.

AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"

 

I repeated the rendering from the command line with the following.

 

blender -b /mnt/network/Samples/AtvBuggy/buggy2.1.blend -o /mnt/network/Samples/AtvBuggy/buggyrender -f 1

 

The parameters are:

-b scene to load in background

-o output file

-f number of frame to render

 

On the Pi3 that generated the file in 01:00.38.

the Pi2 takes a little longer 01:15.89.

 

Animation

I picked a model helicopter animation to test out the rendering on the cluster. I created a simple shell script to render different frames on each of the nodes.

ssh cluster1 blender -b /mnt/network/Samples/Demo_274/scene-Helicopter-27.blend -o /mnt/network/Samples/Demo_274/Helicopter##### -s 1 -e 25 -a &
ssh cluster2 blender -b /mnt/network/Samples/Demo_274/scene-Helicopter-27.blend -o /mnt/network/Samples/Demo_274/Helicopter##### -s 26 -e 50 -a &
ssh cluster3 blender -b /mnt/network/Samples/Demo_274/scene-Helicopter-27.blend -o /mnt/network/Samples/Demo_274/Helicopter##### -s 51 -e 75 -a &
#Render rest locally
blender -b /mnt/network/Samples/Demo_274/scene-Helicopter-27.blend -o /mnt/network/Samples/Demo_274/Helicopter##### -s 75 -e 100 -a

 

Then ran the script with

 

./BatchRender.sh > render.log

 

This was perhaps a little optimistic as it was hard to tell what was going on and at least one of the nodes failed to find the network drive.

 

I had to remount the drives using to following command. It should be possible to schedule this at boot but I have yet to configure that.

 

sudo mount -a

 

I then created a ssh session to each of the nodes and started rendering. The first few frames appeared after about 30 minutes, the helicopter turned out to be a photo-realistic Meccano one!

Helicopter00001.png

3 of the nodes were producing one frame every 30 minutes the last was estimating 10 hours per frame. When I check that node was a B+ so the extra power of the Pi3 really makes a difference here. So, best that the other 3 nodes take some of the work-load from this node.

 

After a few frames, I realised that this was not actually animated so all my nodes had produced the same image! My blender skills are fairly limited so rather than animating this I tracked down some demo examples with animation at https://download.blender.org/demo/old_demos/demos/ .

I decided to use hothothot.blend from the 220 zip file. Results below.

 

Producing a video

Once you have a series of frames you need to turn these into a video. Blender does have a built-in video editor for this but an alternative is the command line tool FFMPEG.

This can be installed by following Jeff Thompson's instructions to build FFMPEG, note that this could take a few hours.

 

Creating the video took a few seconds with the following command:

 

ffmpeg -r 60 -f image2 -s 320x240 -i Render%05d.png -vcodec libx264 -crf 25  -pix_fmt yuv420p Render.mp4

 

 

Summary

Drawing1.png

So in summary, the blade does a good job of providing a platform and power to the blades. As has been seen, the setup of the network can be challenging, perhaps I should have stuck to DHCP! The sharing of the disk in comparison was straight forward. The suggested use case of a Blender render farm is quite achievable although you'd want to use the Pi3 rather than earlier models. I think if you had a big project you want to look into how the allocate of frames to nodes could be automated, there are some commercial solutions available but it should also be possible to code something.

 

Reference

https://docs.blender.org/manual/en/dev/render/workflows/command_line.html

https://www.blender.org/download/demo-files/

FFmpeg

Installing FFMPEG for Raspberry Pi – Jeff Thompson

Using ffmpeg to convert a set of images into a video

Checking Your Raspberry Pi Board Version

As shabaz mentioned in the previous comments a lot of the setup for a Pi Cluster applies to other scenarios. Something I stumbled upon this week was building a hadoop cluster with raspberry pi which is another thing you could do with the Bitscope blades.

 

In this part of the project, I'm looking at the setting up of the nodes.

 

SSH

I took a slightly different approach to enabling SSH on the nodes by creating a file called ssh on each of the boot partition of the SD cards.

 

Network

Each node was renamed and given an unique IP, 201,202 and 203.

 

So that the nodes can communicate to the main network the controller has been configured to act as a gateway, see Niall McCarroll - Building a Raspberry Pi mini cluster - part 1

 

I followed the previous steps to give the boards static IP addresses, however, it does not work. The boards kept ending up with a DHCP assigned IP address and if I turned off DHCP then I ended up with no address at all.

 

Eventually, this turned out to be out of date information and rather than change the IP address in the interface file, it has to be given in the DHCP config file  /etc/dhcpcd.conf

 

interface eth0
static ip_address=10.1.1.201/24
static routers=10.1.1.200
static domain_name_servers=192.168.1.254 8.8.8.8 4.2.2.1

 

I also found that the domain name servers were not being picked up correctly. The following command shows what you have configured.

 

 resolvconf -l

 

It should give the list of addresses mention above. I found it did not work correctly until I changed the /etc/network/interfaces back to it's default.

iface eth0 inet manual

 

Network share

The steps to mount the share are the same as for the controller, starting with the backup of the fstab file, creating a password file and adding the mount point.

 

I also needed to install smbclient using

sudo apt-get install smbclient

 

Automating the configuration

Once SSH and the network are configured we can automate the install of the other software. The first step to this is to follow the steps in Rachael's article below to add keys to connect to SSH. We can then use shell commands to run the same thing on each of the nodes. You can't use this for interactive tools such as editors but it's good for command line such as mkdir and cp.

 

#!/bin/sh
HOSTS="cluster1 cluster2 cluster3"
for HOSTNAME in $HOSTS; do
    echo executing command on $HOSTNAME
    ssh `whoami`@$HOSTNAME $@
done

 

In the next and final part of this series I'll look at running Blender from the command line so that all the nodes can be processing files.

 

Reference

 

Setting a static ip in Raspbian

Building a Raspberry Pi mini cluster - part 1

Updating security for remotely connecting to my servers via SSH

Setup of the controller node

 

SSH

The latest raspbian disables SSH by default so I turned that on and changed the hostname and password.

 

External disk

As mentioned about this is a USB disk, so it was simply a case of plugging it in and it being detected. I had a problem detecting the old IDE disk so I swapped in a SATA disk I had spare.

 

I'm not much of a command line guru so I installed gparted a graphical disk utility that I'd used before for repairing problem disks. I formatted the disk with ext4 (as it won't be accessed outside the cluster) and gave it a suitable name. On reboot it was mounted automatically.

 

I did have to resort to a command prompt to make a new directory and grant permissions to all

 

sudo mkdir /mnt/external/images/
sudo chmod 777 /mnt/external/images

 

Sharing software

Samba Server

The software for sharing files on a LAN is called Samba. The setup is quite detailed so I followed the steps in Peter Legierski's blog post below. In summary the steps are, install, set password, configure samba and configure the firewall (iptables).

 

There are a few differences I needed:

 

  • the line "security = user" did not exist so had to be added
  • the path in the smb.conf file was changed to  /mnt/external/images
  • restarting the service requires service smbd restart not samba as in Pete's notes
  • iptables did not need configuring it defaults to all access

 

Samba Client

I checked that I could connect from my windows desktop.

Connect.png

I also configured the Pi to automatically mount the network share. The first step is to make a backup of the configuration.

 

sudo cp /etc/fstab /etc/fstab.bak

 

Add a mount point

sudo mkdir /mnt/network

 

Then edit the configuration file to contain the details of what to mount

sudo nano /etc/fstab

 

I added the following to connect my share to my mount point and to use an external file for credentials

//cluster0/shares /mnt/network cifs credentials=/etc/samba/user,noexec 0 0 

 

Next create a file with the user account

sudo nano /etc/samba/user

Containing the username (pi) and password from when you setup the Samba share

username=pi
password=samba_user_password

 

And finally test it works with

sudo mount -a

 

I created a file in my folder and checked it could be read over the network with

ls /mnt/network

Network

The ethernet router I was using was configured to give out the same IP addresses as my wifi so I went with Niall McCarroll's suggestion of using static IP addresses. However, I found his suggestion of using /etc/network/interfaces does not work. You need to edit /etc/dhcpcd.conf

 

interface eth0
static ip_address=10.1.1.200/24
static domain_name_servers=192.168.1.254 8.8.8.8 4.2.2.1
metric 400

 

For my controller node, I needed to change the metric of the LAN connection so that it was higher than the default for the Wifi. Otherwise attempts to reach the internet were routed to the internal router. I also needed to add the DNS entry so that commands such as apt-get still work.

 

My /etc/hosts file was

10.1.1.200   cluster0
10.1.1.201   cluster1
10.1.1.202   cluster2
10.1.1.203   cluster3

 

Finally I tested the configuration with a reboot and

ping 10.1.1.200

 

What's next

The network and disk has taken me a bit longer than anticipated so there will be another part where I setup the nodes. This will likely follow the guidance of Niall McCarroll. I'll also need to get the nodes rendering from the shared drive.

 

Reference

GParted -- A free application for graphically managing disk device partitions

Mount an external hard disk on the Raspberry Pi

Building a Raspberry Pi mini cluster - part 1

Raspberry Pi [Part 2]: External drives, Samba and SFTP | self.li - blog by Peter Legierski

Cannot restart samba, samba.service is masked - Ask Ubuntu

Samba Guide

Samba Client Guide

PiHut - connecting to network storage at boot

Internal and External IP Addresses

Morning all!

 

I'm working on a little Pi Project, and I'd like to get your input on logistics or and ideas you might have to make it easier/better.

 

Basically, I'd like to have a device that can run Retropie with dedicated gaming buttons, and also run an Andrid like tablet operating system.

 

The idea is that I have a custom Tablet case with a touchscreen, and inside there will be 2 Raspberry Pi units, one of them running RetroPie, and one running Android or an alternative. I'd like it to have one Power button, with a toggle switch to choose between the two systems.

 

The RetroPie system will be hooked up to some buttons/joysticks for gaming, and the Android tablet will be hooked up to a home button. Ideally there would be a shared Battery for both units in the middle behind the screen, or 2 separate ones if that's easier to set up. I'd like to have a USB port for both units for file transfer, and for multiplayer on the Retropie, and ideally an HDMI out for use with a monitor.

 

I've made a little mockup to demonstrate what I mean, or roughly what I'd like it to look like, if you can see any problems or potential issues with the design, features, or the concept as a whole, let me know! I'm interested to see what you guys think!

 

Tablet.png

 

 

CHEERS

Following a discussion from DABs review of the Bitscope Blade Uno, I thought it was worth quickly mentioning the different sockets and pins you get on the bays of the blade.

03.jpgQuickStartGuide.jpg

 

Socket for Pi

This is a standard 2mm x 40 way socket for mounting the Raspberry Pi, it will fit all of the 40pin Pi including the zero.

Aux Power

This a 3 pin header with Gnd, +5v and Gnd. The power is aways on when there is power to the blade.

 

Power control

This is a 2x2 header with a jumper connecting +5v with the Pi sockets for 5v power. You can remove the jumper to disable the socket or attach a switch or relay. The other 2 pins are GND and GP21. This means that you could wire up a shutdown button to all of the Pi to be controlled either from a master controller e.g. the Pi in Bay one or an external switch. It might have been nice if Bitscope had provided a bit more information about what you might do with this connector as per the examples you see for some of the Pi UPSs.

 

Hub Connector

This is a cut-down version of the GPIO header on the pi, it is a right angle male connector on the bottom of the board. There are 26pins broken out including serial, I2C and some GPIO. So you could potentially wire these up to a custom board or across to a Pi accessory board. It does not include the Eprom pins needed for true HATs to work correctly.

 

 

Here's a video I put together to explain how to ssh into retropie from another computer running ubuntu. This allows you to transfer games, or whatever files you want to any folders on your Raspberry pi 3. I kept the video short and to the pont, let me know what you think. How can I make it better? Thanks for checking it out!

 

https://youtu.be/ksEOzpEokVE

toukomputer

Retro Computer Pi

Posted by toukomputer Jan 3, 2017

"HELLO WORLD":

 

My name is Xavi Lazaro and I live in Barcelona - Spain. As a fan of 80's computers I always dreamed to be in that garage era where one could build his own micro computer using some sort of kit and letting your imagination flow...

 

... So this was the idea, to build having fun an old looking computer as seen 30 years ago!

But, history says that you need a partner to end computer business with success so what better than my daughter Iris.

 

Hi I am Iris! Why did I take part in the making of the TOUKOMPUTER? I remember when I was like seven or eight, when my dad started showing me the world of retro computers. At first it seemed a little boring: why focus on old machines when you have brand new PCs and gaming consoles with a way more possibilities? But as I grew up, I started to think in the ''how'', more than in the ''what'' of Spectrums, Commodores, Amstrads... How could people make games in the 80's without any programmation platforms? Coding drew my attention. So I though it would be great to build one of that computers with my dad, learning new things about tech and about designing a machine!

 

BASIC IDEA:

 

The first thing was to imagine and draw an old computer design:

 

Retro Computer - Xavi Iris Lazaro (1).jpg

 

After some thinking design this ended up using Corel Draw,

 

IDEAS Retro Computer PI TKO.jpg

 

we chose this one as the final design:

 

Corel Design Retro Computer PI TKO.jpg

 

 

 

 

The goal was to have a retro style computer that featured all the connections needed to be a standalone machine, also with a Cartridge Port as seen in multiple 8 bit computers. This will be of great help to change between "ROMS" in this case SD OS Cards.

It had to have enough power to run some retro stuff like emulators and 8 bits old systems. So, the use of a Raspberry Pi 3 as a core was the better option..  We have in mind to have one OS card booting in some version of BASIC as the old ones, and we found  a project called FUZE for raspberry with a BASIC emulator, so what more do we need?

It was important to be able to use this system with old VGA monitors and also with new HDMI Screens.

The machine had to be compact and portable (from room to room at least...) but always with an old flavour.

 

 

A good work isn't it??? So....Let's begin!

 

BILL OF MATERIALS:

 

Then it was time to acquire some materials, but with an idea of not spend so much and to recycle as much as possible.

 

  • A Raspberry Pi 3:  bought in Amazon/Element14
  • Plywood wood, wood glue, fretsaws blades, wood screws: bought in a Hardware Store
  • Ugreen®  HDMI extension cord male to female High Speed, Raspberry PI 3 compatible:  bought in Amazon
  • Aukru - Heat Sinks for Raspberry Pi (aluminium, 3 units), color silver:  bought in Amazon
  • MicroSD to SD adaptador extensor flexible/SD rs-mmc/SDHC/MMC:  bought in Amazon
  • VicTsing Cable HDMI to VGA Adaptor 1080P with Audio and DC/5Vin:  bought in Amazon
  • 4x Kingston SDC10G2/16GB - microSD card 16GB (class 10 UHS-I 45MB/s) with SD adapter:  bought in Amazon
  • AC/DC 2A Adaptor - Recycled Material
  • AC Outlet-connector -  Recycled Material
  • Red Led - Recycled Material
  • ON/OFF Switch - Recycled Material
  • Audio Jack female:  bought in an electronic Store
  • Audio Jack male and cable - Recycled Material
  • USB HUB - Recycled Material
  • USB cable extensor- Recycled Material
  • Old PS/2 Keyboard - Recycled Material
  • PS/2 USB converter - Recycled Material

 

 

 

BUILDING PROCESS:

 

Here we have attached a lot of pictures (maybe too much...) with the object to visualize the building process:

 

There is no much explanation, the first thing is to build the sides with a desired measure and then use them as reference for the rest of the parts.

 

There is a little of information for every step:

 

 

Sawing sides of 10 mm plywood:

Retro Computer - Xavi Iris Lazaro (2).jpg

 

Filing sides:

Retro Computer - Xavi Iris Lazaro (3).jpg

 

This keyboard is to large !!!, let's take an old keyboard and... wait!!!! oh... poor keyboard...!

Retro Computer - Xavi Iris Lazaro (4).jpg

 

 

Now it is small and cute and it will fit in the box! Who wants numeric keys????

Retro Computer - Xavi Iris Lazaro (5).JPG

 

The membrane is respected in order to have a working keyboard...

 

Retro Computer - Xavi Iris Lazaro (6).JPG

 

Placing and drawing the keyboard frame:

 

Retro Computer - Xavi Iris Lazaro (7).JPG

 

Sawing the keyboard frame, Iris is sawing straighter than a saw machine!:

 

Retro Computer - Xavi Iris Lazaro (8).JPG

 

Retro Computer - Xavi Iris Lazaro (9).JPG

 

Retro Computer - Xavi Iris Lazaro (10).JPG

Retro Computer - Xavi Iris Lazaro (11).JPG

 

Having measures again... or it could be too late...

 

Retro Computer - Xavi Iris Lazaro (12).JPG

 

Putting together the keyboard's base and sides:

 

Retro Computer - Xavi Iris Lazaro (13).JPG

 

 

Filing the differences:

 

Retro Computer - Xavi Iris Lazaro (14).JPG

 

 

Now it's perfect!

 

Retro Computer - Xavi Iris Lazaro (15).JPG

 

 

Let's go for the other parts of the box: front, rear and top! The wood is 5mm plywood.

 

Retro Computer - Xavi Iris Lazaro (16).JPG

 

All parts showed are sawed and filled:

 

Retro Computer - Xavi Iris Lazaro (17).JPG

 

All parts mounted provisionally to have and idea....

 

Retro Computer - Xavi Iris Lazaro (18).JPG

 

Details of the space inside for fitting the components:

 

Retro Computer - Xavi Iris Lazaro (19).JPG

Retro Computer - Xavi Iris Lazaro (20).JPG

Retro Computer - Xavi Iris Lazaro (21).JPG

 

 

Now is time to test the Keyboard and the VGA converter. Please note that this converter needs a 5V DC input to work properly with a Raspberry.

 

Retro Computer - Xavi Iris Lazaro (22).JPG

:Testing the Keyboard without numeric keypad.  We have put a slice of plastic between membrane and contacts of unused numeric keys to avoid unwanted touch:

 

Retro Computer - Xavi Iris Lazaro (23).JPG

 

 

It is time to make the holes for screws, leds and connectors. The back and the base are mounted using screws, this way it will be easy to access inside:

 

Retro Computer - Xavi Iris Lazaro (24).JPG

 

The cartridge hole, led and the rest of connectors are ready.

The process is done using a small drill and a lot of filing. We have drilled too some holes for ventilation:

 

Retro Computer - Xavi Iris Lazaro (25).JPG

 

 

Here the box is glued and prepared with two coats of primer or undercoat paint:

 

Retro Computer - Xavi Iris Lazaro (26).JPG

 

 

Now is time to choose Color....Wait...What!? Electric Blue!!!???

Yes dad this is what I want!

 

Retro Computer - Xavi Iris Lazaro (27).jpg

 

Retro Computer - Xavi Iris Lazaro (28).jpg

 

 

This computer shines!

 

Retro Computer - Xavi Iris Lazaro (29).JPG

 

 

Preparing decals using decal paper and Corel Draw as edition software.

The name of this computer will be... TKO... Please Iris, could you explain why....?

 

Sure! I have an OC (original character) called Touko, who loves retro computers. She was the main protagonist of a short manga I had in mind. After reaching a deadpoint in the story, I left the idea in a drawer in my mind, which remained closed for two years or so. When my dad told me about the retro computer and that we had to think a name for it, my bulb lighted: Touko (that old oc) + computer = TOUKOMPUTER (TKO)! A (is it really? XP) original name with sense! And I could also make Touko the mascot: tunning the case, making wallpapers, put her in the logo, etc.! (which I never did... sorry)

So that's all the story! Simple, isn't it?

 

Decals Retro Computer PI TKO.jpg

 

 

 

Retro Computer - Xavi Iris Lazaro (30).JPG

 

Logos for the Retro Computer Pi TKO:

Logos Retro Computer PI TKO.jpg

 

All decals are in place with two coats of matte acrylic varnish to protect them:

 

Retro Computer - Xavi Iris Lazaro (31).JPG

 

 

It is time to mount connectors.

Proposed connectors and AC adaptor placement:

Connectors Retro COmputer PI.jpg

Retro Computer - Xavi Iris Lazaro (32).JPG

Some pieces of wood make a support for the large connectors.

 

There are installed two monitor adaptors, one for VGA and one for HDMI. Unfortunately It will be necessary to open the computer and connect one or the other to the Raspberry Monitor Output in order to choose between them:

 

Retro Computer - Xavi Iris Lazaro (33).JPG

 

 

Here we are extending the keyboard caps lock led, this will go directly to the front of the computer box:

Retro Computer - Xavi Iris Lazaro (34).JPG

 

 

The Keyboard is glued to the wood and ready to rock!

 

Retro Computer - Xavi Iris Lazaro (35).JPG

 

Here we have some external help...

Retro Computer - Xavi Iris Lazaro (36).JPG

 

 

Using two recycled washers we are holding the Raspberry to the computer box connector board:

 

Retro Computer - Xavi Iris Lazaro (37).JPG

 

 

Now is time to bring power, here the AC Adaptor is glued to the board, then the 5VDC Output is connected to the on/off switch and finally to the Raspberry DC Input.

AC arriving to the AC outlet is connected to the AC/DC adaptor using a couple of Faston Terminals:

 

Retro Computer - Xavi Iris Lazaro (38).JPG

 

Here we see also a Power LED, it goes directly to the Raspbeyy PI 5VDC pin and ground respectively, using a 300 Ohm resistor

 

Also there is a double check in the AC ADAPTOR  to assure that  +5VDC is properly connected to the Raspberry DC Input:

 

Power Led.jpg

 

 

Retro Computer - Xavi Iris Lazaro (39).JPG

 

 

For a properly operation we are Installing Heat Sinks to the Raspberry, 3 in total:

 

Retro Computer - Xavi Iris Lazaro (40).JPG

 

And with all connected the TKO is a little messy inside.... Observe the SD/MicroSD Adaptor Flat cable: the trick for the frontal cartridge port:

 

Retro Computer - Xavi Iris Lazaro (41).JPG

 

 

Ladies and Gentlemen... Let us introduce you the Retro Computer Pi TKO!

This is THE MACHINE!

Retro Computer - Xavi Iris Lazaro (42).JPG

 

 

Computer size compared to a 19 inch monitor and to a Mac Mini...

 

Retro Computer - Xavi Iris Lazaro (43).JPG

 

Some more pictures in detail:

 

Retro Computer - Xavi Iris Lazaro (44).JPG

 

 

The Cartridge Port is a really good Idea, We have a lot of rooms ready... for OS images ; )

OS ROMS REtro Computer PI TKO.jpg

 

Photo of the OS Cards:

 

Retro Computer Pi TKO Cards.jpg

 

 

 

An easy way to change between operating systems (similar to a Nintendo 3DS!):

Retro Computer Pi TKO Cartridge Port.JPG

 

 

 

Look at the connectors at the back side:

At the moment, there is no need for Ethernet port being WIFI the only network connection:

 

Retro Computer - Xavi Iris Lazaro (46).JPG

 

Retro Computer - Xavi Iris Lazaro (47).JPG

 

 

Look at the speaker out and additional USB Port ( using a USB cable enlargement). An easy way to connect USB devices.

 

Retro Computer - Xavi Iris Lazaro (45).JPG

 

 

The machine is ready to work!

 

Retro Computer - Xavi Iris Lazaro (48).JPG

 

Retro Computer - Xavi Iris Lazaro (49).JPG

 

Using a 27'' HDMI Screen:

 

DSC01468.JPG

 

Using and old TFT 17'' Monitor:

 

DSC01470.JPG

 

 

BASIC in ROM... no... in SD CARD....

Our first program...

 

 

So this is all. My daughter and I have enjoyed a lot in the process and we have learn some things, too. It is time to enjoy the system!

Thank you very much for reading!

 

 

 

Xavi Lázaro & Iris Lázaro

Barcelona - Spain 2017

As mentioned it the previous post, I'm building a small render farm for Blender using the Bitscope Blade. I decided to mount all the components on a sheet of wood so that I could pack the whole thing away when I was not using it.

 

Drawing1.png

Power

Back in March I put together a kit that turned an ATX power supply into a Benchtop Powersupply  I had another of the same 1U ATX supplies that would work well for this project. I chopped up some extension cables so that I could simply plug the supply into the blade and router. I wired up the "PS-ON" to GND as there's a separate on/off switch that can be used on the back of the supply. I also wired up 2x12v connectors for my router and the cluster. I was slightly thrown as the router was 5.5/2.1mm and the Bitscope Blade was 5.5/2.5mm. The disk was an old IDE one so needed a chunky 4 pin connector, the PSU already supplied that. The spare connectors I just bundled in parallel so they would not get in the way. A couple of 3D printed clamps hold the PSU to the backing board.

PowerCables.jpg

External Disk

I had started with a cased disk caddy but realised I also had a simpler one which would allow a bare drive to be used. This should result in the smaller setup. The disk was mounted via some suitably printed brackets.

Network

Each of the pi plugged into a handmade short Ethernet cable and connected to a router. As mentioned in the previous post, one of the challenges of a cluster is managing the software on each node. I'll likely wire the cluster up to my main network for the setup then disconnect it once the software is installed.

NetworkPowerAndStorage.jpg

The setup is ready for use now so next up is some configuration.

 

I've put the 3D models into GitHub and will add any scripts and code as they get created.

 

https://github.com/Workshopshed/RenderFarm

 

Reference

Makezine - Turn a computer power supply into a bench power supply

The Bitscope Blade is from the same people who make the Bitscope Oscilloscope & Analyzer tools. It's a host board that allows you to host one to four raspberry Pi and provides power and connectivity. You can stack a series of blades into a chassis and power these from a shared supply.

44-FB26K-02.jpg

Here's Bruce from Bitscope describing it in more detail.

 

 

BitScope Blade Power & Mounting Solutions for Raspberry Pi

 

Render farm Overview

Element14 invited me to take a look at these blades so I started by reading the above page. One of the suggestions was for a render farm for the open source 3D modelling and animation package blender. This seemed like a great way to prove out the system in a real-world scenario.

 

My farm will consist of 4 Pi with one acting as a controller node. That will connect to the USB external disk and have a secondary network connection (possibly wifi) so I can copy the files to be rendered and download any packages needed.

 

 

Drawing1.png

 

The are four key elements in a render farm:

  • Power
  • Network
  • Shared Storage
  • Configuration management

 

Power

The BitScope Blade provides the power to the Pi via the 40way sockets. The blade has a beefy switch mode power supply in the form of an LM2576HVLM2576HV and a few discrete components which can provide 3A for the Pi and any accessories. The supply can take anything from 9v to 48v as an input. There are some big capacitors to handle any rush of current when starting up. I hope to power the external disk from the same supply but I do have the option of powering that independently if required. I'll likely use a spare 1U ATX power supply to provide power to the blade and router as I can grab 12V of that for both of them.

 

Network

The network will be connected up with Cat 5e cables and an old 10/100 router.

 

Shared Storage

The control node will connect to a USB disk which will be shared over the network.

 

Configuration management

For four nodes the configuration of the nodes is straightforward and can be done manually, for a larger system you'd need to consider how configuration and monitoring can be automated. Some script files will likely be used to help with that.

 

Setup

The next post in this series will look at how I setup the hardware.

There is a large collection of Raspberry Pi projects on Codemade.io. You can see them here https://www.codemade.io/category/raspberry-pi/ and get your inspiration/instructions on how to build your next product.  I usually browse projects, look at the directions for the ones I like, and buy the parts to build it on Element14.

RaspberryPySlotsBanner.jpg

 

Enter e14's 2016 Costume Contest Here!

 

Introduction

Writing the final post for a project is always tough for me because I constantly second guess myself on whether or not I could have spent more time on the project, or if I have covered everything that needs to be covered. Fortunately, I can write this post knowing that I could not have spent more time on this project, because I ran out of time two days ago. My original deadline for this project to be complete was actually two days ago, but I simply was not anywhere close to finished by the time the deadline arrived. Thankfully, the good people here at Element14 granted me 48-more hours to finish up.

 

Before we get into the main update, I want to take a moment to talk about why I got behind, and then how Murphy’s law came into effect several times over the last week. The first issue arose when some of the parts I ordered for this project did not arrive. The NeoPixelsNeoPixels, and arcade buttons did not arrive with the original parts order, and I went ahead and ordered a roll of NeoPixels from Amazon just in case they did not arrive before I needed them. I also ordered a pack of 10 arcade buttons from Amazon, but when they arrived, they did not have the micro switches attached to them, and were just the button assembly. I did manage to find two old arcade buttons in an old project parts box I had in my attic.

 

The second issue arose when I was working on mapping two GPIO pins on the Raspberry Pi 3 to keyboard inputs. I tried several different GPIO to keyboard mapping packages, and none of them worked with the Pi 3 / Raspbian Jessie. After spending a day on this, I finally tried Adafruit’s RetroGame package, and while it worked, it somehow bricked the Python install on the Pi. I ended up having to format the SD card, and start from scratch. This was not that bad though because I had all of my code saved. I reinstalled the RetroGame package, and everything worked fine this time, so I assume something was corrupted when I ran the makefile in the Retrogame install.

 

The final issue was split between Friday evening and Saturday Morning. I had been planning to design some graphics for the front of the slot machine, and then printing them on lightweight paper, but as it turns out the large format printer at my local Staples was broken. To make this matter worse, Staples is the only place locally that can print anything larger than 24-inches wide. So I woke up early Saturday morning and called several other printing locations within 30 miles, and all of them were either closed on Saturday, or they were not willing to do a single print on short notice. This forced me to come up with a solution very last minute, and you will read more about that later. So yea, that is basically how the last week of my life went, and I apologize to E14 as well as the community for this late post. Now let's get started with the actual update!

 

 

Button Play

 

 

One of the key aspects of this project is to use my left arm as the pull handle that triggers the slot machine’s roll. Since the Bfruit program uses keyboard input to control the game, I needed to map a couple of GPIO pins to work as those keyboard inputs. As I mentioned earlier, I tried several different packages that are supposed to be able to do this, but none of them worked with the Raspberry Pi 3Raspberry Pi 3 and Raspbian Jessie. I have used PiKeyed in the past, and it was the first package that I went to, but apparently there is some issue with the Debian Jessie kernel that renders it useless. Basically I could get the PiKeyed Daemon running, but it would not register any key presses from the buttons I had attached to the GPIO pins I mapped in its config file. The two other programs I used also had this same issue, and I assume that they are based off of the same code.

 

In the end I wound up using the RetroGame package from Adafruit. In hindsight I should have used this package from the start, but I was under the impression that I had to install the full RetroPie suite for it to work correctly, and I did not want all of the extra bloat that it would have added to this simple project. After talking to some people in the Adafruit forums, I realized that I could just install RetroGame and nothing else. There are a few tutorials online and at Adafruits website that covers the install, but I found them all to be a little different from each other, and some are missing key parts of the install for the latest version of the program. So to make things easier for anyone following this project at home, I am going to list my install process below, but first, I want to cover how I wired the switches to the Raspbery Pi 3’s GPIO pins.

 

Raspberry-Pi-GPIO-Layout-Model-B-Plus-rotated-2700x900.png

 

The game has two key buttons for gameplay. The left arrow initiates the “spin”, and the up arrow is used to increase the “bet”. The game also uses the escape key, and the enter key, as well as the right arrow, but they are more for menu navigation, so I am not too concerned with them being broken out to physical arcade buttons. I plan on keeping a wireless keyboard in my backpack when showing off the costume at parties, so I can use it to start, and restart the game. Looking at the Raspberry Pi 3 pinout diagram above, I will map GPIO17 to the left arrow key, and GPIO22 to the up arrow key.  The ground pins located at board pin numbers nine and fourteen are used as the ground for each button. The diagram below should clarify this layout some.

 

Pi-Button-Wiring-PySlots.jpg

 

As you might have guessed, I am using the buttons to pull their respective GPIO pins down to low when pressed, and some of you might be wondering why I have not added in any pull-up resistors. The answer is that RetroGame enables the internal pull-up resistors for each pin I map in the program’s configuration file. By using the internal pull-ups I am able to reduce the components needed, and make the circuit as simple as possible.

 

 

Mapping the GPIO Pins to Keyboard Keys using RetroGame

 

retrogame-banner.jpg

 

With the buttons wired I was able to move onto installing the RetroGame package. The process is not hard, but there are a few key steps for the newer version of the program that many of the older tutorials on the internet do not have. Note: Now would be a good time to backup any code that you have not backed up previously. As I mentioned in the intro to this post, something went wrong during my initial RetroGame install, and it bricked the Python package installed on my Pi, and the only way I was able to fix things was with a fresh install of Raspbian Jessie.

 

 

Installing RetroGame to Raspbian Jessie

 

 

Most of this tutorial is copied from Adafruit’s Install RetroGame tutorial found at (https://learn.adafruit.com/super-game-pi/initial-setup) , I have amended a few things here and there to include a couple of steps unique to the new version of RetroGame.

 

Download RetroGame

Navigate to the pi's home/pi directory and download the Adafruit Retrogame repo from github.

  $ cd /home/pi/

  $ git clone git://github.com/adafruit/Adafruit-Retrogame

 

Edit The Config File

Now before we finish installing RetroGame we need to edit its configuration file to map the Pi 3’s GPIO pins to the correct keyboard strokes. Find the retrogame.cfg file in /home/pi/Adafruit-Retrogame-master and edit it using nano to configure and comment out any GPIO pins you do not want to map. Used the sample text below.

$  cd /home/pi/Adafruit-Retrogame-master

$  sudo nano retrogame.cfg

 

 

# Sample configuration file for retrogame.
# Really minimal syntax, typically two elements per line w/space delimiter:
# 1) a key name (from keyTable.h; shortened from /usr/include/linux/input.h).
# 2) a GPIO pin number; when grounded, will simulate corresponding keypress.
# Uses Broadcom pin numbers for GPIO.
# If first element is GND, the corresponding pin (or pins, multiple can be
# given) is a LOW-level output; an extra ground pin for connecting buttons.
# A '#' character indicates a comment to end-of-line.
# File can be edited "live," no need to restart retrogame!

# Here's a pin configuration for the PiGRRL 2 project:

LEFT       17  # Joypad left
# RIGHT     19  # Joypad right
UP        22  # Joypad up
# DOWN      26  # Joypad down
# LEFTCTRL  14  # 'A' button
# LEFTALT   15  # 'B' button
# Z         20  # 'X' button
# X         18  # 'Y' button
# SPACE      5  # 'Select' button
# ENTER      6  # 'Start' button
# A         12  # Left shoulder button
# S         13  # Right shoulder button
# ESC       17  # Exit ROM; PiTFT Button 1
# 1         22  # PiTFT Button 2
# 2         23  # PiTFT Button 3
# 3         27  # PiTFT Button 4


# For configurations with few buttons (e.g. Cupcade), a key can be followed
# by multiple pin numbers.  When those pins are all held for a few seconds,
# this will generate the corresponding keypress (e.g. ESC to exit ROM).
# Only ONE such combo is supported within the file though; later entries
# will override earlier.

 

 

Now save and exit using ctrl + X and then answer Y

 

Copy the config file to the /boot directory

Next we need to copy this file to the /boot directory

sudo cp retrogame.cfg /boot

 

If you are unable to copy the file to /boot because of permissions, you can drop into the root user and move it that way then exit back into the raspberry user.

$ sudo su

$  cp retrogame.cfg /boot

$  exit

 

Finishing Up

Now lets finish the Retrogame install by compliling the programs code.

$  cd /home/pi/Adafruit-Retrogame-master

$  make retrogame

 

Now move the Retrogame program to the usr/local/bin directory

$ sudo mv retrogame /usr/local/bin

 

Next, we need to set Retrogame to run at startup. To do this we need to edit the rc.local file

$  sudo nano /etc/rc.local

 

  Add the following line to the bottom of the file but above the final "exit 0" line. Do not forget the "&" at the end of the string.

/usr/local/bin/retrogame &

 

Finally we need to create a new rules file for RetroGame that will allow it to run more efficiently.

$  sudo nano /etc/udev/rules.d/10-retrogame.rules

 

And paste in the following line exactly as it is shown below.

 

SUBSYSTEM=="input", ATTRS{name}=="retrogame", ENV{ID_INPUT_KEYBOARD}="1"

Note for Pi 3 and Raspbian Jessie Users.

If you are building this project on a Raspberry Pi 3 running Raspbian Jessie, you will need to make a small change in Raspi-Config so that rc.local is called a little later in the boot stack. This is a known issue with Raspbian Jessie, and for those of us who like to use rc.local for running programs on boot, this is the best way to fix the issue.

 

To get rc.local working correctly in Raspbian Jessie Do The Following

$ sudo raspi-config

 

Then navigate to option #4 "Wait for Network at Boot" and set its option to "Yes"

 

Now reboot the Pi

$  sudo reboot

 

 

When the Pi reboots, you can test to see if our key-mapping worked by loading into Pixel and navigating to the office suite and opening a new writing document, and typing some characters with the keyboard. Then press the button connected to GPIO Pin 17 and you should see the cursor move back one space. Multiple presses should move it back even further. If this works, then you are set to go, and can move on to testing with Bfruit.

 

 

The Slot Machine Body

 

 

To be perfectly honest with everyone, I did not document the build process of the slot machine body other than a few photos here and there. This was because I knew I did not have enough time in this post to cover a 5-hour build step by step. I will share a few photos of the process though.

 

2016-10-23-17_56_50-New-notification.jpg

 

I started out by laying out all of the various cuts that were needed to get the desired shape I needed to build the face of the slot machine. Here you see me laying out where the Raspberry Pi 7-Inch Touch Screen will be located. I used a variety of different rulers, scales, and squares to build the machines body.

 

2016-10-23-18_05_31-New-notification.jpg

 

Here you can see me making the various cuts in the foam core that I laid out the machine’s face on. The reason I used foam-core was because it is very lightweight, cheap, and versatile for this kind of build. Since foam core is comprised of a piece of styrene foam that is sandwiched between two pieces of cardboard, it makes building angled 3-dimensional shapes fairly easy. In my case I needed the area where the screen sits to be recessed back into the body of the machine, and I was easily able to achieve this by making a series of “half cuts”. Half cuts are basically a cut that slices through one cardboard layer as well as the foam layer with the second layer of cardboard remaining uncut. This allows you to make very crisp, precise bends, which can be locked into place by filling the “V-Groove” that forms between the cut with hot glue and letting it set.

 

18 inches Alumicutter close up.jpg

 

You will also notice that I am using a special ruler that is designed for this kind of work. It’s called an Alumi Cutter, and is designed to keep your fingers safe, and the blade at 90-degrees when cutting foam core. I have several of these in different sizes, and can not even guess at how many times they have saved my fingers when cutting foam, fabric, and plastics with an exacto or box cutter. I highly recommend picking one up if you are going to be making a lot of straight cuts with a razor sharp knife.

 

2016-10-23-18_07_24-New-notification.jpg

 

Here is a good example of how half-cuts are so useful when working with foam core. I made a half-cut at the top of the recessed section, then flipped the foam core over, and made two half-cuts from the back. Then I made a final cut all the way through the bottom, and down each side. This allowed me to “bend” the foam core to create a 3D profile that I then locked into place with hot glue. You can also see the cutout for the touchscreen.

 

2016-10-23-18_16_50-New-notification.jpg

 

Here you can see that I mounted the two arcade buttons I scavenged from an old project. I wanted to use separate colors, but these are what I had to work with. If you are curious about what I am doing with that full sheet of foam core, I am just eyeballing the length I will need to cut the sides of this box at.

 

2016-10-23-18_17_47-New-notification.jpg

 

Once I got the sides cut and installed, I was read to mount the first layer of the front of the machine. I doubled up on this layer, as well as on the sides and top of the face because I will be cutting out slots the thickness of a single sheet to recess LED strips into the surface. A good hot glue gun is paramount to working with foam core and remaining sane. I personally like this model from Aleen’s because it has dual temperature settings, and several interchangeable tips for more precise control of the glue application process.

 

2016-10-22-14.43.jpg

 

With the basic shape of the slot machine finished, I moved on to reinforcing areas of the body that might experience wear or stress during my night party hopping. Here you can see that I have already covered most of the front face with a second sheet of foam core, and in this photo, I am readying the surface of the rest of the front with PVA glue for a second layer here as well.

 

2016-10-22-14.38.jpg

 

Here you can see the piece of foam core I cut out to reinforce the top and sides of the front face of the slot machine.

 

2016-10-21-00.161.jpg

 

When I reinforced the sides, I made them extra thick, and in doing so, they were not all the same height. To fix this problem, I took each stack out to my woodworking workshop and used my 60+ year old Rockwell jointer to true up one side.

 

2016-10-21-00.212.jpg

 

With one side now flat, straight, and square, I was able to true up the other side on my table saw. This did create a lot of fine foam dust, so if you attempt to do this yourself, wear a respirator.

 

 

Installing the Electronics

 

2016-10-21-23.35.jpg

 

With the reinforcements on, I used tape to hold everything down nice and tight while the glue dried. Surprisingly, archival-grade PVA glue dries incredibly fast. I think the total drying time was less than 10 minutes before I was able to remove the tape and move on with installing the LCD.

 

2016-10-21-23.43.jpg

 

I used more painters tape to hold the LCD in place, and then flipped the slot machine over so that I could secure the LCD to the body using hot glue.

 

2016-10-21-23.44.jpg

 

As you can see, the Raspberry Pi 7-Inch touch screen fits nice and flush when placed in a single sheet of 5mm foam core. I cut the hole out so that it would be a very tight fit on purpose, but I do recommend that you leave one edge a little wide so that there is some wiggle room in the event that you need to pull the screen back out. I also suggest when placing the screen in, you place the edge with the orange ribbon cable in first, so that they do not get pinched during the install.

 

2016-10-21-23.52.jpg

 

To hold the LCD in place, I used a generous amount of hot glue. I know what you are thinking: “That is going to be a pain to remove when the project is over.” but I have a easy solution for removing hot glue easily. You simply have to freeze it using a can of compressed air which you turn upside down. The glue becomes very brittle and it simply pops right off.

 

2016-10-22-00.17.jpg

 

With the screen in place, it was time to start adding in the rest of the hardware. Since I plan on reusing this hardware in a desktop arcade style slot machine, I chose to just glue in an old small breadboardsmall breadboard, and wire everything up temporarily. Here you can see that I have added in the Arduino nanoArduino nano, a barrel jack, and a 600uF 60V capacitor to balance out the input power for the NeoPixels as Adafruit suggest.

 

2016-10-22-00.27.jpg

 

Now we need to wire up the arcade switches, and to do that I crimped some female spade terminals onto the ends of some wire, and wired the switch into Normally Open mode. I really appreciate the higher quality arcade buttons that use these removable micro switches, as they make wiring things up very easy.

 

2016-10-22-00.47.jpg

 

I soldered common female dupont jumper wires to the other end of the switch wires and then connected them to their respective pins on the Raspberry Pi. See the button wiring schematic earlier in this post for more information on where those wires go.

 

finalschempyslots.jpg

 

Here is a diagram of the final circuit for the complete whole project.

 

2016-10-22-00.00.jpg

 

I know someone was wondering what the blue wire that was tied around the Pi 3’s standoffs was, and the answer is that it is a simple safety cable. While I am sure the hot glue will hold the screen in place just fine, a little insurance never hurt anyone.

 

 

Installing the NeoPixel Strip

 

2016-10-22-15.29.jpg

 

Now that the internal electronics are installed and hooked up, I needed to move onto installing the NeoPixel Strips on the external face of the slot machine. Early on I decided to recess the NeoPixels into the face of the machine, and the easiest way to do this is to make two parallel half-cuts in the foam core that is slightly wider than the LED strips. In my case, the strips were 1cm wide. Once the cuts have been made, you can simply pull out the thin strip you created, and you are left with a 5mm deep slot to place the LED strips in.

 

2016-10-22-15.35.jpg

 

One important thing to remember is that the dimensions your LED stips have to be spaces will be determined by where the solder points are on the end of each strip. It’s hard to see, but you can see that the last LED on the strip is about another strip’s width from the end where the solder points are. This allowed me to make the next cuts with the top stip overlapping the unplaced strip by about 1cm. This makes wiring the strips together very easy, and in my case, it worked out perfectly for the spacing that I needed for symmetry.

 

2016-10-22-15.06.jpg

 

With all of the slots cut out for the NeoPixel strips to recess into, it was time to begin wiring up the strips. Since NeoPixels need a 5V, Data, and GND line, I am using three of the wires from 4-Conductor RGB LED wiring. I buy this stuff on Ebay in 200’ quantities whenever I need a few feet. It’s cheaper than any other 4-conductor wire on the market. I do not have a nice pin crimper, so I just solder the male header pins straight onto the wires.

 

2016-10-22-15.10.jpg

 

Once the header pins have been soldered on, I use a pair of flush cutters to split them apart. If the pins will be located close to to other components or pins, I will sometimes heat shrink them at the connection, but in this case it was not needed.

 

2016-10-22-14.58.jpg

 

Next I needed to solder the wires to the actual NeoPixel strip and that is pretty straight forward. One tip I can offer would be to not keep the heat on each pad for very long. I have soldered hundreds of these strips over the last few years, and have seen many joint failures from the pad lifting due to too much prolonged heat. I like to pre-tin the pad, and the wires, then use as little heat as possible to make the connection.

 

2016-10-22-15.00.jpg

 

One other quick tip I can offer is to use the grid lines on a cutting mat to quickly and easily cut heat shrink tubing to precise inch long sizes. On most cutting mats here in the US, the grid is based on 1-inch divisions.

 

2016-10-22-15.02.jpg

 

One lesson I learned after installing hundreds of LED strips in different haunted houses is that their weakest point is where the solder connection is. It does not take very much stress at all to rip a solder pad from the strip. To alleviate this, I add two heat shrink tubes to the wire, shrinking one overtop of the other.

 

2016-10-22-15.03.jpg

 

Then I slide a third heat shrink tube over the LED strip by about ½-inch. This creates a very nice stress relief, and protects the solder points from shorting out. It does use a little more heat shrink, but it is worth it in the end.

 

2016-10-22-17.22.jpg

 

One of the most tedious parts of this project was soldering up the NeoPixel strips into squares. To get the angle right, and ensure proper spacing between strips, I used tape to affix them to a scrap piece of foam core, then soldered short wires from point to point. Note that I do have these two strips positioned incorrectly. I have the Digital Out pins on each strip facing each other. The bottom, horizontal strip, should be flipped around so that the Digital In pin can be connected to the Digital Out pin.

 

2016-10-22-16.39.jpg

 

Once each corner joint was complete, I potted the corner using hot glue. This acts as a strain relief, and helps keep the corner square.

 

2016-10-22-18.47.jpg

 

With all of the NeoPixel strips built it was as simple as removing their adhesive tape’s backing and pushing them into place.

 

finalschempyslots.jpg

Now connect the NeoPixel strips to the Arduino like so.

 

2016-10-22-19.16.jpg

 

A quick test using the Rainbow Chase function showed that they are all working. Both strips run from the same pin, so the animation is the same, but I have the direction they chase in reversed by the way I mounted the smaller square.

 

 

Building the Slot Machine Arm Sleeve

 

2016-10-23-21_40_38-New-notification.jpg

 

You might remember from my first post that I purchased a few yards of this shiney silver metallic stretch fabric with the intention of using it as a sleeve on my left arm. This combined with the tilt sensor, and a cheap halloween childrens flashlight will create the pull arm for the slot machine. I will be the first to admit that sewing fabric together is not one of my strong abilities, much less sewing it so that it conformed to my arm. So I enlisted the help of my girlfriend who is a professional fiber artist, and general all around maker. Using her sewing machine, and seamstress skills, she quickly had the sleeve crafted, and there was enough material left over for her to make jokes about sewing me a pair of short shorts together….

 

IMG_9630.jpg

 

I did not get many photos of her sewing the sleeve together because I was busy working on the rest of the project, but here it is in all of its glory. The sleeve fits over my arm quite well, and the pumpkin flashlight is fastened into place. The sleeve will go on my arm before I put a black t-shirt on, thus hiding its open end. So let's look at how I built the electronics into this piece.

 

2016-10-21-22.38.jpg

 

As I mentioned earlier, I will be using a simple tilt switch to control the spin of the slots wheels. If you are unfamiliar, a tilt switch consist of a plastic tube that is encased in a metal housing. Inside the tube is a small steel ball. Then the tilt switch is tilted down, the ball makes contact with two contacts, and completes the circuit. Installing the tilt switch was as simple as soldering two wires to its leads, and adding heat shrink.

 

2016-10-21-23.15.jpg

 

On the other end of the wires I soldered on two Dupont female jumper ends. These will plug directly into the Raspberry Pi 3’s GPIO Pins.

 

2016-10-21-22.17.jpg

 

The pumpkin flashlight originally came with a very dim incandescent christmas light bulb, and was powered by two AA batteries. All of that had to come out, and I added an 8mm NeoPixel LED so that the pumpkin could still light up. I did have to drill the hole out, and I just happened to have a 7mm drill bit laying around. I was able to wiggle it a little in the hole and that widened things enough for the 8mm LED to fit snugly inside.

 

2016-10-21-23.04.jpg

 

I forgot to take photos of the 8mm NeoPixel being wired up, but I did remember to take a photo of it hot glued into place.

 

2016-10-21-23.24.jpg

 

On the other end of the Pixel wires, I added three more DuPont female jumper ends so they could be plugged into the breadboard using some spare male header pins I had laying around.

 

Finishing Up

IMG_9634.jpg

 

I absolutely ran out of time to install the Bluetooth speaker the way I wanted to, so I simply hot glued a stack of foam core together, then glued it to the front panel from behind. This gave me a ledge to place the speaker. A rough hole was then cut out, to allow the sound to pass through. Don’t worry though, I covered this ugly hole up with something.

 

IMG_9635.jpg

 

One of the final parts of the build was to fabricate a solution that would easily hang the slot machine from my shoulders. A good friend of mine is a professional cos-player, and he suggested that I build a shoulder harness out of PVC pipe, and that is exactly what I did. This used about 5-feet of PVC, 2 elbows, and two caps. I mounted each arm to the slot machine by building two stacks of foam core, then drilling a ⅞-inch hole in each with a Forstner bit. I then hot glued them into the holes. This setup is surprisingly comfortable, even with both battery packs inside the slot machine, and it holds the machine at the perfect height for people to play while I am walking around.

 

IMG_9641.jpg

 

Here is a quick shot of how I am powering the Raspberry Pi, the Touch Screen, and the Arduino Nano / Neo Pixels. The striped red USB cable powers the screen, via a 2.4A port on a battery bank, while the black USB cable powers the Raspberry Pi 3 from a 2.4A port on a second battery bank. The solid red USB cable provides 5V 1.5A to the breadboard which powers the Arduino Nano, and the NeoPixels.

 

IMG_9640.jpg

 

This is the two power banks I am using to power the costume. The KMASHI is a 16,000mAh 2.4A / 1.5A battery bank while the Royal is a 10,000mAh 2.4A battery bank. I picked both up from Amazon, and I think I spent $15 on the KMASHI, and $10 on the Royal.

 

IMG_9636.jpg

 

 

Finally we have a shot of the front of the slot machine after some decorations have been added. I originally planned on designing custom graphics for the machine, but as I mentioned at the beginning of this post, ran into printing issues. So I did the next best thing, and wrapped it in silver wrapping paper, and printed some logos that I then mounted to foam core and cut out. Both of these are glued to the slot machine body with 1cm standoffs behind. I am using the Halloween Pi logo to cover the ugly hole I cut for the speaker.

 

Running The Bfruit Program

 

Now that everything is buttoned up and connected, we can run the Bfruit Python script. There are two ways to quickly do this, but before you run the scrip, you will need to enable the built-in Bluetooth by clicking on it in the top navigation bar in PIXEL. Then to pair with the Bluetooth Speaker, you will need to right click on the audio icon, and select the speaker you want to pair with. If you do not want the games audio to play, then you can ignore this step.

 

Running the program via CMD

If you are remotely connected to the Raspberry Pi via SSH, then you can simply navigate to the Bfruit directory and then use the following command to run the program on the Pi and the script will run in full screen mode on the touchscreen.

 

$ cd /home/pi/Desktop/bfruit-0.1.2

$ sudo python bfruit.py

 

Running the program from inside the PIXEL GUI

If you are not remotely connected to the Raspberry Pi 3 via SSH and want to run the program, you will need to take the following steps to use IDLE to run the script.

 

nIXUAwx.jpg

Locate the bfruit folder in the directory you saved it to. I placed mine on the desktop for ease of access.

 

eZm5qLH.jpg

Then double click on the bfruit.py scrip, and the program will open in IDLE.

 

u5s4wLL.jpg

Once the script is open in IDLE, you can make any edits to the code that you wish, then navigate to the Run menu at the top of IDLE, and click on the Run Module option that is available. This will run the Python script. Unfortunately I was unable to take a screen shot of this as there is a bug in the built in PIXEL's built in screen shot utility that prevents screen shots of open menus.

 

wdFsM5p.jpg

 

When the Python script first runs, a quick warning window will pop up letting us know that GPIO37 is already in use, but you can ignore this, and it will not affect our program at all.

 

t327RiY.jpg

 

When bfruit loads, it will open in a windowed screen. You will need to navigate to its settings menu and select the full screen option so that it takes up the entire touchscreen.

 

FmtDDdD.jpg

 

Once you have selected the full screen option, simply select the back to main menu option to return to the main menu. From there, select new game, and enjoy the fun! I apologize for no screen shot of the actual game itself which is due to another bug that prevents PIXEL's built-in screen shot utility from taking screen shots if a Python Program is running in full screen mode. I have reported these bugs to the developers to see if they can be fixed.

 

 

 

All in all, I am quite happy with how the hardware turned out for this project, and a little disappointed with my execution of the theming. I would have looked so much better with the graphics I wanted to print, but honestly it is what it is, and being able to improvise on the fly is what being a maker is all about. If I would have had two more weeks to build this, I may have scrapped the whole foam core idea and built the whole thing from wood, but I can sit back and play the what-if game all night. In the end, it was a fun project, and my friends are already excited for me to wear it to their Halloween parties. Note that the video above was created after being awake for 39-hours straight. I will be replacing it with a better video in the coming days.

 

I want to take a moment to answer a few questions that I have gotten via comments, and messages.

 

Q:  Will you provide an image of the OS so that anyone could replicate this project without having to modify code, and use the terminal to install packages?

A:  No image will be made of this project. I feel that creating an image of any of my tutorial projects causes them to lose some of their educational value. If you follow this tutorial, and download the bfruit program from its original source, then modify it's python code using my code examples, you can have this project up and running in just a few hours.

 

Q: Are there design files available for the slot machine costume?

A: No. Design files were not produced because I built the slot machine body on the fly. I had a general idea of how I wanted it to look, and I simply built it using the plans that were inside my head.

 

Q: Why are the modified slot machine icons not available in the GitHub repo for this project?

A: The images I used for the slot machine's spinner wheels belong to different companies, and while I am sure they would not mind me using them in this project, I am sure they would not like me sharing them with the world on my GitHub. It's more of a "I don't want to get an angry email" kind of thing. If you want to create your own icons for your version of this project, you simply need to resize the images you would like to use to 128px X 128px, and make them a transparent .PNG file.

 

Q: If you were to build this project again, what would be the one thing you did differently?

A: I would definitely add more architectural features to the slot machine body, and then wrap the entire thing in custom designed graphics.

 

Q: When I try to run the bfruit.py program, it seems to be missing a lot of different files.

A: You have to download the original Bfruit program files from the source forge link that I posted in part two of this project. I also have the required files in a zip file on my Github.

 

 

I want to thank Element14, Raspberry Pi, and all of the staff at Element14 who gave me the opportunity to build this project. If you have not yet read the first two parts to this project, then head over to the links below to get caught up! That is going to wrap up this project for me. I will post an updated video with some footage of people playing the game at some of the parties I will be attending, but do not look for those until after Halloween. Thanks for taking the time to read this project, and I will see you on my next post! Until then remember to Hack The World, and Make Awesome!

 

Check Out The Full Project!

  1. Raspberry PySlots: The Costume - Introduction
  2. Raspberry PySlots: The Costume - Hardware, Software, and Pretty Lights!
  3. Raspberry PySlots: The Costume - The Slot Machine, NeoPixels, Pull Arm, And Finishing Things Up

Filter Blog

By date: By tag: