-->
Page 1 of 2

Connect I2C BMP180 to my NodeMCU DevKit 0.9 ... no reaction

PostPosted: Sun Jan 10, 2016 4:40 pm
by Gawan
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

Re: Connect I2C BMP180 to my NodeMCU DevKit 0.9 ... no react

PostPosted: Sun Jan 10, 2016 4:57 pm
by martinayotte
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.

Re: Connect I2C BMP180 to my NodeMCU DevKit 0.9 ... no react

PostPosted: Sun Jan 10, 2016 5:12 pm
by torntrousers
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.

Re: Connect I2C BMP180 to my NodeMCU DevKit 0.9 ... no react

PostPosted: Sun Jan 10, 2016 5:15 pm
by martinayotte
In fact, on Arduino, I'm using Wire.begin(0, 2);