I2C communications

You can use your ESP8266 to communicate with I2C devices such as LCD displays, sensors, other microcontrollers, etc.

The four connections required for I2C are +3.3V, GND, SCL and SDA. The pins to use for SCL and SDA are specified in the setup part of the sketch and can be any pair from the range D0 to D7. There may be issues using D8, so avoid using that. Also, if you wish to use the onboard LED, that's on D2, so keep that free.

Exclamation mark

You need to be careful if you're connecting 3.3V devices, like the ESP8266, to 5V devices such as an Arduino. You will need a logic level shifter to convert the 3.3V signals to 5V and, more importantly, back again to protect the ESP8266. Logic level converter These converters are usually SMD but are purchased more easily as a single ready-to-use PCB. Prices start from about £1.50 excluding P&P and are available from Adafruit, Proto-Pic and other similar suppliers. Not all boards have the same connections and so are not immediately interchangeable though the PCB labelling does seem to be reasonably consistent.