Hello everyone, I use 2 BH1750 sensors connected to Arduino with the following connection: Sensor 1 (addr = vcc) and sensor 2 (addr = gnd) are both connected to A5 and A4 of Arduino, but when I get data from the sensor, the value of sensor 1 depends on sensor 2. That is, when I cover sensor 1, the value of sensor 1 does not change, but when I cover sensor 2, the value of both sensors changes. I don't know how to install it or if my program is wrong.
`#include <Wire.h> #include <BH1750.h>
I used the i2c scan program, the result is received two addresses 0x5c(addr=vcc) and 0x23(addr=gnd). But when receiving the light intensity value, the above error occurs. This is my scan program, I don't know if it works correctly. `
Now what happens when you try my other suggestions?
(Please never say "it does not work". Give a detailed description of what actually happens, compared to what you wanted to happen. Even if it is still not working correctly, has anything changed?)
I tried changing the pins of the sensor, but the result is still the same. The sensor whose pin addr = gnd affects the reading value of the 2 sensors. When I cover the sensor(addr=gnd) the value of both sensors changes, if I cover the sensor(addr = vcc) the value of the sensor does not change
But it is not the same as before, if you followed my suggestion correctly and I understood your description correctly. Before, sensor 1 was ignored. Now, sensor 2 is ignored. Am I right?
This is important because it seems to indicate that neither of the sensors is faulty. This is also good.
You said that whichever sensor has it's ADDR pin connected to ground is ignored. I agree this is what seems to be happening. I have a theory this may be caused by a bug in the BH1750 library you are using. That's why I also suggested you try other libraries for BH1750.
Are you using a module for this sensor? Also, as suggested above, try another library.
And what about the DVI pin in your schematic (and the pull-up resistors)? Do you leave it floating? Please refer to page 8