Getting Started with ESP8266 WiFi TransceiverBitahwa Bindu
The ESP8266 is a wonder WiFi module that can literally give any microcontroller access to WiFi network and thus enabling countless Internet of Things (IoT) and Home Automation applications at a fraction of cost compared to the alternative options.
It’s easy to use, it’s popular, it has stormed the world of makers in recent years since 2014, you can now build your own cool electronic application that communicates to the internet and can be accessed from anywhere in the world as WiFi is very convenient to use to build connected applications especially for Home automation.
Before this sounded very complicated and expensive, but now thanks to this ESP8266, a low cost small size self contained system on chip (SOC) with integrated TCP/IP protocol stack and a 32-bit microcontroller manufactured by Espressif, a Shanghai based Chinese manufacturer.
ESP8266 WiFi module Features
- 802.11 b/g/n
- Integrated low power 32-bit MCU
- Integrated 10-bit ADC
- Integrated TCP/IP protocol stack
- Integrated TR switch, balun, LNA, power amplifier and matching network
- Integrated PLL, regulators, and power management units
- Supports antenna diversity
- WiFi 2.4 GHz, support WPA/WPA2
- Support STA/AP/STA+AP operation modes
- Support Smart Link Function for both Android and iOS devices
- SDIO 2.0, (H) SPI, UART, I2C, I2S, IR Remote Control, PWM, GPIO
- STBC, 1×1 MIMO, 2×1 MIMO
- A-MPDU & A-MSDU aggregation & 0.4s guard interval
- Deep sleep power <10uA, Power down leakage current < 5uA
- Wake up and transmit packets in < 2ms
- Standby power consumption of < 1.0mW (DTIM3)
- +20 dBm output power in 802.11b mode
- Operating temperature range -40C ~ 125C
- FCC, CE, TELEC, WiFi Alliance, and SRRC certified
ESP8266 WiFi module Applications
This WiFi module can be used in various IoT and Home Automation Applications, with it you can create a web server, send/access data with HTTP, send emails, post tweets etc. Here are some few major applications:
- Home Automation
- Industrial Wireless Control
- Baby Monitors
- IP Cameras
- Wearable Electronics
- Security ID Tags
- WiFi weather measurement stations
The pin assignments for 32-pin QFN package is illustrated in Figure 1 below:
Figure 1: ESP8266 pin assignments
You can read more about this chip and the functions of each pin from the ESP8266 datasheet.
Several manufactures have incorporated this ESP8266 chip in their hardware products. There are many versions of the ESP8266 chip, available as modules on small boards with different functionalities and exposing different input/output pins made by Espressif and third-party manufacturers like AI-Thinker, Olimex, Adafruit, SparkFun etc. This can be very confusing especially for beginners to find the correct one. But all are based on the same chip and can do basically the same functions, the difference is usually the number of input/output pins available on the board. There is no difference in programming, so choose the correct one based on your requirements.
The most popular are the ESP-xx series from AI-Thinker with the ESP-01 and ESP-12 the most popular.
This is the most famous of all, it’s really cheap, it can cost you about $5, but the number of input/output pins are very limited and they are not breadboard friendly. You’ll have to use some kind of adapter. Figure 3 below shows the pin-out of the ESP-01
- VCC: +3.3 V power supply. Please note that this chip operates with +3.3V external power supply and all its inputs and outputs as well. Any power higher than this like +5V could damage it.
- GND: Ground pin
- TX: UART transmit pin used to transmit serial data to other devices like a PIC microcontroller, Arduino or even to your PC with a TTL to USB converter.
- RX: UART receive pin used to receive serial data from other devices.
- GPIO0: General Purpose Input/Output pin 0. This pin as dual functions, one for normal GPIO operation and for enabling the programming mode of the ESP8266.
- GPIO2: Input/Output pin 2
- RESET: Reset pin and it is an active low pin.
- CH_PD: Chip enable pin. It’s an active high and it is usually connected to 3.3V.
The ESP-12 has got more pins. So you’ll be able to access 10-bit ADC pins which take 0 to 1V as input. You can easily use it in your own board or easily solder some header pins to it.
Figure 4: AI-Thinker ESP-12
The Olimex MOD-WIFI-ESP8266-DEV is also one of third party modules that gives you access to all pins of the ESP8266 and can easily be mounted on a breadboard.
Figure 5: Olimex MOD-WIFI-ESP8266-DEV
With PCB manufacturing becoming more and more cheaper these days, one of the options is to incorporate one of the ESP8266 modules into your own design, modules that expose all or most of the pins like the ESP-12 or the Olimex MOD-WIFI-ESP8266-DEV can be used. You can thus build your own ESP8266 based development board, a Home Automation module or an IoT node station for example by simply adding more components to your design like the required 3.3V power supply, some relays, sensors, connectors and header pins and even an incorporated TTL to serial converter for easy programming.
This is what we’re gonna do next, we are going to use the Olimex MOD-WIFI-ESP8266-DEV and incorporate it into our EasyESP8266 IoT Dev Board, a simple Open source hardware with ESP8266, a 3.3V power supply, a button for selecting the booting mode of the board, a relay that can be used for Home Automation applications and some header pins for easy access.
The PCB will be manufactured by PCBWay, a low cost PCB prototype and Assembly company based in china. They produce good quality PCB at a reasonable price. You can get 5 PCBs (100mm x 100mm or smaller), 1 or 2 layers and choose the PCB colour of your choice from Red, Blue, Green, Black, Yellow and white for only $5 USD. Not many PCB companies offer these Solder Mask colours for free, they normally charge you extra for any colour beside the standard green.
To learn more, and place your PCB order online (first buyers will get $5 USD for free that you can use for your first order), please visit their website, click on the logo below:
A dedicated 3.3V power supply capable of to deliver at least about 300mA is required. Even though the ESP8266 can operate in sleep and deep sleep mode where power consumption is very low, it can consume some high current during programming mode, so don’t power it from the TTL to USB connector or from your Arduino board.
You can use the LM317 a cheap variable voltage regulator to build your own 3.3V power supply as explained in this article: