Hi all,
I'm currently working on BH1750, Light_Sensor__SKU_SEN0097_-DFRobot
I don't understand, how to using it in multiple I2C address/sensor.
Please give me some input on code reference to changes the address?
Here the current code I used for 1 sensor (from DFrobot):
Hi afremont,
Thanks for respond, still can't works. I think the problem is in my code.
Sorry for my poor writing skills, but I will try to make it work.
Thanks Grumpy_Mike,
I run the code above and nothing happen in serial monitor. I used this connection:
Vcc - 5v
Gnd - Gnd
SCL - 10K - Pin 5
SDA - 10K - Pin 4
ADD - 100 ohm - Gnd
yaser:
This my present code: #include <Wire.h> //BH1750 IIC Mode #include <math.h>
int Sen1 = 0x23; //setting i2c address
int Sen2 = 0x5C;
byte buff[2];
void setup()
{
Wire.begin();
Serial.begin(57600);//init Serial baud rate
}
This is an old thread and probably not visited anymore, but in case there is someone wanting to use 2 light sensors at the same time (which I suppose was the issue of this thread) I would like to summarize:
The ADDR pin on the BH1750 (GY-302) is determining if the chip will have the address 0x23 (pin LOW) or 0x5C (pin HIGH) and is actually pulled DOWN !!! according to the schematics.
It is always a good idea to verify the addresses with I2C scanner.
Mohannad in his article #9 refers to http://www.instructables.com/id/BH1750-Digital-Light-Sensor/ but this instructable actually never shows 2 sensors connected to Arduino. He instructs to connect the ADDR to pin A3, which to me does not make sense especially if you have 2 sensors.
One of my sensors has hardwired ADDR to GND and the other sensor has hardwired ADDR to Vcc. (Probably the most correct way should be to connect ADDR to Vcc with 2k resistor)
a mi si me sirvio pero tengo un porblema, solo me lee el sensor con la direccion 0x23, es decir que me da dos datos pero son exactamente iguales y solo varian cuaando el sensor con esa direccion varia, el otro sensor no lo lee