Saturday, 10 May 2014

HammerPong #3: 7-Segment Display Made Out Of Fairground Lights



This is the third post in my diary of building my "Hammer Pong" game. 

After a visit with the kids to a local fun fair a couple of weeks ago, I thought some fairground-style lights would look good to jazz up the fascia of my game! I started looking on eBay for used ones, but eventually
decided to buy some new ones.

Loads of LED stuff :o)
At first I was thinking of using a row of individual lights to mark the score, but then I got this crazy idea of making a giant 2 digit, seven segment display!

First of all I needed some kind of board to attach the display to for a proof of concept. My neighbour was throwing out a big sheet of cardboard from a packing case, so I was happy to take if off his hands.

These lights use LED modules in place of filament bulbs, which give a nice clean white light behind the coloured plastic lenses. The LED modules run on 24V and are rated for 1.2W which means they only need 50mA current, which isn't too challenging to switch. 
Bits of a light
I decided to use 3 light units for each segment of my display, so for each segment I'd be switching 150mA at 24V. For this I went for TIP120 Darlington power transistors as I had a few of them lying about and I know them pretty well. 

I wanted to keep my options open for PWM fading and thought that if I used FETs I might need additional FET driver ICs to PWM switch the FETs. Anyway, a bit of experimenting on breadboard shows that a TIP120 could switch and PWM fade a set of 3 lights, wired in parallel, without breaking a sweat. For that test I connected the base of the TIP120 to a PWM pin of an Arduino Uno, via a 1k Ohm resistor. The TIP120 switches on the low side, so my lights were wired to the +24V line and their GND line was connected to the TIP120 collector, with the emitter connected to the GND of the 24V supply. Applying a voltage to the base makes the lights come on.

Now, I don't want to have to use an Arduino pin for every one of my display segments, so I decided to use a 74HC595 shift register to control the lights for the seven segment display. One nice feature of the 595 is the Output Enable pin. Usually I hard wire this to ground to keep the outputs enabled, but here I have it connected to a PWM pin on the Arduino. I thought this would let me fade the brightness of the entire 7 segment display and it seems to work superbly - just need to remember it is an active low signal, so analogWrite(0) is full on and analogWrite(255) is full off.

Each output of the 74HC595 is connected via a 1K resistor to a TIP120. Add a bit of code to load the shift register, define the numeric digits are we're ready to roll with a 7 segment display test!
Shift register/TIP120 driver board

The lights use a screw-on base which forces some sharp terminals through the insulation of the cabling. This makes it nice and quick to wire up without soldering. I used a common 24V supply rail and wired together the ground connections of the three lights on each segment, then connected to the appropriate TIP120 collector terminal. A quick Arduino sketch and I have digits counting, with a bit of a fade in and out around a change of digit.
Quick'n'dirty build

I think I made my digit a bit tall for it's width, but the visual effect seems to work. Now I just need to make sure I have enough space on the fascia of my game for 2 of these - they are quite big! I hope they aren't too big to read properly from a playing distance... hmmmm.... only one way to find out.
In action

1 comment: