Slot Machine

by arieltorrensjames in Circuits > Arduino

86 Views, 1 Favorites, 0 Comments

Slot Machine

IMG_0569.jpg
IMG_0568.jpg

A slot machine made from an Arduino Uno board capable to play. Simply scan any RFID chip and play until you win! There are two red LED lights indicating whether you lost. Additionally, there is sound when the machine is being spun and when you lose.

Supplies

71z22cRPeeL._AC_UF894,1000_QL80_.jpg
56T0249-40.jpg
71wuC+BKB4L.jpg
0586325p.jpg
71LMDUcKr+L._AC_SX679_.jpg
7128edyThtL._AC_SX679_.jpg
piezo-buzzer-01-800x800.jpg
red-led-350x203.jpg
download.jpg
518arO7-WcL._AC_UF894,1000_QL80_.jpg
81HpLdwnvdL.jpg
61RwvqTTgGL.jpg

Technical Supplies

  1. Ardunio Uno with cord
  2. Breadboard
  3. RC522 kit with card
  4. Soldering gun
  5. Electrical solder wire (we used lead free 0.062 inch)
  6. I2C LCD 1602 Module
  7. Buzzer
  8. 2 Red LEDs
  9. 20 wires, 8 female to male, 12 male to male

Decorations & Assembly

  1. Black foam board
  2. Coloured paper
  3. Glue gun and glue sticks
  4. Beads
  5. Coloured markers
  6. Exacto Knife (or scissors)
  7. Tape

Software

  1. Preferably using Arduino IDE

Solder RC522

IMG_6559.jpg
IMG_6560.jpg

Firstly, we want to solder our RC522 so it can be put into our breadboard. Insert either the angled or straight pins inside the RC522 and place both onto a stable surface. The pins should be sticking out with the back of the RC522 facing up. Plug in the soldering iron till it is hot enough to melt the wire. Hold the solder wire in one hand pointing the tip towards a pin. With the other hand, point the tip of the iron towards the wire.Touch the iron to the wire to melt a small dot onto a singular pin. Repeat for each pin. The solder should create a smooth "triangular" shape around the pin. If two or more pins are connected by solder, use the iron to melt the solder from between the pins and clean the tip of the iron each time (you can use a damp sponge). Wait for the solder to solidify and test the RC522. If it does not work, look for connected pins and retry soldering.If you need help practicing before soldering, you can use coins to practice on. Above is a picture shown of us doing that.The other picture shown is what your RC522 should look like when it is soldered.

Create the Circuit Board

tinkercadsketch.png

Secondly, we want to set up our Ardunio Uno board. We connect our wires as seen in the picture above. We also connect our buzzer and our LCD screen and two red LEDs as indicated.

Making the Box

IMG_0499.jpg
IMG_0534.jpg
IMG_0538.jpg
IMG_0585.jpg
IMG_0533.jpg
image.png
IMG_0584.jpg
IMG_0586.jpg

Third, we want to make the container for the slot machine. In order to do this, we want to create a 3D box made out of foam board. You can adjust the size you need depending on how big your breadboard and Arduino are. Above is a picture of what that would look like trying to fit the breadboard and Arduino as close together as possible.


You will need the following:

Main box:

  1. Two similar pieces for the front and back
  2. Two similar pieces for the top and bottom
  3. Two similar pieces for the left and right sides

*Please refer to picture 6 with all the required cutout parts.

Tinier Box for the front piece:

  1. Two similar long slanted rectangular pieces
  2. One big square
  3. One top long rectangular

*Please refer to picture 6 with all the required cutout parts.

The front, back, and top pieces will be modified.

Cutouts for Front Pieces:

  1. For your first cutout, you will want to measure your LCD screen and make a cut out on your front piece. Make sure your cutout is not too big or else your LCD screen won't fit nice and snug. Example picture 3 is what this cutout should look like.
  2. Your second cutout on your front piece should resemble a square this will be in the shape of your RC522. This cutout is so your RC522 will be able to be scanned easier. Example picture 3 is what this cutout should look like.

Cutouts for Back Pieces:

  1. Cut out a little square with your exacto knife so you can fit the cord through this hole. This cutout will allow your box to have power. Picture four indicates this cutout.

Cutouts for Top Piece:

  1. Cut two small little holes on either side of your top piece. This will be how you string your LEDs out of your box. See pictures 6 and 8 for reference for these cuts.

Modification for Front Piece:

In order to make the front look like a slot machine, we will fit another rectangle onto the front piece. Picture five indicates what this piece will look like. Also refer to picture 6 for the full list of parts. This tinier box can be modified with how big you want it to fit on your front piece.

Box Creation:

From these pieces, you will create a rectangular box. Using your hot glue gun, glue together the sides of the box together to the bottom piece. Once your right and left side are glued on, glue the front piece on. Make sure your breadboard can fit slightly underneath your front piece. It will slightly stick out and thats okay because we willl cover it with the tinier box we make later. For the back piece, DO NOT glue anything. You want this piece to be openable to get at the Arduino and breadboard inside of your box. This should fit together to create a rectangular box. If your bread board or Arduino slides around, use a little tape to secure it to the bottom piece.

For the smaller tinier box on the front piece, glue your slanted pieces the same width away as your long skinny rectangle. This should fit together and look like a slanted rectangular box without a bottom. See picture 5 for reference.This piece should cover your sticking out breadboard. We want to make your RC522 as close to the foam board as possible in order to be scanned. Make sure it works by testing the code below first.


You should have two little cut outs on your top piece. This is where you will stick your LEDs out from. Use a little tape if the LEDs wont stay put.

Decoration

IMG_0536.jpg

For this step, you can use any decorations you want to make your box look like a slot machine. For ours specifically, we used beads on the front piece, foam on the outside edges, and coloured paper to make the outside pop. We also decided to add a cut out to the tinier box to make it look like a coin dispense system. Add a striking title to your slot machine with beads or other forms of letters. Add a lever made out of foam board and a bead and you are set.

For the card, you can add a piece of printed paper with fake credit card information to make it look like you are scanning a real credit card.

Setting Up the Code

We have to install libraries to make the code work. Download these libraries via the Arduino IDE libraries section:

  • Liquid crystal
  • MFRC522
  • Easy_MFRC522

Download symbols.h for the custom made symbols. Add to your libraries folder. Run the code provided below and your slot machine is up and working!