The ESP8266EX itself is a System on Chip (SoC) produced by another Chinese manufacturer, Espressif. Within this tiny 5mm TSLP package is:
- a 32-bit 80 MHz microcontroller based on the Tensilica LX106
- 64 KB of Instruction RAM, 96 KB of data RAM
- Built-in 2.1 GHz 801.11 b/g/n Wi-Fi interface (TR Switch, Balun, LNA, Power Amplifier, and Matching Network)
- 17 GPIO pins with internal pull-up/pull-down resistors and snap-back circuits to protect from ESD and over-voltage
- A single 10-bit ADC (0 – 1.0 VDC)
- 120-170 mA typical power draw when transmitting, 50-56 mA when receiving, 15 mA with Wi-Fi off, and 10 uA when in deep sleep
- and support for SPI, I2C, I2S, SDIO, IR (Remote Control), PWM, and UART
Espressif also maintains official SDKs for their platform (more on that in a later post).
What AI-Thinker did was produce a self-contained module that pairs the ESP8266EX with a SPI Flash memory chip, along with the few external resistors/capacitors and crystal needed to operate, and an antenna. They are not the only module manufacturer (even Espressif has started making their own module, known as the WROOM), but their modules are by far the most widely available.
There are about 13 different types of ESP8266 modules currently produced by AI-Thinker, each differing by the number and configuration of pins, antenna type, and flash memory size. But, the most popular of the bunch lately seems to be the ESP8266-12 family.
Note: There are revisions within this family that slightly improve on the previous designs, such as the ESP8266-12E and the most recent ESP8266-12F, but they are all, for the most part, identical in functionality.
This 24mm x 16mm module includes:
- 4 MB SPI Flash
- 2×8 castellated PCB (plus an additional 6 pins on the E and F revisions, primarily intended for direct access to the Flash memory during manufacturing)
- PCB trace antenna
- Blue LED to indicate Wi-Fi activity
- FCC/CE certification
So, even though Espressif makes the chip that powers it, most people will be referring to the AI-Thinker module when they use the term “ESP8266”.
Getting Ready to Prototype with the ESP8266
Prototyping is the process of temporarily wiring up different electronic components in order to test how they work together in a circuit. This is often done using breadboards, many colorful wire jumpers, and sometimes even a little bit of profanity and pleading for the circuit to work.
The castellated PCB form factor and its 2mm pitch means that it cannot be used out of the box in normal breadboard prototyping fashion. So, right away, a hobbyist will need to find a way to mount the module to something a bit more breadboard-friendly. There are prototyping boards readily available that permit someone with even basic soldering skills to attach the module onto a PCB along with header pins. These are often sold as kits along with an ESP8266-12 module for under $3 from Asian sellers on eBay (search for “ESP8266 Adapter”).
The ESP8266EX chip itself requires 3.3V power – something that contributes to its low power consumption. However, this is kind of a pain for the hobbyists (especially for those coming from Arduino), because 5V power is all too common. So, another hurdle is figuring out how to power the module.
Luckily, this has also been solved in many ways. Sometimes the adapter PCB will include a 3v3 regulator, so you can provide 5V and it will provide 3.3V to the ESP’s VCC. Or, something that I’ve been using a lot lately is a small USB-to-TTL converter based on the FT232RL chip that has a selectable 5V or 3V3 output. This draws power from my USB port, and also serves as a serial port interface, too, for when we get to actually programming the thing.
There is a lot to be said about convenience, though. So, instead of soldering a module to a breakout board and then powering it from another device, I recommend just buying a pre-built development board in order to get started. These boards come with an onboard 3V3 voltage regulator, some sort of serial interface, and header pins that are breadboard compatible. They are usually connected to your USB port for power and communication.
Adafruit makes a nice one called the ESP8266 Huzzah, which sells for $10. This requires a FTDI interface (like the one mentioned above with the selectable voltage) or a USB-to-TTL cable, because the input is a row of header pins used for serial port connections.
Another very common board is actually an open source hardware design known as the NodeMCU Development kit. These devices sport an onboard USB-to-serial adapter, so you only need a USB cable to connect both power and the serial connection. Because of the open source design, it is common to find many different colors and sizes of these boards for sale by different companies. Expect to pay anywhere from $5-10 for these, depending on the seller’s location (Asian locations are far cheaper, with the tradeoff being the time required to ship overseas, which has been between 5-10 days in my experience). I personally have purchased all of my NodeMCU devices from Banggood.com, but also frequently see these for sale on eBay.
The ESP8266’s hardware is certainly impressive for the price, and getting a unit ready for prototyping is neither hard nor expensive. But, the real magic happens when you write software for the device. We’ll start to explore that in the next part of this series by taking a look at firmware.
Latest posts by Falafel Posts (see all)
- Matching Complex Query String Rewrite Rule in IIS - March 22, 2017
- Disable Content Filters in Sitefinity - March 8, 2017
- On Sitefinity Custom Widget Caching - February 22, 2017
- Dynamic Content Detail Widget Templates in Sitefinity - February 8, 2017
- Using Google Services in UWP C# Apps – Part 2 - February 7, 2017