Can i use this multiplexer for multiple 128x16 OLED's?

Im working on a project which requires multiple OLED modules (hopefully 8 of them) running on a MEGA. So far I’ve got one OLED working fine .

This is the one that I’m using: 3-5V 0.96" 12C Serial 128X64 OLED LCD LED Display Module for Arduino White foUK | eBay) .

but I’m aware that I can only have two of these running at once due to the fact that they only have two address options (selectable by moving the 0 ohm resistor on the back of them). So I’m now wondering if i can demultiplex the signal from the scl and sda pins using this module: -

alternatively I’m wondering if using SPI OLED’s (as opposed to I2C) would allow me to connect more without the need for a multiplexer module but at the expense of extra digital pins. Is this how it works?

Use the address line as if it were a chip select line.
Bring each display’s address line to a unique pin on the Mega, and drive them high.
Then take one line low, talk to the display using the Address Line = 0 address. Take the line back high when done.

Repeat for the other displays, talking to one at a time.

1 Like

Yes, you can use the TCA9548.

Yes, you can use four SPI displays with individual /CS pins.

The TCA9548 is probably easier if you use a single buffer for all four I2C displays. i.e. redraw each screen from scratch. It is usable on a Uno.

The Mega2560 has plenty of SRAM for individual buffers.

David.

1 Like

okay so I have a few options. I think I’ll give the multiplexer option a go first as I already have a few I2C OLED modules. many thanks for your help guys :slightly_smiling_face:

So why is CrossRoads’ proposal not simpler?

I’m a little confused by crossroad’s response if im honest. There are only 4 pins on each OLED module… 5v, ground, SDA and SCL.

Bring each display’s address line to a unique pin on the Mega<

does this mean connect each of the SDA pins to unique pins on the MEGA? I thought the SDA line was for data… not address.

and drive them high.
Then take one line low, talk to the display using the Address Line = 0 address. Take the line back high when done.<

If I write the SDA pin LOW surely then it would then jump between HIGH and LOW again as soon as I start sending data along it. I’m assuming the data is a digital signal so as soon as it jumps HIGH the address won’t be LOW anymore so the data transfer will stop.

Am I looking at this wrong in some way?
Thanks

It is a neat trick. Connect each OLED A0 pin to a separate GPIO.
Name pins as CS1, CS2, CS3, CS4 and set as OUTPUT HIGH.

This means that every OLED will have Slave Address 0x3D. (A0=1)

When you want to use OLED2 display, set CS2=0. This makes Slave Address = 0x3C (A0=0)
e.g.

     digitalWrite(CS2, LOW);  //active OLED = 0x3C
     display.display();
     digitalWrite(CS2, HIGH); //inactive OLED 0x3D

Saves having to buy a TCA9548 board and extra wires. But uses 4 GPIO pins.

David.

Which oled pin is A0?

There is only VCC, ground, SDA and SCL

At the back of your OLED pcb there is a solder-bridge or 0R that selects the Slave Address.
You will connect a GPIO wire instead. i.e. to alter Slave Address under program control.

Life is always a compromise. Soldering a tiny wire to the pcb is a bit fiddly. (and unsafe)
Buying a TCA9548 board costs time and money. But all your wiring is done with robust header pins and Dupont cables.

Since you were considering SPI displays, you understand the concept of a Chip-Select signal.

David.

Ah right… Yes I’m familiar with using a chip-select signal. I was just confused by the fact that I couldn’t see a C/S pin on the module but it makes sense now. Thank you everybody for your help.
very much appreciated

Be careful soldering. We tried to do similar on a breakout board we got from Sparkfun, the pads were really sensitive, easy to overheat and come off the board.

Thanks for the heads up. I will bear that in mind if I decide to go for the chip select/ address pad method. I’m going to try the MUX method first tho as i’d rather not have dupont wires hanging off the back of my OLED’s. I’m planning to photo etch a pcb for this job so adding a MUX into the layout will not be that much extra work and will ensure a good secure finish.