Using 7 port expanders in two "projects"

I built an 8 ft diameter light display made up of 7 segments, each using a 16 bit MCP23017 port expander.

Before I built the big guy, I built a table-top version about 16" in diameter, using the same port expanders at the same addresses. this was so I could program on the small model in my office while building the big model in my shop. I will use the exact same program when finished.

I would really like to be able to view the small model at the same time the big model is working, sort of like a "monitor". If I make a programming change on the small model, it gets reflected on the big one.

How can I do this? Can it be done with one Arduino (UNO in this case)? How do I resolve the addressing for the port expanders which only allow me 8 addresses from $20 to $27?

Can I somehow use one Arduino as a relay (ie as an I2C port) to the other without addressing conflicts?

Big 7-segement displays usually need higher voltages to power them (>=12volt).
Therefore high voltage shift registers, like the TPIC6B595, are normally used for that.
That could also reduce the problems of distance between the Arduino and the display (I2C won't go very far).
Shift registers and local I2C monitoring with a single Uno shouldn't be a problem.

Due to the lack of information, the best I can do is to recommend two of these:

They may or may not work due to the physical layout which Leo mentioned as an inherent issue with I2C.

All that said, based on your comments, I don’t understand the need to do this. You have a table top mode, you develop with that and when the code is complete, flash the big unit with the same code. Debug the big unit hardware and you’re done. Trying to make both of them work in parallel is extra, unecesary code development that may bounce back and forth between both software and hardware debugging, extra steps, extra work for a code base and hardware that will have zero purpose when you’re done. What is gaining by watching both at the same time? I fail to see the benefit.

Can you show your code so far please?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

If you are using I2C, then give your monitor 23017s a different address and include them on the I2C bus.
Then double your code to control the second set.

Or make your drive code a function and use it twice with the same data but different I2C addresses.

Tom… :slight_smile:

I've never tried this, but this library exists: Arduino Playground - SoftwareI2CLibrary which sounds as if it gives you a second I2C bus. Assuming you have 2 identical systems, you would simply double each write, one to I2C object for the "monitor" bus and one to the I2C object for the "main" bus.

I wonder what kind of segments you are using - do you have a link? I'd consider using LED strips for the big digits, which can be programmed by a simple interface.

This is not a 7 segment display. It’s 110 totally separate RGB LEDS that are uniquely addressable via the port expanders.

I have an I2C line driver that should take care of extra distance. If not, then the Arduino itself will be part of the display, ie mounted on the display, instead of being located elsewhere.

I think I found a solution though, by using TCA9548A I2C Multiplexers.

FYI, attached is my project

MAIN.ino (13.5 KB)

110 LEDs can be driven (and uniquely addressed) with just 3 8-bit shift registers by placing them in a 10x11 matrix. Shift registers are usually a better solution for that as they're much faster than the 23017s, the speed of which is limited by the I2C bus speed and protocol overhead. 110 LEDs is 7 23017s, no problem for I2C, but RGB implies a total of 330 LEDs, which could be a 16x21 matrix with 5 shift registers. A matrix makes it also much cheaper and easier to build. It's the common method of doing this, instead of using 21 23017s, each of which costs about as much as 10 common 74HC595s.
You are limiting yourself however to just 8 colours, as there's no (easy) way of changing the brightness of individual colours in the pixels for higher colour resolution.

Might be easier to buy a roll of addressable LEDs, and cut them into individuals.
Then you don't need any other parts.

My display has to be seen from 300 yards (across a Cove), so I’m using 3W RGB LEDs. Since my “star” is made up of 7 segments, I have a board with port expander and drivers for each. I do have a matrix, it’s 3 x 110. I use 3 DIOs for RGB, and the I2C ports on an UNO for the rest. The fact that I can have more than 3 colors (I use 7) is a bonus for what I’m doing. The fact I can fade in and out any light is also a great feature, all available on 3 DIO!! (I just finished telling my PIC Basic Pro forum goodbye…I was moving everything, 10 years of effort and notes, over to Arduino).

I compared 7W incandescent bulbs to 10w, 3w and 1watt RGB LEDs, putting one of each on a board, and driving around the cove to see the relative brightness. 10W was brighter of course, but took more current with no other advantage. 3W was the best, using 300 mA at 12 volts and a 100 ohm resistor.

If I build a rectangular display, I would probably use shift registers as indicated by one response. I’ve done that before on a smaller scale.

Photos show the programming model I used, and a photo of the port-expander/driver board next to the breadboard it replaces (I made 7 of them). The UNO is at bottom right.

That’s two of the same photo:


Lots of LEDs indeed. No idea how you wired it - I see only three 100 resistors on each point.

Sorry for long delay...other issues.

The 3 resistors are for the transistors (base). The LEDS are current limited by 8 bit DIP resistor packs.

Attached is photo that should have been uploaded previously (PCB board with port expander and sink drivers, replacing breadboarded contraption.)