Power four x 4 digit 7 segment displays and 2 x BME280 from ESP32?

Ok, I think we need to go back to the Adafruit backpack displays. Please watch this video:

https://www.youtube.com/watch?v=LowMKYcBxNg

I haven't studied the datasheet yet, but it looks like this solves all the I2C problems including the pullup problems.

Thank you, I understand the issue now. I've watched the video, that's a good find, thanks. I also decided to ask about the problems you've highlighted on Adafruit's forums hoping to get a response from Adafruit support (which I did) as they should hopefully know their own hardware fairly well. The responses I got are:

10K pullups are on the 'weak' side. So combining several in parallel is usually possible. The practical limit depends on the strength of the GPIO pins of the processor in use, as well as the electrical characteristics of the actual bus wiring.

Most processors can handle at least 3 or 4 sets of 10K pullups. Much more than that can start to cause problems. This can be addressed by removing the pullups from some of the boards.

All of Adafruit's videos and descriptions say how you can connect up to 8 displays (0x70 to 0x77) and that they're designed to be plug and play, so I was hoping they would say they've implemented a simple solution such as cutting a trace to disconnect the pullup resistors. But unfortunately not. I then asked about the multiplexor and got the following response:

The multiplexer effectively creates up to 8 independent buses. In addition to providing a separate address space, these buses are electrically independent as well, so it could be used to isolate smaller groups of devices to minimize the effects of the combined pullups, as well as the total length of each bus.

The downside is that there is some additional software overhead in that you need to explicitly select a channel on the multiplexer before you can communicate with the device(s) connected to that channel.

20cm of bus length in itself is not a problem. But you need to consider the combined length of all bus segments. At normal bus speeds, a total bus length up to about 1 meter is usually workable.

The comment about the 20cm bus length was because I mentioned using a 20cm FPC ribbon cable with breakouts to get the second BME280 sensor inside the server cabinet through the removeable side panel. I've read that I2C is designed for short bus lengths so wanted to check that too.

Not sure if any of this helps at all? But it sounds like the multiplexor is definitely a good option. Where does this leave me with voltage and current draw? I assume it would still be best to power them direct from the USB and not from the ESP32?

For the displays, Adafruit's website says the following:

You can use these with a 3.3v or 5v microcontroller. Just connect the VCC+ pin is the same voltage as the logic on your microcontroller.

But then a few lines later says this:

Connect VCC+ to power - 5V is best but 3V also seems to work for 3V microcontrollers.

"seems to work" doesn't exactly fill you with confidence :smile:

Your thinking is exactly right, and their's is not. The pullup resistors should be jumpered so you can use them or not. But their way they get to also sell you a multiplexer. :slight_smile:

But the overhead is trivial. As shown in Ralph Bacon's video, you set up a 4-line function, and then call that function just before communicating with one of the slave devices. No library needed.

Putting each device on its own I2C bus coming out of the multiplexer will give you the best odds of having long runs still work well. I don't think 20cm will be a problem.

Yes, I think it's the answer. It's as though each device is on the I2C bus by itself. So all the issues with multiple pullups go away, and there's no need for voltage translation. Each of the devices you're using has its own pullups to its own Vcc. The only exception is the ESP32, and Adafruit has put those pullups on the multiplexer for you.

Yes, absolutely. I think all your stuff is 5V, and since the ESP module has a built-in 3.3V regulator, you can power it with 5V too. But you should power all of it from the main 5V supply directly.

No I think that's wrong. It may work, but as I remember it the datasheet for the chip driving the display says it needs 5V.

So with the multiplexer, you could even go back to four displays if you want to. I don't think current would be a problem. I suspect they will be plenty bright at a low setting, which won't use much current.

Note that it looks like both the multiplexer and the displays default to address 0x70. You would need to change the multiplexer address to something else. The displays can all be 0x70 since they are on separate busses.

Ok, thanks. This is what I've put together. Sorry if my schematic skills are not the greatest, but hopefully it's easy enough to follow.

The BME280 pinout actually says the following, so I could even power that from the ESP32's 3V3.

Vin - this is the power pin. Since the sensor chip uses 3 VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of your microcontroller

The breakouts between the multiplexor and second BME280 are Adafruit EYESPI FPC connectors:

I'm thinking of using something similar to carry power from the USB mains adapter to a USB breakout. I'd then split that to the I2C devices etc and another USB breakout to convert it back to a USB cable to connect to the ESP32. I could even use the same cable, it just means the pin labels wouldn't match.

The SparkFun USB-C breakout says the following:

This board breaks out the USB-C connector's VBUS, GND, CC1, CC2, D+, and D- pins intro a 0.1" pitch header while providing up to a nominal 1.5A of power and up to 3A depending on the upstream device.

I was looking at a 5.1V 3A USB C mains adapter. Is this adapter suitable or should it be kept around 1.5A most of the time?

The schematic looks fine. It's nice not to see all the resistors and stuff.

I'm not going to be able to advise you on the cables. I don't really know anything about what's available, and never use USB type C. Maybe someone else here has experience with that stuff.

This is overcomplicated..

Would you mind explaining why it's overcomplicated and what you would suggest to simplify it please?

Every TM1637 have 2 pins CLK and DATA, and dont need I2C, just connect them on any free digital pins to ESP32 directly. (Im not sure but I think that CLK might be common so you could save some pins). BME280 also directly on I2C and that is it.

I always thought the TM1637 did not support decimal points, and only had the colon in the middle. And I think the vast majority of modules using that chip come that way. But I see on Ebay from Chinese sources some modules that do support the decimal points. This would have to be done by the manufacturer, I think.

But the other thing is that originally this was to be four 4-digit displays. The TM1637 version would require 8 pins for that, and I don't know if the OP has those pins available. With two displays, that would be four pins, plus two more for I2C for the sensors, so six altogether, versus two if everything is I2C.

@noobmastha I did have a look at the TM1637 when you suggested it earlier in the thread but I didn't see any with the decimal points. The supplier I'm planning to use does stock one with decimal points (M5Stack brand) but it implements I2C with built in pullup resistors, so I don't think it changes anything unfortunately. Thank you though.

@ShermanP Thank you very much for your help and all the time you've spent on this, it's really appreciated.

Yes sorry, I forgot about decimal point dot, anyway there is a version with two dots 00:00. Btw, why do you need driver for the buzzer?

You're welcome. I hope you will post updates on what works and what doesn't, and what you end up with.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.