I often find myself using seven segment displays in my projects, as they possess a retro look. Not only do i like using them but i also like making them. Through my encounters with seven segment displays i have learnt the many ways to control them with Arduino.
- Controlling each LED separately (extremely inefficient, with 4 displays it uses 28 outputs)
- Multiplexing (Efficient, but annoying to code)
- Shift registers (Easy to code, but uses a shift register per display)
These are probably the ones most people are familiar with, I personally used the shift register method until i found the MM74C925N. One day whilst making a purchase of LED's from my favourite LED supplier (led sales), I noticed they were selling a chip labeled as a "4-digit counter with multiplexed 7-segment display output drivers" this immediately sparked my interest and I bought 4 of them considering they were only $1.6 AUD. When I received them I got on my computer and looked up some tutorials on how to use them with Arduino, but I found nothing. I typed the chips name into the search engine but all i found was data sheets. Finally after reading a couple data sheets and looking at the schematic of a project some one had built 30 yrs ago, I worked out how i could use the MM74C925N with Arduino. This is how!!
If you just wan't to find out how to use the MM74C925N skip this step.
As a high school student, and not an electrical engineer, the data sheets I read didn't make a lot of sense, but what i did gather from them was two things. Firstly the pin outs on the chip and secondly that it should be used with a common cathode seven segment display.
After searching google images I found a schematic of a random number generator. The first thing i noticed was that the clock pin was attached to an output pin on a 555 timer, from previous projects i remembered the 555 timers output an on and off signal. After looking a little more i discovered that for the displays to work properly there common cathodes must be wired to general purpose NPN transistors, controlled by the chip.
From this gathered knowledge I began to experiment. I wired everything up on my breadbord like this;
A segments - A on the chip (pin 13)
B segments - B on the chip (pin 14)
C segments - C on the chip (pin 15)
D segments - D on the chip (pin 1)
E segments - E on the chip (pin 2)
F segments - F on the chip - (pin 3)
G segments - G on the chip - (pin 4)
Base of Transistor 1 - outA on chip (pin 6)
Base of Transistor 2 - outB on chip (pin 7)
Base of Transistor 3 - outC on chip - (pin 9)
Base of Transistor 4 - outD on chip - pin 10
Latch pin (Pin 5) - GND
Reset pin (Pin 12) - GND
Clock pin (Pin 11) - Arduino Output Pin 13
GND (pin 8) - GND
Vcc (pin 16) - 5v+
The Collectors of all the transistors were attached to the common cathodes of each individual display and the emitters where grounded.
I started by programming the Arduino with a blink sketch to simulate the 555 and what I saw was that the display began to count. By connecting the reset pin to 5v the display would go back to zero and by connecting the latch pin to 5v the display hold its value, until the latch pin was grounded again and it would show the changes. After a bit of work i set up a library of my own to program the Arduino to use the MM74C925N in an easy way.