BH1750 with NodeMCUv3 : Found no i2c devices

I’ve had the exact same problem. Tried everything that was mentioned above, swapping around the SDA and SCL, pulling high instead of low etc etc. Even tested each wire with a Multimeter and everything looked fine, But… what fixed it was solder. I thought it was fine without but it wasn’t. As soon as i added the solder it worked first time. So in this case it was definitely a loose connection for me. Did you solder yours?

2 Likes

Tried to set up another and again ran into similar problems even with some solder on. I tested it on a new BH1750 and just pulled the pins tight to make sure it was all connected, it worked. Soldered it, and it didn’t work, tried again to compile, didn’t work, 3rd time lucky, it worked.

So no idea whats going on with it, its all fine now and i’m getting readings but feel its so temperamental. Also found I got better results Over the Air rather than through a usb. (rasberry pi3)

INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from living_room.local using esphome API
INFO Connecting to living_room.local:**** (192.***)
INFO Successfully connected to living_room.local
[19:10:26][I][app:105]: ESPHome version 1.15.3 compiled on Dec 15 2020, 19:09:33
[19:10:26][C][wifi:443]: WiFi:
[19:10:26][C][wifi:303]:   SSID: [redacted]
[19:10:26][C][wifi:304]:   IP Address: 192.
[19:10:26][C][wifi:306]:   BSSID: [redacted]
[19:10:26][C][wifi:307]:   Hostname: 'living_room'
[19:10:26][C][wifi:311]:   Signal strength: -39 dB ▂▄▆█
[19:10:26][C][wifi:315]:   Channel: 1
[19:10:26][C][wifi:316]:   Subnet: 255.255.255.0
[19:10:26][C][wifi:317]:   Gateway: 192.
[19:10:26][C][wifi:318]:   DNS1: 192.
[19:10:26][C][wifi:319]:   DNS2: (IP unset)
[19:10:26][C][i2c:028]: I2C Bus:
[19:10:26][C][i2c:029]:   SDA Pin: GPIO4
[19:10:26][C][i2c:030]:   SCL Pin: GPIO5
[19:10:26][C][i2c:031]:   Frequency: 50000 Hz
[19:10:26][I][i2c:033]: Scanning i2c bus for active devices...
[19:10:26][I][i2c:040]: Found i2c device at address 0x23
[19:10:26][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Living Room PIR Sensor'
[19:10:26][C][gpio.binary_sensor:015]:   Device Class: 'motion'
[19:10:26][C][gpio.binary_sensor:016]:   Pin: GPIO12 (Mode: INPUT)
[19:10:26][C][logger:185]: Logger:
[19:10:26][C][logger:186]:   Level: DEBUG
[19:10:26][C][logger:187]:   Log Baud Rate: 115200
[19:10:26][C][logger:188]:   Hardware UART: UART0
[19:10:26][C][bh1750.sensor:027]: BH1750 'LivingRoom Illuminance'
[19:10:26][C][bh1750.sensor:027]:   Unit of Measurement: 'lx'
[19:10:26][C][bh1750.sensor:027]:   Accuracy Decimals: 1
[19:10:26][C][bh1750.sensor:027]:   Icon: 'mdi:brightness-5'
[19:10:26][C][bh1750.sensor:028]:   Address: 0x23
[19:10:26][C][bh1750.sensor:048]:   Resolution: 0.5
[19:10:26][C][bh1750.sensor:049]:   Update Interval: 60.0s
[19:10:26][C][dht:017]: DHT:
[19:10:26][C][dht:018]:   Pin: GPIO2 (Mode: INPUT)
[19:10:26][C][dht:022]:   Model: DHT11
[19:10:26][C][dht:027]:   Update Interval: 60.0s
[19:10:26][C][dht:029]:   Temperature 'Utility Room Temperature'
[19:10:26][C][dht:029]:     Unit of Measurement: '°C'
[19:10:26][C][dht:029]:     Accuracy Decimals: 1
[19:10:26][C][dht:029]:     Icon: 'mdi:thermometer'
[19:10:26][C][dht:030]:   Humidity 'Utility Room Humidity'
[19:10:26][C][dht:030]:     Unit of Measurement: '%'
[19:10:26][C][dht:030]:     Accuracy Decimals: 0
[19:10:26][C][dht:030]:     Icon: 'mdi:water-percent'
[19:10:26][C][captive_portal:169]: Captive Portal:
[19:10:26][C][ota:029]: Over-The-Air Updates:
[19:10:26][C][ota:030]:   Address: living_room.local:
[19:10:26][C][api:095]: API Server:
[19:10:26][C][api:096]:   Address: living_room.local:
[19:10:26][D][api.connection:604]: Client 'Home Assistant 0.117.1 (192)' connected successfully!
  name: living_room
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "***"
  password: "***"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Living Room Fallback Hotspot"
    password: ***"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

i2c:
  sda: D2
  scl: D1
  scan: True
  id: bus_a

sensor:
  - platform: bh1750
    name: "LivingRoom Illuminance"
    address: 0x23
    measurement_time: 69
    update_interval: 60s
  - platform: dht
    pin: D4
    temperature:
      name: "Utility Room Temperature"
    humidity:
      name: "Utility Room Humidity"
    update_interval: 60s
    model: DHT11

binary_sensor:
  - platform: gpio
    pin: D6
    name: "Living Room PIR Sensor"
    device_class: motion

Thanks, Gavin !

It was solder issue on my end as well. Now it’s fixed.

1 Like

Im have a seperate 1602a and PCF8574 i was using a breadboard, when you refer to solder so you mean the connection between the two modules or the solder on the headers?
I have tried two seperate PCF8574 with the same 1602a but running into all the stuff you guys have mentioned.

For me it was the connection between the headers and the BH1750 Module. It definitely needed plenty of solder. Its was strange because like i mentioned above, the multi-meter said the connection was fine but it wasn’t until i added the solder that it actually started to work.

It seems allot of people are having issues with these light sensors on numerous forums. Cant say this method is definitely going to work for you, but it did for Dhaval and myself. Might be worth a shot to solder it all together instead of using the breadboard.

I dondt know what happened i swapped some values again and it started working and now I can swap em back /forth w/o issue and it connected in the logs, once it connected couldn’t see and the potentiometer was maxed so i turned it down and saw everything on the screen.
So still not sure why it works now but it does.
Thanks sir. Annoying puzzling still but glad its working.

I was just fighting with this same issue on a D1 Mini and an SCD-40 sensor.

I tried wiring it with a breadboard or connectors multiple times and never had luck. I very reluctantly soldered them together after reading this post. It worked immediately! No idea why it’s so sensitive but I thought I’d leave a comment for anyone else who finds this thread in the future.

For me the sensor was working fine then suddenly on a re-flash it couldn’t pick up the sensor! My soldering wasn’t the best by any means which must be the cause because only on a 4th attempt at flashing did it pick it up again, and now works absolutely fine.