High-voltage seven segment LED display driver with SPI interface
Seven segment LED displays are known to be resource and power hungry. But because they are visually so charming and readable from a far viewing distance and at a much wider viewing angle as compared to any other electronic displays, they are still hugely popular. The required number of I/O pins to drive the LED segments can be reduced significantly by using an additional dedicated hardware. For example, the MAXIM’s MAX7219 device allows you to interface 8 pieces of seven segment LED modules using only 3 I/O pins of Arduino or any other microcontroller. You can find details on the use of MAX7219 to drive seven segment LED displays in my previous projects 4-digit serial seven segment LED display (SPI7SEGDISP4.40-1R), 8-digit serial seven segment LED display (SPI7SEGDISP8.56-1R), and double-row 4-digit seven segment LED display (SPI7SEGDISP8.56-2R). Since MAX7219 operates at 5V, its output can drive LED segments with forward voltage less than 5V. I have successfully used MAX7219 IC with 1.5″ seven segment LED modules that carry two regular LEDs in series per segment. Inside larger seven segment LED modules, the display segments are made of multiple LEDs connected in series and parallel to provide sufficient light to illuminate the segment, and as such they require a higher forward voltage and more current to operate. Recently, I have designed this display driver board that can be used as a bridge in between larger seven segment LED displays (with segment forward voltage up to 24V) and a 5V microcontroller. On its input side is MAX7219 which receives the display data from the host microcontroller through a 3-wire SPI bus.
This project uses the MAX7219 device on the input side to receive the display data from a host microcontroller through an SPI interface. The MAX7219 outputs cannot drive LED segments with forward-voltage above 5V. Therefore, an additional circuit is required to translate the TTL output levels of MAX7219 into appropriate high voltage signals required to operate the large seven segment LED modules. To illustrate I am using eight 5″ displays which require about 14V to drive segments ‘a’ through ‘g’ (each consists of two rows of 7 standard LEDs), and 6V to drive the DP segment (consists of 3 LEDs). The following figure shows the arrangement of multiple LEDs inside the display segments of the 5″ seven segment module I am using.
The goal of this project is to design a board that provides
- a TTL SPI interface of MAX7219 to input display data
- outputs functionally compatible with MAX7219 outputs but with an enhanced capability to drive high-voltage (HV) LED display modules (up to 24V)
- a regulated +5V for TTL logic chips and a variable HV source on-board for the LED modules.
The following block diagram explains the overall functionality of the board. The power supply unit provides a regulated +5V to power the logic chips, and a variable high voltage (HV) required to drive the LED segments. The value of HV can be adjusted as needed through a potentiometer. On the input side is MAX7219 chip which receives display data from a host microcontroller through a serial interface. In order to find more detail about the MAX7219 interface, visit MAX7219 based seven segment LED display. The output segment driver pins of MAX7219 are translated to high voltage signal lines using UDN2981A, which is a 8-channel source driver. In order to prevent the DIG0-DIG7 sink outputs of MAX7219 from any possible damage (or malfunctioning) due to high voltage signals applied to LED segments, external sink lines are created using ULN2803. Since the DIG0-DIG7 lines of MAX7219 are active low and ULN2803 inputs are active high, an eight channel logic inverter (74HC540) is used in between to make the two sets of signal lines compatible. Imagine a situation when outputs of UDN2981A (which is set by varying HV) is higher than the forward voltage of LED segments by more than 5V. If DIG0-DIG7 sinks are used directly without the arrangement discussed above, then no matter what is the output state of DIG0-DIG7, the LED segments will always be on. So the use of 74HC540 and ULN2803 as external sinks prevents this malfunctioning.
Note: Remember that the maximum sink current allowed by ULN2803 is 500mA per channel, which means the sum of individual segment current per digit should not exceed this value.
Following circuit diagrams are designed to fulfill the functional requirements of the block diagram discussed above. The power supply unit uses LM317 to derive an adjustable HV power supply. According to the datasheet, LM317 output is adjustable over 1.2-37V. Obviously, the input must be higher than 37V to achieve that range of output. However, I recommend to limit the application of this board to 24V max for HV, which is enough for almost every known LED size. The largest seven segment LED display I have known is of 12″ size, which has 4 rows of 10 LEDs in series per segment, and so the required forward voltage is approximately 20V. The output of LM317 also goes to the input of LM7805 to generate a regulated +5V power supply. The following circuit diagram shows the details of the power supply unit. The value of HV is adjusted through a potentiometer (POT1 = 500 ?). The value of R1 is 240 ?. The formula for HV is,
HV ? 1.25(1+POT1/R1)
C1 and C4 are 50V rated ceramic capacitors, whereas C2, C3, and C5 are electrolytic.
The schematic of MAX7219 and voltage translation unit is shown below. R2 through R9 are current limiting resistors for LED segments a-g and dp. I am using 39? for segments a through g, and 540? for dp. Knowing the forward voltage and current required for each segment, you can now set the value of HV accordingly. Suppose we want 40 milliamps for each of the seven LED segments which have forward voltage of 14V. With 40 milliamps current the potential drop across 39? resistance is 1.56V. So it is good to set HV to 14+1.56?16V. With 16V output, the current through dp segment (Vf = 6V) would be (16-6)/540 ? 19 milliamps.
I have designed a printed circuit board of the above design. Here’s a picture of a finished HV seven segment LED driver board. It is 10cm x 10cm in dimensions and provides an approximately 8cm X 4cm (3.2″ X 1.5″) size double-sided universal prototyping area for experimenting. The DC input is given through a 2-pin terminal block.
This board can drive up to 8 common cathode seven segment displays. Wiring the displays to the board is easy. Segments a-g, and dp of all the displays should connect to header JP2, whereas their common cathodes will go to the header pins D0-D7 of JP3. Serial data is fed through JP4. Header JP5 provides access to DOUT pin of MAX7219, which allows cascading of multiple boards. I am powering the board with a 24V DC wall-wart, and the HV output of LM317 is set to approximately 16V. I have tested it with an Arduino board using the LedControl library and it works like a charm.
I also tested my digital light meter project successfully with the big display board. The beauty of this design is it is functionally same as using MAX7219 and so you don’t have to make any changes to your code.
The HV seven segment LED driver board is designed to simplify the interface of bigger seven segment display modules to microcontrollers. The board receives data serially through an SPI interface using MAX7219 device at the input side. The outputs of MAX7219 are enhanced using external circuits to provide high voltage multiplexed control signals to drive bigger size seven segment LED display modules. The board also features an adjustable high voltage source for the displays, a regulated +5V output, and a prototyping area for experimenting.
Can I buy this board?
I am selling PCB of this board for $8.99 on Tindie. If you are interested, visit the link below:
Buy HV Seven Segment LED driver board PCB for $8.99.