-->
Page 1 of 2

CORRECT I2C CONNECTION WITH ARDUINO SHIELD

PostPosted: Fri Sep 04, 2015 7:39 pm
by cescoferraro
I am trying to use this arduino shield with a nodemcu v1.0 that runs with a esp8266 12E. I usually use it with an arduino uno seamlessly, it only uses 2 pins[A4 - A5] to communicate through I2C.

So here I am messing with my first 3.3v board and wondering whats would be the best way to connect an nodemcu/Esp8266 with the 5v logic I2C chip? I was thinking of trying to use a logic level converter by connecting them like this
Is this wrong by any means? According to the arduino/Esp8266 reference on GITHUB I2C pins are on gpio 4(SDA) and 5(SCL).

Re: CORRECT I2C CONNECTION WITH ARDUINO SHIELD

PostPosted: Sat Sep 05, 2015 1:44 pm
by eriksl
Google for mosfet i2c level shifter. That is what you need. In some shops you can buy a break-out-box with the two mosfets on it, but it's just as easy to build one yourself, it's only two mosfets.

Re: CORRECT I2C CONNECTION WITH ARDUINO SHIELD

PostPosted: Sat Sep 05, 2015 4:26 pm
by martinayotte
Yes, as simple as the following image. Also, GPIO4/GPIO5 are default pins but any other GPIOs works well too, I'm personally using GPIO2/GPIO0 since they needs pullups any ways for the boot process.
Image

Re: CORRECT I2C CONNECTION WITH ARDUINO SHIELD

PostPosted: Sun Sep 06, 2015 12:57 am
by lethe
If you have a look at the schematic, you'll find that this board is basically just a MCP23017 and a bunch of mosfets.
Since the MCP23017 will work fine at 3.3V, the only issue are the mosfets used (they really could have used better ones, especially at that price point). The 2N7002 n-fets used on the board have a max. threshold voltage of 3V (which is not ideal), but they should be good for switching about 50mA at 3V.
So as long as your relay coils draw less than 50mA (or you use additional FETs to drive them), you should be able to power the board with 3.3V and eliminate the need for a level shifter (and an additional 5V supply in your project).