Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Getting started with ESP8266

By Nikhil Agnihotri

ESP8266, a System-on-Chip (SoC) manufactured by ESpressif, is the most popular IoT development platform is a complete and self-contained Wi-Fi networking solution. The SoC consists of a Tensilica L106 32-bit microcontroller and a Wi-Fi transceiver. Therefore, the chip can be used to self-host an IoT or embedded application or offload Wi-Fi networking functions to another microcontroller or single-board computer. There are many ESP8266-based development boards. All these boards have the ESP8266 SoC chip at their heart. These development boards can be used as either only a Wi-Fi adaptor or as a single-board microcontroller with Wi-Fi networking capabilities.

ESP8266 Development Board

Example of ESP8266 Development Board

The on-chip microcontroller itself provides 17 GPIO (General Purpose Input/Output) and one 10-bit ADC analog input. The SoC has four PWM interfaces that are software-enabled only. The chip is enabled with one SPI interface, one I2C interface, two UART interfaces, and one IR remote control interface for serial data communication. So, a carefully selected ESP8266 development board has everything that any capable single-board microcontroller must-have. The additional Wi-Fi networking capability allows an ESP8266-based development board to connect with a Wi-Fi network, connect with the internet, host a web server, and implement full-fledged Wi-Fi-enabled IoT applications.

When self-hosting an embedded/IoT application, the SoC requires an external flash to boot it directly. When used as a Wi-Fi adapter, the chip can be connected to a single-board microcontroller or single-board computer using SPI, I2C, or UART.

The ESP8266 SoC is designed for ultra low power technology. It is designed considering applications in wearable electronics, mobile, and the Internet of Things. The chip can operate in three modes – active, sleep, and deep sleep. In deep sleep mode, the chip consumes only 60 uA, and in sleep mode, it consumes less than 1.0 mA and 0.5 mA while staying connected to a Wi-Fi access point. The SoC has a built-in real-time clock and watchdog timer, which remain active in the sleep mode. The built-in RTC can be programmed to wake up the ESP8266 at any required interval or when a specified condition is detected. This way, an ESP8266-based device can be programmed to remain in a low-power standby mode until Wi-Fi is needed.

ESP8266, a low-power WiFi-enabled microcontroller solution, is perfect for designing battery-powered wearable electronics and portable/mobile IoT devices.

ESP8266 features

Some of the most notable features of ESP8266 SoC are as follows.

  • 11 b/g/n
  • Wi-Fi 2.4GHz with WPA/WPA2 security
  • Wi-Fi Direct (P2P station), SoftAP, SoftAP+station
  • Built-in TCP-IP protocol stack
  • Support IPv4, TCP/UDP/HTTP/FTP network protocols
  • Antenna diversity (External, PCB trace, Ceramic chip, IPEX connector)
  • Support STA/AP/STA+AP operation modes
  • GPIO, SDIO 2.0, SPI, I2C, UART, I2S, IR Remote Control, PWM
  • Built-in 10-bit ADC
  • Built-in TR switch, balun, LNA, power amplifier, and matching network
  • Built-in power regulator, PLL, and power management units
  • Support smart link for both Android and iOS devices
  • Configurable via AT instruction set, Cloud Server, Android, and iOS Apps
  • Support Cloud Server Development as well as SDK for custom firmware development
  • Firmware can be upgraded through UART download as well as OTA (via Wi-Fi network)
  • Support WEP/TKIP/AES encryption
  • Integrated low-power 32-bit microcontroller
  • Low power consumption, less than 10uA in deep sleep and void access point
  • Wake up and transmit packets in less than 2 ms
  • Wide operating temperature range -40˚C to 125˚C

ESP8266 modules

