Arduino Uno Slot Machine

Last time I showed You how to control 1 digit 7 segment LED display with Arduino. This time it’s not 1, but 4 digits. To connect 1 digit to Arduino we had to use 8 ports, so to connect 4 digits we need to have 4×8=32? Not necessary. Where is a way to use much less ports, it’s called multiplexing. Using multiplexing at one time only one digit is active(e.g. for 2ms). All digits is turned on is serial, but because human’s eye is inert we have illusion, that all digits are lighting at same time.

Arduino slot machine

The coin acceptor works best on a real serial port with an Arduino, not the “SoftwareSerial” library. So I can have debugging serial and dedicated coin serial. While the front glass is from a slot machine, my “lucky larry” is simply “lucky” when you feed him. The two displays show different information. In the slot machine, each 'reel' contains 10 symbols. #define REELSYMBOLS 10 #define TOTALREELSYMBOLROWS (REELSYMBOLS. 8) const byte reelTOTALREELSYMBOLROWS =. The Arduino UNO was replaced with a ATMega328 DIL chip and mounted on the back of the board by using a DIL 28 pin IC socket and flattening out its pins. All capacitors are.

As You can see form schematic bellow with multiplexing implemented we required only 4 additional ports compared to 1 digit circuit, total – 12.

Because at the same time only one digit will be on All 4 digits segments inputs are connected together. By connecting digits common cathodes to ground we are controlling which digit shall be turned on. Atmega 1280 µCPU port can drain(receive) maximum 40 mA current. If all one digits segments are on, we are having 20×8= 160 mA that is to much, so we can’t to connect common cathodes directly to Arduino ports. Therefore I have used BC547 NPN transistors as switches. Transistor is opened, when positive voltage is applied at the base.

Let’s see the code.

It’s modified version of earlier commented code, so I’m lazy to explain some of the code again.

Modified code have definition of ports that(with transistors) are controlling digits.

#define GND1 52
#define GND2 53
#define GND3 50
#define GND4 51

And they are outputs

pinMode(GND1, OUTPUT);
pinMode(GND2, OUTPUT);

pinMode(GND3, OUTPUT);
pinMode(GND4, OUTPUT);

There new function to display all 4 digits. You can see it have 4 parts, to display 4 digits.

My new target is to make digital clock of these displays using timer for accuracy.

Slot

And full code goes here:

I ordered the Arduino Uno from Robotshop Inc. online. I also ordered the Getting Started with Arduino book but when I noticed that the order was “pending” for a few days (and I had order Express Post 2 Day Shipping), I called their Customer Service line.

Apparently, the book was on back order so I cancelled that part of the order. Now I’m glad that I did because I found what looks to be all of the necessary “Getting Started” information online, for FREE at Arduino’s website.

By the way, the people at Robotshop Inc. were amazing. It was my own fault that I didn’t notice the book was on back-order when I placed the original order (not theirs) and they made the change to my order right away over the phone. So I want to give a shout out to them and publicly thank them for having excellent customer service.

So, today my Arduino Uno arrived by ExpressPost! Oh, the excitement! I felt a little like a kid at Christmas… I have to admit it was really exciting getting that package and opening it up. Now, the BIG surprise?! I was astonished by this…

The Arduino Uno is TINY compared to how I had envisioned it in my mind. I guess by comparison to some of the other Arduino boards, I thought it would be bigger. Check out the different models here. That Nano must be really small because my Arduino Uno can easily fit inside a small package of cigarettes container. In fact you could stuff two of them in a king size pack of cigarettes container.

Here’s the Arduino Uno:

Arduino Uno Slot Machine

Arduino Uno Slot Machine

Arduino Slot Machine

Arduino Uno (Back)

Arduino Uno Chip

Do I care? Heck no! The fact that it’s so small makes it so much more potentially useful for a variety of applications. I now see how people are able to use multiple boards in their projects!

Arduino Uno Slot Machines

Now… to install the FREE software for Windows 7 and start learning how to program it!