How To Make A Raspberry Pi Slot Machine

  

My favorite slot machine of all time is the WMS 550 Hot Toppings slot machine. Along side IGT's Texas Tea I couldn't tell you how many hours and dollars I wasted on these two. I looked into cloning the software and running it on the Raspberry Pi, but that didn't seem possible.

How I made a slot machine using the Raspberry Pi and Python.

Recently I made a slot machine with a Raspberry Pi, LEDs, a homemade coin slot and Python.

Part 1: The LEDs

Firstly I connected the LEDs to my Raspberry Pi. You’ll need 9 of them, 3 of each color.

Here are which GPIO pins the LEDs are connected to:

How To Make A Raspberry Pi Slot Machines

R1 > 13
Y1 > 16
G1 > 26

R2 > 22
Y2 > 23
G2 > 27

R3 > 4
Y3 > 17
G3 > 24

Part 2: The Coin Slot

Then I made the coin slot – I used some lego technic to make a hole the size of a 2p coin and then put a copper strip on each side. I then attached ground to one strip and pin 18 to another, and coded it the same as I would a push button. Tin foil will also work.

EDIT: The black cables going from the LEDs to the ground strip in the diagram should be 470 ohm resistors, not cables.

Part 3: The code

As you can see, you can play sound effects is they win or lose on the lines p=subprocess.Popen(['mpg123', 'Winner.mp3']). However, you will need to have mpg123 installed by typing sudo apt-get install mpg123 into the terminal. Then you will have to download two sound effect audio files (one for winner, one for loser) and replace ‘Winner.mp3’ and ‘Loser.mp3’ with their locations. Also, remember to plug a speaker into the audio jack.

Part 4: Decorating

I placed everything inside a cardboard box and made holes for the LEDs to be visible. I also placed a plastic container underneath the coin slot to collect the coins. Lastly, I glued some pieces of paper to the box with instructions.

If you have any questions, feel free to ask in the comments!

A DIY Raspberry Pi vending machine has been created by Christopher Natan using a little Arduino programming and hardware. Full instructions on how the project is created have kindly been published to the Hackster.io website available via the link below.

The Raspberry Pi vending machine is capable of sending Top-up to any prepaid mobile (Globe, Smart, Sun) networks and can also serve as a wireless hotspot. The project uses a number of programming languages including Android Java, CakePHP Framework, PHP, MySQL, nGinx, Python3, NodeJs and Shell Script.

Hardware used in the build include Raspberry Pi 3, Coin Acceptor, APEX 7000 Bill Acceptor, Channel Relay, OptoCoupler, Android, Modem Router that supports flashing to OpenWRT firmware and a 10 inch Android Tablet which has been rooted and only allows one application to be run. Check out the video below to learn more about the project and see it in action.

Source: Hackster.io

Filed Under: DIY Projects, Top News

Latest Geeky Gadgets Deals


Best Uses For Raspberry Pi

Disclosure: Raspberry

Make A Raspberry Pi Computer

Some of our articles include affiliate links. If you buy something through one of these links, Geeky Gadgets may earn an affiliate commission. Learn more.