I’m trying to build my first sensor. I configured NodeMCUv3 with ESPHome integration within HA and added sensors step by step as guide suggested. Temperature/Humidity sensor (dht) is working fine. Motion sensor (AM312) is working fine. LUX sensor BH1750 is not coming up.
I tried many different config that I found on HA and ESP forum but nothing seems to work.
Here is the error
[01:27:53][C][i2c:028]: I2C Bus:
[01:27:53][C][i2c:029]: SDA Pin: GPIO4
[01:27:53][C][i2c:030]: SCL Pin: GPIO5
[01:27:53][C][i2c:031]: Frequency: 50000 Hz
[01:27:53][I][i2c:033]: Scanning i2c bus for active devices...
[01:27:53][I][i2c:049]: Found no i2c devices!
[01:27:53][C][bh1750.sensor:027]: BH1750 'Bedroom LUX'
[01:27:53][C][bh1750.sensor:027]: Unit of Measurement: 'lx'
[01:27:53][C][bh1750.sensor:027]: Accuracy Decimals: 1
[01:27:53][C][bh1750.sensor:027]: Icon: 'mdi:brightness-5'
[01:27:53][C][bh1750.sensor:028]: Address: 0x23
[01:27:53][E][bh1750.sensor:030]: Communication with BH1750 failed!
[01:27:53][C][bh1750.sensor:048]: Resolution: 0.5
[01:27:53][C][bh1750.sensor:049]: Update Interval: 5.0s
I don’t really know what ‘address pin pulled low’ means. I did try to learn it thru different manuals yesterday and connected the address pin to GND and set ‘0x23’ as address.
VCC – Connected to 3v on nodemcu
GND – Connected to GND pin on nodemcu
SDA – Connected to D2 on nodemcu
SCL – Connected to D1 on nodemcu
ADD – Connected to GND on nodemcu
Is there a way I can access this nodemcu thru GUI by the private IP address? I tried to connect to the IP thru web browser but it displays ‘refused to connect’ message
I know that. It changes the address between one of two options. The esphome i2c scan is not finding either address though so to eliminate the possibility that a floating input is the problem I advised him to tie it high or low to select one of the address.
First I tried the setup without connecting ADD pin to anything. It didn’t work so I tried to educate myself on potential issues. I came across the floating inputs documents and tried to correct my mistake by connecting ADD to GND pin on Nodemcu. That didn’t work either.
I just tested it again few minutes ago without connecting ADD pin. Same result. “Found no i2c devices”.
The distance between sensor and the node is about 15 cm. All sensors, DHT22, BH1750 & AM312 are connected to the Nodemcu thru Jumper cables. I did change those Jumper cables connecting BH1750 and Nodemcu just to rule out any cable related issue.
The diagram provided by Pepe displays 10Kohm resistors. Just to clarify, I do not have any resistors connected between Nodemcu and BH1750. Is that a potential issue?
I read a document regarding pull up resistor inbuild in the Nodemcu. I don’t know how to enable it though. I can not open GUI of Nodemcu in a browser thru local IP. Is there a way to do so ?
It’s catching stalks, but I don’t use resistors because I have short connecting cables. This is my configuration including Lcd display on one I2C. Notice that I have swapped sda -scl. I don’t remember why I did it like this, but it works for more than a year.
VCC – Connected to 3v on nodemcu
GND – Connected to GND pin on nodemcu
SDA – Connected to D1 on nodemcu
SCL – Connected to D2 on nodemcu
ADD – Connected to GND on nodemcu / Also tried with not connected to anything
i2c:
sda: D1
scl: D2
scan: True
Same error persist.
[01:16:16][C][i2c:028]: I2C Bus:
[01:16:16][C][i2c:029]: SDA Pin: GPIO5
[01:16:16][C][i2c:030]: SCL Pin: GPIO4
[01:16:16][C][i2c:031]: Frequency: 50000 Hz
[01:16:16][I][i2c:033]: Scanning i2c bus for active devices...
[01:16:16][I][i2c:049]: Found no i2c devices!
The internal pull-up resistors required fo operate i2c are enabled automatically and should be fine for 15cm of cable length. You’ve eliminated just about everything I can think of.
I flashed tasmota-sensor.bin on another NodemcuV3. Connected the BH1750 sensor to it. No other sensors are connected to this nodemcu.
GND – GND
VCC – 3V
SCL – D1
SDA – D2
ADD – Not connected / Connected to GND