Home Creators Posts Import Register Favorites Logout

Content

Almost a year ago, I did a post about using 7 segment LED displays, demonstrating the common 4-digit modules based on the MAX7219 or TM1637 chips. They're easy to use, but when you're making a big timer display that counts down to impending doom, you might want something a little bit more..... imposing!

Fortunately, one of the parts I recently salvaged from a deceased fruit machine were these lovely chunky 1.8" LED display units. Each display is separate, but they interlock together enabling you to create a multi-digit display of any arbitrary length you want. They require 5.55Vf, so you can't power them directly by just writing a HIGH signal from an Arduino GPIO pins. Instead, I use two transistor array chips:

- The first is a UDN2981 which *sources* current into the anode segments (also called a "high-side" transistor). When a small current is received on any of the 8 input pins, it allows a larger current from a separate 12V supply to flow on the corresponding output pin.

- The second a ULN2803, which *sinks* current through the cathode of the LEDs back to ground. When a small current is received on one of the 8 input pins, the corresponding output pin is connected through to ground. 

Both of these transitor chips have 8 outputs, which means that their pins can be conveniently set by passing a single 8-bit value into a shift register. And, because two (or more) 74HC595 shift registers can be chained together, that means you can do all this using only 3 pins on the Arduino. Phew!

This is a free project which is available to all - not just my lovely Patreons - so I've put up all the code on GitHub, and you can find it here: https://github.com/playfultechnology/arduino-fruitmachine

Please ask if you have any questions!

Files

Arduino Fruit Machine - LED Displays

I bought an old fruit machine (slot machine) from eBay and stripped it down into separate components. In this video, I'll show you how to use the 1.8" 7-segment common cathode LED displays (http://www.farnell.com/datasheets/99300.pdf), which were used to display the cash payout value at the top of the machine. Using a handful of cheap components, it takes just three GPIO pins on the Arduino to control these LEDs to display any value you want. These are nice big, bright displays but, since they have a forward voltage of 5.55V, they can't be powered by simply writing a digitalWrite(HIGH) from an Arduino pin. Instead, I'll be using two transistor array chips: - A UDN2981 will act as a current *source* to the anodes of the appropriate segments - A ULN2803 will provide a current *sink* from the common cathodes of each display The outputs on these two chips will be set by two, daisy-chained 74HC595 shift registers. Using just three pins on the Arduino (latch, clock, and data), a single byte value will be sent to each register, where the '1' bits in the first byte determine the display cathodes to connect to ground, and the '1' bits in the second byte determine the segment anodes to connect to the 12V current source. By iterating over the displays quickly and setting the appropriate segments on/off in sequence ("multiplexing"), persistence of vision will make it possible to display any value across the displays. Download the wiring diagram and the Arduino code from: https://github.com/playfultechnology/arduino-fruitmachine For more projects, please check out https://www.patreon.com/playfultech

Comments

No comments found for this post.