I2C

I2C can be used to connect up to 127 nodes via a bus that only requires two data wires, known as SDA and SCL.

  • SDA => D2.
  • SCL => D1

SPI

SPI is much simpler than I2C. Master and slave are linked by three data wires, usually called MISO, (Master in, Slave out), MOSI (Master out, Slave in) and M-CLK.

  • M-CLK => D5
  • MISO => D6
  • MOSI => D7

(SPI Bus SS (CS)is D8.)

Complete Pinout

Pin Function ESP-8266 Pin
TX TXD TXD
RX RXD RXD
A0 Analog input, max 3.3V input A0
D0 IO GPIO16
D1 IO, SCL GPIO5
D2 IO, SDA GPIO4
D3 IO, 10k Pull-up GPIO0
D4 IO, 10k Pull-up, BUILTIN_LED GPIO2
D5 IO, SCK GPIO14
D6 IO, MISO GPIO12
D7 IO, MOSI GPIO13
D8 IO, 10k Pull-down, SS GPIO15
G Ground GND
5V 5V -
3V3 3.3V 3.3V
RST Reset RST