There are several ESP8266-based modules. These are either stand-alone modules or complete development boards. The stand-alone modules generally contain only the ESP8266 SoC and the components required to run it. Most stand-alone modules are available as ESP-NN (ESP01 to ESP14) series from the AI-Thinkers vendor. A stand-alone module ESP-WROOM-02 is available from Espressif itself. Other stand-alone modules are available from other vendors like Wireless-tag, Olimex, Smarttime, and Qilianer. The following table lists and compares the available stand-alone ESP8266 modules.

These stand-alone modules serve as only a Wi-Fi adaptor or a Wi-Fi-enabled microcontroller development board. These modules vary in size, pins are broken out, exposed on-chip features, antenna type, and flash memory. A bare-bones ESP8266 SoC requires an external flash memory, reset and program circuitry, chip enabling circuitry, 3.3 voltage regulator power supply, and a USB-to-Serial adapter. All of these required features may be onboard in a module, or some may be required to be provided externally.

The ESP8266-based development boards have all the required circuitry with or without a USB interface for programming. Some popular ESP8266 development boards are available from Adafruit, SparkFun, NodeMCU, and AI Thinkers. The following tables lists notable features of some of these ESP8266 development boards.

ESP8266 development boards can be divided into two categories:

  1. ESP8266 Development boards with USB interface: These development boards have a USB interface for programming. They have all the required circuitry onboard and do not require any external circuit setup. Some examples of such development boards include SparkFun ESP8266 Thing, Adafruit Feather HUZZA, SparkFun Blynk Board, and some of the AI Thinker ESP-NN boards. When such boards are connected to a desktop computer via USB cable, they show up in device manager on Windows PC or in lsusb on a Linux system. They have an onboard 3.3V regulator and can be programmed directly via a USB interface. Such development boards do not require any external circuit for setup and operation. At most, one may need to solder header pins or get the header already soldered.
  2. ESP8266 Development boards without USB interface: These development boards require a USB-to-Serial adaptor for programming. The board may have a 3.3V regulator or may not even have that. Apart from the 3.3V regulator and USB-to-Serial adaptor, the board requires an external circuit to enable the chip and add a reset and programming button.

The USB-to-Serial converter must operate at 3.3V. If the USB-to-Serial adaptor operates at 5V, it will damage the ESP8266 development board. The most popular USB-to-Serial adaptor used with ESP8266 dev boards is FTDI FT232RL, as it can be switched between 5V and 3V3 operation.

To connect USB-to-Serial adapter with ESP8266 dev board, connect ground, RX-pin, TX-pin, and DTR pin (if available) of USB-to-Serial adaptor to ground, TX, RX, and DTR pins of the ESP8266 chip.

If the ESP8266 development board does not have an onboard 3.3V regulator, the 3.3V supply can be provided either through Arduino’s 3.3V out or using LM1117-3.3. The 3.3V output of most of the Arduino boards is not powerful enough to drive an ESP dev board. Therefore, it is best recommended to supply power via LM1117-3.3. LM1117-3.3 must be connected as follow to supply power to an ESP8266 board.

Circuit diagram of LM1117 3.3V voltage regulator for ESP8266 board.

 

Circuit diagram for resetting, enabling, and programming ESP8266.

To enable the ESP8266 chip, connect CH_PD (Chip Enable/Chip Power Down) pin to VCC through a 10K resistor. Disable SD card boot by connecting GPIO15 to ground through a 10K resistor. Select normal boot mode by connecting GPIO0 to VCC through a 10K resistor. To avoid random reset, connect RST pin to VCC through 10K resistor. The GPIO2 must remain not connected. Connect a push button between the RST pin and ground to add a reset button. Connect GPIO0 to ground through the 470Ω resistor to add a program button. The GPIO0 must be pulled low when programming the ESP8266. The chip enables, reset, and programming circuit for ESP8266 development board is shown below.

Programming ESP8266 development boards

