TCA9548A And BH1750 connections with Arduino Mega

Hey! I'm currently working in the supervision of multiple tanks using an Arduino MEGA and I would like to include a few luminosity sensors that would go inside a transparent tube inside the tank. I will use multiple BH1750 modules, which uses I2C protocol.

Right now I'm thinking of using four sensors per tank (Eight tanks in total) and I found that I can use a multiplexer to connect multiple devices without using all the arduino's pinout. The schematic shows the connected devices for only one tank. Is it worth it to use multiplexers in this case?

I also found that I need to use pull-up resistors in order to keep the signal lower than 3mA but I don't really understand its use with the multiplexer. I added them according to what I have read online but If you understand a little bit more about it I would like to have a better explanation. I'm also concerned with the 3.3V input connection and I was planning to use an external voltage but, does it mess up the I2C communication?

I'm new in this forum, hope the best for all and thank you in advance!

Connecting Mega 5 volt signals to the TCA9548A 3.3 volt device might damage it.
Use level shifters.

Which BH1750 module. Post a link.

Vin of the TCA must be connected to 5volt.
No resistors should be used. They are already provided on the Mega and likely on the sensors.
If the BH1750 modules have a Vin, then they also should be powered there with 5volt.
If the BH1750 only have a VCC pin, then power them there with 3.3volt.
I don't see a GND symbol on the BH1750 modules. Everything must have a common ground.

How long is the I2C wiring to the sensors.

@Railroader TCA9548A chips are also level shifters.
Leo..

On their inputs at the controller side, powered by 3.3? Likely not. So it senses that the sensors are 3.3 volt device? I'm inpressed.
Thanks for the remark.

Hey, this is the BH1750 module I'm using, according to what you said I understand 3.3V is the best option to power them even though it also can be powered with 5V. Also thanks for pointing it out the common ground connection! Fixed it right away.

The tank length is 1m so the longest cable should be around 90cm inside plus a little more length in order to connect the devices to the side of the tank. I read I2C Protocol works better with lengths shorter than 1m so I could keep the multiplexer module inside the tube to shorten the length and extend the cables between the multiplexer and the Arduino, is that a good idea?

They wrongly named the supply pin VCC, which should have been named Vin.
Didn't you see this in the description "5 Voltios"
That module has a 3-pin 3.3volt regulator, so must be powered with 5volt.

It does have 4k7 pull up resistors to it's internal 3.3volt supply.
That might be enough for the wiring you talk about.
If not, leave the resistors in, but don't go lower than 2k2.
Leo..

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