-->
Page 1 of 1

Adafruit sensor and non Adafruit ESP8266

PostPosted: Wed Jun 28, 2017 3:32 pm
by fishparalyzer
So I have hit a huge stopping point trying to get an Adafruit Si7021 temp/hum sensor to work with an ESP8266 I bought off Amazon, a HiLetgo NodeMCU ESP-12E. It seems that all the documentation I found to use the Wire.h library to get esp8266 to use the sensor's I2C ports won't work right because Adafruit uses their own library for Si7021 instead of the generic library all the doc's point to.

So my question is this: Does it seem that if your going to use Adafruit sensors you should be using an Adafruit controller? I'm pretty new to Arduino and the like, maybe this is a known rule in the maker community? Any input would be great!

Re: Adafruit sensor and non Adafruit ESP8266

PostPosted: Thu Jun 29, 2017 9:11 pm
by gbafamily1
NodeMCU boards are labelled with pin names like D0, D1, etc. which do not correspond to the GPIO number (that is, D0 is not GPIO0). Use the following diagram to connect the correct pins. I mix and match Adafruit and Sparkfun breakout boards with generic ESP8266 boards all the time.

Image

Re: Adafruit sensor and non Adafruit ESP8266

PostPosted: Fri Jun 30, 2017 1:45 am
by torntrousers
Agree with gbafamily1. It should work ok, are you sure you've connected it to the correct pins. Does an I2C scanner find it?

Re: Adafruit sensor and non Adafruit ESP8266

PostPosted: Fri Jun 30, 2017 2:10 am
by schufti
in any sketch where you find references to "pins" by plain numbers e.g. digitalRead(0) , used on esp8266 this means "gpio0". If you want to change it to the labels on nodemcu you could instead use digitalRead(D3).
So if you see sthg like wire.begin(2,0) this means that your i2c will be on gpios 2,0 or D3,D4 on your nodemcu (the first parameter being datapin the second clockpin).