Open marius240 opened 5 years ago
btw my it gives me error: [BH1750] ERROR: received NACK on transmit of address in the start and then for the rest of the time just: Device is not configured! Light level: 65534
the board is NodeMCU ESP32S
i2cdetect just gives me
Need help ASAP! @claws @wridgers @goebish @NuTTeR
thanks <3
try with Wire.begin(21, 22);
@goebish nope aint working
still same error, just ERROR: received NACK on transmit of address
Have you tried to add pull up resistors between SDA<->3.3V and SCL<->3.3V ? I'm not sure Wire.begin takes care of that. If that doesn't work, then I don't know, have you tried with another i2c device such as a small oled display ?
nope dont have another ic2 device, and dont think i got a pull up resister,
but im pretty sure there is no need for a pull up resistor
just use any 1k-30k resistors, that should be fine, you need 2
so a resistor between D21 -> SDA and D22 -> SCL ?
why should a resistor change anything? just asking :D
no, between SDA -> 3.3V & SCL -> 3.3V
because i2c lines need to be pulled up https://rheingoldheavy.com/i2c-pull-resistors/ It could be done in software in the i2c lib, but I'm not sure that's the case, just check with pull up resistors, you've nothing to lose ;)
not sure what you mean, there is no between SDA and 3.3v i think photo otw
well, just connect a 10k or so resistor between +3.3V and SDA ... same for SCL
im trying to say, i connect direct from the board to scl, there is no connection to 3v between i can interact with
i have a 3v pin ofc, but i sounds weird if i should hook the up to them
btw the blue line is ground and the red is 3.3v
@goebish
yes, just connect this 3.3V line to SDA through a resistor ... same for SCL, don't change anything else
lul ok,
don't worry, you can't get the magic smoke out just by adding pull up resistors ;)
hmmm it didnt work just hooking 3.3v onto scl and sda
without resister tho
... don't do that, that could damage the esp! resistors are important!
oh something changed, when i unplug both 3.3v it says ERORR: received NACK on transmit of address but if i connect 3.3v to either one or both i get ERROR: received NACK on transmit of data
@goebish
get same result, when im using 0x23 and 0x5c i thought it maybe could be cause that address was wrong
At least that seems better with the pull up resistors, but I don't understand why you get an error on transmit of data then, the library is only using standard Arduino lib commands, nothing specific to a platform. Have you tried the i2c scanner with pull up resistors ? you can also try to use GPIO 16 & 17 Wire.begin(16, 17); // sda, scl don't forget to change your wiring accordingly
ok, i just tryed running i2cdetect, while have connected the 3.3v's, and it just give a billion errors per mili second, so i guess i need a resistor
There's something I don't understand, are you connecting scl & sda directly to +3.3V ? Never do that! Use resistors or nothing at all, but don't connect directly!
just tryed with a resistor on both with the strength of 15 Ω * 10^5
just got the error with the address
Use resistors between 1k and 30kΩ, not 150kΩ or 1.5MΩ, are you reading my messages?
yep
oh sorry did just catch the 1k - 30k / i forgot it
Did you solder the pins to the boards or do you just push it through? Solder it and check the resistance with a multimeter. If you solder the pins as seen in the picture then it is wrong. (The board itself contains usually the needed pullup resistors)
Yea the pins is soldered, but the board is a esp32, I have a esp8266, but I need it to work on esp32
I'm aware of your board, but I want to know whether the sensor works with another board. The library supports the esp32, I tested it right away and it works flawless.
hmm, which address are you using?
The default one (0x23). I use the lolin32lite, Pin 22 and 21 for i2c.
ye i use pin 22 and pin 21 to, have tryed both 0x23 and 0x5C
To sum it up. Your wiring, your board, your sensor. Not the library.
hm ok
so something is wrong with the wirering?
I think so.
i use the latest arduinoIDE, im not sure what the power rail is, what do you mean with soldered to the wrong side?
my code:
The cabling:
D21 -> SDA D22 -> SCL GND & ADDR -> gnd VCC -> 3.3V