Multiple HT16K33 Devices

Hi All,
I would really like to have multiple HT16K33 devices in use via a single Arduino device (if possible).
I know using the solder pads on the back I can have 6 devices (3 solder pads), however, I would like to have 15 of these devices - device below:

Green I2C 14-segment alphanumeric LED display w/ HT16K33 backpack, 5 V, 4-digit | eBay

Is it possible to have around 15 of these devices on a single Arduino? Or would I need to have 'extra' Arduinos that my master Arduinos communicate with to get them display the correct data?

Thanks again

You can have as many displays as the number of Arduino output pins allows, but only one can be addressed and updated at any one time.

By having the display address pins under program control, using an Arduino output pin to select them, you need only one I2C address as well.

So, it's currently called :
Adafruit_AlphaNum4 alpha4 = Adafruit_AlphaNum4();
If I have another one called alpha41 and alpha42
They can all be connected to the same i2c and operate independently?

You can arrange objects however you like. It depends on how you decide to address the displays.

It would save memory to have only one display object, with one I2C address, and select the active physical display using I/O pins connected to the display address pins.

I don't suppose there is a tutorial of sorts for this, my knowledge isn't the greatest and I'm learning as I go.
My current knowledge is that I connect the i2c to pins 20 and 21 (and no others on the board) and use those to connect however many addressable devices I can have. The HT16K33 device I have has the option for 6 addresses. So my current knowledge level say that I can only have 6 directly addressable devices.

Not 6.

2³ = 8 devices.

You need almost twice as many. There are several ways to accomplish that.

  1. Use an Arduino with 2x I²C busses. For example, most arduino based on SAMD21 can do this, I think. Then you can put 8x ht16k33 one one bus and 7 on the other.

  2. Use an I²C multiplexer. This gives an Arduino, with only one I²C bus, up to 8 separate busses. But there is a penalty to this in terms of speed of updating all 15 ht chips. Depending on your application, the speed penalty might be of no concern.

  3. If you can somehow solder wires from Arduino pins to those solder pads, you can switch the addresses of the chips dynamically. 4 arduino pins can be used to switch a group of 4 ht chips to be used at the same time, allowing up to 16 chips to be attached to the same I²C bus.

So this sort of device -

ALMOCN 8pcs TCA9548A I2C IIC Multiplexer Breakout Board 8 Channel Expansion Board for Arduino: Amazon.co.uk: Computers & Accessories

Would allow me to have 15 (or even more if needed) i2c based HT16K33 devices, spread across two of the outputs of the TCA9548A device?

1 Like

No, 2³ = 8 devices. There are three address select pins.

I suppose it would, but @PaulRB's third option might be somewhat simpler, using an I²C pin expander.

Ooops, typo, thanks @Paul_B . Corrected above

It actually has 8 outputs, and because of the 3 solder pads on ht16k33 boards, you could have 8 ht16k33 on each of the 8 outputs, 64 in total.

You may have noticed that the TCA9548A also has 3 pins marked A0,A1,A2 which have the same function as those solder pads on the ht modules. So in theory you can attach 8x TCA9548A each one connected to 64x HT16K33!

Wait a minute... I just re-read the original post. Those displays are 4 digit. A single HT16K33 can drive 2 of those, 8 digits, so you need only 8 HT chips to drive all 15 displays. You can have 8 HT chips on the i²c bus no problem. No multiplexer needed! All you need to do is find those displays without the backpack attached. Then you can attach 2 displays to each HT chip.

You can buy standalone HT chip modules and 14 segment displays:

I am fascinated as to where - or actually how - you found the superscript "6" symbol. :astonished:

² and ³ are easy. :grin:

⁴, ⁵, ⁶, ⁷, ⁸, ⁹, ⁰ take a bit of finding as do ₀, ₁, ₂, ₃, ₊, ₋ and so on. :thinking:

Easy. I was replying on my a Android phone. If I switch to the numeric/symbol keys, then press and hold any numeric key, there is a choice of symbols. On the 1 key there is ⅙, ⅐ .... ⅕ etc. On the 2 key there is ⅖, ⅔ and ². On the 3 key there is ⅗, ¾, ⅜ and ³. On the 6 key there is just ⁶.

I shall bear that in mind. Not that I would be attempting to compose replies on a phone, reluctant even on a tablet.

I am of course, far too "cheap" to have an Apple device. :grin:

I will go down the TCA9548A route as it seems perfect for my needs and doesn't take up any more pins than I'm currently using, so I can use the 'digital I/O' pins for sensors around the board, just for simplicity.

I've seen some tutorials, but they seem a little beyond me at the moment (the TCA9548A hasn't arrived yet, and I'm sure it'll make more sense when I start tinkering)
This is my current very basic code, just to get the display working:

alpha4.begin(0x70); // pass in the address
alpha4.clear();
alpha4.writeDisplay();
alpha4.setBrightness(1);

Obviously it wouldn't work directly as above, particularly as the TCA9548A (out of the box) comes on 0x70. So can anyone give me the most basic method of displaying the above data, using the TCA9548A? Or direct me to a similar tutorial?

You're absolutely right, the TCA9548A and HT16K33 share the same default i²c address of 0x70! They also share the same alternative addresses of 0x71 to 0x77.

It won't be a problem. You only need one address for the TCA9548A, so choose one and avoid using that address for any of the HT16K33. For example, connect A0,A1,A2 to Vcc and the TCA9548A will have address 0x77. Then give your HT16K33 addresses in the range 0x70 to 0x76, but make sure they are unique on any single output channel of the TCA9548A.

For example you could set the addresses of 4x HT16K33 to 0x70, 4x HT16K33 to 0x71, 4x HT16K33 to 0x72 and 3x HT16K33 to 0x73. Then connect 4, one with each address, to TCA9548A channel 0, 4 to channel 1, 4 to channel 2 and the final 3 to channel 3.

Don't forget, when you parallel devices on the I2C bus, there should still only be one effective pull up resistor on SCL and SDA. The modules have on board resistors so you need to remove those on seven out of eight modules, if you have eight modules connected to one I2C for example. Otherwise the parallel resistance of 8 pull ups would be too low for some processors to drive.

Generally, for custom display configurations, the best way is to extend the driver class using inheritance.

They are probably 10K, like the Adafruit designed modules they are clones of. 4 of these modules on the same bus would be the equivalent of 2.5K pull up resistors, which I think would be absolutely fine. So if the multiplexer is used to connect 4 modules on each of 3 channels and 3 modules on another channel, I hope there will be no need to remove the pull-ups on the modules.

A little advanced for @PaulWoodroffe I would think!

@PaulWoodroffe how far have you got with your sketch? How many modules have you connected together so far?

If this is the approach you are taking, it's going to get extremely painful to control 15 of these modules. You need to look into using a single array of 15 of these Adafruit_AlphaNum4 objects, rather than 15 separate objects.

Post the code you have working so far for 2 or 3 modules and we can advise how to use an array.

We can then look at how to use the multiplexer to switch between groups of 4 modules.