Ads

Get STM32 tutorial using HAL at $10 for a limited time!

Friday, August 12, 2016

ESP8266 WiFi Module Tutorial 1 - Basic Circuit Testing

ESP8266 is a low-cost SoC (System on Chip) with capabilities for WiFi communication. This SoC contains a full TCP/IP stack and a microcontroller. The CPU in this SoC is a 32-bit RISC CPU: Tensilica Xtensa LX106 running at 80MHz. The WiFi is IEEE 802.11 b/g/n standard and also support WEP or WPA/WPA2 authentication. There are also several peripherals in this SoC: GPIO, SPI, I2C, I2S, UART, and ADC.


There is several WiFi modules that use this SoC. One of these modules is ESP-01 module. This module is manufactured by AI-Thinker. Actually there is other modules that manufactured by this company. The modules are labeled from ESP-01 through ESP-14. To work with this module, we need a serial TTL to USB converter and 3.3 volt power supply. The GPIO pin of this SoC is not 5V tolerant, so you need a voltage level shifter circuit if you want to connect this module to a 5V GPIO.


There is another module that already included the serial TTL to USB converter and 3.3 volt power supply such as NodeMCU.


ESP8266 SoC can be utilized as a standalone system (without any microcontroller connected to it) or with another microcontroller which integrated to it using UART communication. When you buy ESP-01 module, it already programmed with an AT firmware. With this firmware, we can use WiFi communication through UART interface. We can control the WiFi communication using AT command, so we need a serial TTL to USB converter or another microcontroller that has a UART peripheral.


To use ESP8266 as a standalone system, you need an SDK. There is several SDK for ESP8266 such as Espressif SDK (Official SDK for ESP8266), NodeMCU, and Arduino. With Arduino, you can program ESP8266 like any Arduino device.

In this tutorial, I will share how to make a circuit to connect the ESP-01 module to a serial to USB converter or a microcontroller. This is the circuit for connecting ESP-01 module to a serial (3.3V) to USB converter.


If you only have a serial to USB module that operate at 5V voltage level, you can use a voltage level shifter circuit between 5V and 3.3V.


Tx pin of ESP module is connected to Tx pin of serial to USB module and also for Rx pin of ESP module is connected to Rx pin of serial to USB module. If you want to connect ESP module to a microcontroller, Tx and Rx pin must be connected in crossover connection. Tx pin of ESP module is connected to Rx pin of microcontroller and Rx pin of ESP module is connected to Tx pin of microcontroller.

You can't directly mount the ESP module to breadboard because this module use 4x2 pin header, so you need a custom PCB adaptor or use jumper cables instead.


The most common problem I have encountered when using this module is the supply voltage drop from 3.3V to around 2V. This problem usually happens when the voltage source can't provide enough current, so I not recommend you to use a power source from PC USB port, but use external power supply instead. If the problem still occur, you can add a capacitor soldered directly between the VCC and GND pin of ESP module like this:


After the circuit is completed, you can open a serial terminal software on PC. In this tutorial, I will use Hercules terminal. This is the serial port settings for ESP module:
  • Baud rate: 115200
  • Data bit: 8
  • Stop bit: 1
  • Parity: none
Send "AT<CR><LF>" without quotation to the ESP module. If the circuit is correct, the ESP module will give response "OK". Make sure every command is followed with CRLF ending, otherwise ESP module will not response.


You can send another AT command like "AT+GMR<CR><LF>" to check version of the firmware on ESP module.


You can get the documentation for AT command list from this link. On the next tutorial, I will explain how to setup the ESP module as a soft AP and runs a TCP server on it.

5 comments :

  1. This comment has been removed by the author.

    ReplyDelete
  2. Nice blog with very helpful content and very informative and thanks Embedded System Engineering thanks for sharing it.


    High Structure Maintenance Vancouver

    High-Rise Painting Vancouver

    ReplyDelete
  3. It is actually a great and useful piece of information.
    I'm happy that you simply shared this helpful information with us. Please stay us up to date like this. Thank you for sharing."
    data logger Distributor

    ReplyDelete
  4. I feel satisfied to read your blog, you have been delivering a useful & unique information to our vision.keep blogging.

    This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting.

    evs full form
    raw agent full form
    full form of tbh in instagram
    dbs bank full form
    https full form
    tft full form
    pco full form
    kra full form in hr
    tbh full form in instagram story
    epc full form

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete