I'm having a new project with 4 BH1750 Light Sensors in an arduino.
In the discussion in this site: How can I set I2C adress? 路 Issue #7 路 claws/BH1750 路 GitHub, BH1750 only supports 2 addresses (0x23 & 0x5C). As I need to have reading from 4 BH1750, I probably should do some readdressing, in which I don't know how. Is there any way to do this?
I also have other idea which is to utilize the I2C bus and have another arduino read the other 2 sensors, acting as a slave. But I only have one arduino and probably can't afford to buy another. Thank you for the answer to my question above.
Is the "addr" pin of the chip exposed on your bh1750 module?
If so, you can use this pin to change one module to have one address and the other 3 have the other address. The Arduino sketch would only use the address with one sensor. To read each sensor, use 4 Arduino pins to control the address of each sensor. If you don't have 4 Arduino pins spare, use a pcf8574 chip or similar.
If the addr pin is not useable on your modules, you could use an "i2c bus multiplexer".
Yes the addr pin is visible. Thank you for the suggestion. I will try to do it but pcf8574 might be hard to find here in the philippines. Though, there are available on I2C lcds which I might try to desolder. Haha.