Help... PCF8574T (Expanding "Nano's" Digital Outputs)

When I saw my RGB Chromatograph clock my teacher built from a kit  I was so impressed with it I  jumped the gun & ordered the parts so I could make one with an arduino version, I never thought much about it, thats so simple I could do in a few hours no problem except I overlooked one simple thing....

This clock uses six 10mm RGB Leds, two for the hour, two for the minutes & two for the seconds, each led has 3 inputs & 1 ground, thats a total of 18 outputs,  thats not including a few other inputs used for status indicators, along with a few inputs for buttons, the problem is that a Nano doesnt have enough digital outputs & I completely overlooked that fact.

Anyways I started looking for I/O expanders when I realized that I have a few 1602 displays & PCF8574T backpacks, I have heard some people claim that it can be used to provide an additional 16 digital outputs, if true then it that would resolve my issue very easy

Has anyone done this? or example sketch how I could deploy the PCF8574 this way, for example a blink sketch that defines a pin on the PCF8574 as an outputs & turns on a LED connected to the pin

Thank you much...

Downunder35m2 months ago

You might be able to save a lot of pins by using a LED matrix.
Example to click on

Of course you would need to stop thinking square for the matrix in your case.
Another way would be to use a serial com chip and additional drivers for the LED's.
Keep in mind that a byte can hold 8 bits, so 8 "switches".
3 byte would give you 24 "outputs" already and you only need the few pins for the serial data transmission to the LED driver.
A similar thing was done with a square matrix in this Instructable:


Should be possible to salvage all you need from there, except that you need to wire your LED's corresponding to the Matrix and program the output accordingly.
Maybe by putting the LED's in general as one matrix and using 2 more rows to address the colors, up to your programming skills....

rdlockrey (author)  Downunder35m2 months ago

thank you, I have considered that route

we are actually covering charlieplexing in the next few weeks, but for now Im curous about using this pfc8574, I guess the question is can I still use the PFC8574 as an I/O expander when its mounted to the 1602?

Just found the corresponding tools in the Arduino Playground, there is also info on 7-segment displays.