In this post we’ll add a serial data transfer capability to a standard 7-Segment LED Display by using PCF8574 I/O Port expander IC with I2C interface.For similar design based on Arduino see this link. Usually in order to minimize required outputs for driving LED display a multiplexing techniques are used. Most frequent way is to connect all segments in parallel and switch a common anode/cathode in sequence with relevant digit data. Examples of these multiplexing techniques can be found in recently published 7-Segment Display with SPI post. Adding I2C port expanders to a 7-Segment display makes it possible to address each segment individually without additional code complexity. A general I2C routine can be implemented in all segments regardless of their number, the only thing you need to do is to assign the address by setting port expander A0(1), A1(2), and A2(3) pins . In case of PCF8574 8 Digit Display can be built. PCF8574 datasheet is available here.
For this project 56mm x 38mm Common cathode 7- Segments LED Display was used. As you can see it’s a very big display and can be an excellent choice for building a digital clock for example. Current design features only one 7-Segment, however the number of segments can be easily extended. Follow design schematic for more details.
Design assembly code is very similar to what was used in PCF8574 I2C 8-bit I/O expander post except for addition of BCD to 7-Segment routine and a simple binary counter. You should see a count from 0 to 9 with about 1s intervals if the circuit is functioning OK.