An ESP8266 module by itself doesn’t really interact with the physical world, but we can change that pretty easily by hooking it up to:
Note: If you are using a Gizwits Witty ESP8266 module, then you can skip this entire section - that module integrates all of the external parts necessary for this tutorial.
In addition to your ESP8266 module, you will need the following:
These parts are all super cheap, so it never hurts to have them laying around. If you don’t already have these parts, I recommend buying a cheap breadboard and component starter kit like this $13 kit from Amazon
The naming of pins for ESP8266 can be a bit confusing - there is the name of the pin within Arduino, the name of the pin inside the ESP8266 itself, and the name of the pin as labeled on the module. For the purposes of our tutorial, here is the mapping between the Arduino pin name, the ESP8266 pin name, and a couple different module pin names
Arduino Pin | ESP8266 Pin | Witty Pin | NodeMCU Pin | Wemos D1 Mini Pin | Sparkfun ESP8266 Thing | Adafruit Huzzah |
---|---|---|---|---|---|---|
A0 | A0 | ADC | A0 | A0 | ADC | A |
4 | GPIO4 | GPIO4 | D2 | D2 | 4 | #4 |
15 | GPIO15 | GPIO15 | D8 | D8 | 15 | 15 |
This is the circuit diagram for the parts we’re using in this tutorial. It assumes you’re using a NodeMCU module and uses the NodeMCU module pin names. If you’re using a different module, substitute pin names and locations as necessary.
If you don’t know what to do with a circuit diagram, here’s an equivalent breadboard diagram showing you how the different parts should be wired together. It also assumes you’re using a NodeMCU module, so if you’re using a different module, substitute pin names and locations as necessary.