Programming ESP8266 development board requires loading firmware to it. There are broadly three methods for programming ESP8266 development boards. There is not one but several ways ESP8266 development board can be programmed.

  1. Using Arduino IDE – Arduino provides a third-party plugin to use Arduino IDE for different CPUs. It uses the Xtensa GCC toolchain, available at Github as esp8266/Arduino. It also provides ESPTool to upload hex files (sketches/application codes) to the ESP8266 SoC. Once the board manager URL is added to the IDE’s preference setting menu and the ESP8266 board is installed through Tools->Boards->Board Manager, the code for the ESP8266 development board can be written, edited, compiled, and uploaded from the Arduino IDE like it is done for the Arduino boards.
  2. Setup the GCC Toolchain and SDK manually: An open-source toolchain for ESP8266 development boards is available on Github. This toolchain can be used to build a custom firmware file for yourself. The toolchain only runs on a Linux host or can be run on other desktop systems using a Linux virtual machine.
  3. Using pre-built custom toolchains: Some pre-built custom toolchains are available that can be directly downloaded as ESP8266 firmware, and then sketches (application codes) can be flashed to ESP8266 for that firmware. Some of the popular toolchain for ESP8266 development boards are as follow –
  • Espressif firmware source
  • Electrodragon’s ESP8266 AT-command firmware
  • Espressif AT command firmware
  • NodeMCU firmware for running LUA scripts on ESP8266
  • MicroPython firmware, for running Python 3 scripts on ESP8266 and several other microcontrollers
  • Moddable SDK for running 2020 standard Javascript on ESP8266, ESP32, and some other microcontrollers
  • ESP8266Basic, a basic interpreter for browser-based development on ESP8266

ESP8266 applications

ESP8266 is a powerful Wi-Fi networking solution with single-board microcontroller features. It is best suited for mobile, wearable, and IoT devices. There are several ESP8266 development boards available, and they can be programmed using different toolchains. Different toolchains allow programming ESP8266 development boards in several programming languages like C, Python, Javascript, LUA scripting, and AT commands. Some of the possible IoT applications using ESP8266 development boards are home automation, mesh network, IP cameras, baby monitors, wearable electronics, industrial wireless control, security ID tags, sensor networks, Wi-Fi location-aware devices, Wi-Fi position system beacon, smart plug, and lights, internet-controlled home appliances, etc.

Design considerations with ESP8266

There are a few factors that must be considered before selecting ESP8266 development boards for WiFi-enabled IoT applications –

  1. ESP8266 operates at 3.3V, even a supply of 5V can kill the SoC. The GPIO of the ESP8266 can only source or sink 12 mA per output pin. So, ESP8266 is suitable only for low-power IoT applications.
  2. The voltage range of ESP8266’s analog to digital converter is only 0~1V. This limits the use of ESP8266 in the field of analog sensing.
  3. The ESP8266 shares the CPU time and system resources with the Wi-Fi transceiver. Therefore, the application code should not have long loops that never complete execution. So, ESP8266 must be used for specified IoT applications.
  4. The PWM and I2C on ESP8266 are emulated in software. There is no dedicated hardware for them.

You may also like:


  • Designing ESP8266 Weather Station Using OpenWeatherMap
  • ESP8266 projects
    Top 3 most recommended ESP8266 projects

  • ESP8266 WIFI HOTSPOT

  • Open WiFi Scanner using Esp8266

  • Esp8266 Programmed in Arduino Ide using ft232 programmer and Arduino

Filed Under: Applications, Featured, IoT, Tech Articles
Tagged With: esp8266, ESP8266 SoC
 

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Op amp non inverting amplifier not working
  • Making a ducted soldering fan?
  • Characterization values of a MOSFET in PDK
  • USBASP Programmer Mod
  • Measure AC current accurateley (100mA to 10A)

RSS Electro-Tech-Online.com Discussions

  • Need a ducted soldering fan for solder smoke extraction
  • How to search component to replace my burn RF inductor?
  • Question about ultrasonic mist maker
  • Someone please explain how this BMS board is supposed to work?
  • bluetooth jammer
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering