Introducing the ESP8266-12 Module

By November 30, 2015ESP8266, IoT

Don’t let the $2-3 price fool you: there is a lot of functionality packed into the ESP8266-12 module by Chinese manufacturer AI-Thinker.

esp8266_chipThe 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.

esp8266-12e_quarterThere 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”).

ftdiThe 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.

nodemcuAnother 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.

The following two tabs change content below.