Using SCL and SDA of ESP8266-01 with GY-30 BH1750FVI for lux measurement I followed this tutorial to get lux measurement from GY-30 BH1750 with Arduino.

It's working fine. But now I want to use it with ESP8266-01.

I read Pin 4 is SDA and 5 is SCL for it. But it's not working. Can someone tell me what do I need to change in the code? I'm a "bit" confused about the addressing.

Following is the code for Arduino:

#include &lt;Wire.h&gt;

int BH1750_address = 0x23; // i2c Addresse
byte buff[2];

void setup() {
  Wire.begin();
  BH1750_Init(BH1750_address);

  delay(200);
  Serial.begin(9600);
  Serial.println("Starte Beleuchtungsstaerkemessung - blog.simtronyx.de");
}

void loop(){
  float valf=0;
  if(BH1750_Read(BH1750_address)==2){
    valf=((buff[0]&lt;&lt;8)|buff[1])/1.2;

    if(valf&lt;0)Serial.print("&gt; 65535");
    else Serial.print((int)valf,DEC); 

    Serial.println(" lx"); 
  }
  delay(1000);
}

void BH1750_Init(int address) {
  Wire.beginTransmission(address);
  Wire.write(0x10); // 1 [lux] aufloesung
  Wire.endTransmission();
}

byte BH1750_Read(int address) {
  byte i=0;
  Wire.beginTransmission(address);
  Wire.requestFrom(address, 2);
  while(Wire.available()){
    buff[i] = Wire.read(); 
    i++;
  }
  Wire.endTransmission();  
  return i;
}
Wire is not setup for the ESP01 by default. There is no GPIO 4 or 5. you can specify the pins as arguments to the begin() method, ex: Wire.begin(sda, scl). Using GPIO of (0,2) is common. Since the ESP01 is picky about pin states during power-up, don't use external pullups (you don't need them anyway).