Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Gawan
#38448 Hi,
I have a NodeMCU DevKit 0.9 and a BMP180 barometric pressure sensor and I am working in Arduino IDE (no lua)
I would like to connect them and send data to my local server.

The sensor works will on my Arduino UNO, there I can use the I2C scanner, all example sketches ... everything is fine.

But as soon as I connect it to the NodeMCU I do not get any reaction at all. The I2C scanner finds nothing, no measurement is done.

I am afraid that I am not using the right SDA and SCL ports on my NodeMCU.
On the internet I found:
- SDA/SCL are GPIO2/ GPIO0
This is Pin3 and Pin4 on my NodeMCU - does not work

Can somebody please tell me the right pins for this ?

BR
Gawan
User avatar
By martinayotte
#38452 I'm using NodeMCU firmware, but according to https://github.com/nodemcu/nodemcu-firm ... /README.md
I2C connection

Hook up SDA and SCL to any free GPIOs. Eg. u8g_graphics_test.lua expects SDA=5 (GPIO14) and SCL=6 (GPIO12). They are used to set up nodemcu's I2C driver before accessing the display:

sda = 5
scl = 6
i2c.setup(0, sda, scl, i2c.SLOW)

But it all depends of firmware/application along your wiring.
Also, don't forget to add some pullup resistors to both lines.
User avatar
By torntrousers
#38453 I don't remember what the default SDA/SCL pins are but you can set them by at the start of your sketch by calling Wire.pins(0, 2); which sets SDA to GPIO-0 and SCL to GPIO-2. That function is deprecated so you get a warning during compile but it still works fine.