How to Launch Your ESP8266 WiFi Module into AT-MODE Using Arduino Uno
Over the last decade, “Internet of Things” has been the hottest topic among geeks and techies. On the other hand, searches for the most cost effective WiFi Modules have also increased significantly. A WiFi Module in the IoT architecture provides internet connectivity. It enables logging of data from sensors to the cloud or IoT platforms. ESP8266 WiFi Module happens to be the WiFi Module in every tech enthusiast’s cart.
Why use ESP8266 WiFi Module?
The ESP8266 WiFi Module has become increasingly popular among techies and DIYers mainly because of the following reasons:
- Low cost – it costs less than $10
- Small size – ESP8266 WiFi Module is chip-sized
- Robust – has full TCP/IP stack with microcontroller capability. It features a ultra-low power 32-bit microcontroller.
- Ultra-low power device – the module consumes 12µA in sleep mode and about 1.0mW in standby mode
Thus far you might be wondering the connection between this WiFi module and AT commands or why you need to launch it into AT Mode. The thing is, Modems are controlled using AT commands. That means that if you want to control the ESP8266 WiFi Module you need to learn its AT commands. You will also need to know how to launch it into AT Mode. There are numerous articles and videos out there teaching how to incorporate the WiFi Module into your engineering project. However, most of them don’t go to the nuts and bolts about how to get your module into AT Mode. Launching your module into AT Mode allows you to modify its default settings to your own custom settings. The beauty of this mode is that you get the responses to each AT command issued to your module command back on your serial monitor. This allows you to understand what each command does and what kind of responses to get. This comes in handy, especially when debugging the module.
How do we get ESP8266 WiFi Module into AT Mode?
There are a number of approaches to this but we shall explore one; Using the Arduino Uno board.
Using Arduino Uno to get ESP8266 to AT Mode
Arduino Uno is a common prototyping board that most DIYers and hobbyists use to create both simple and sophisticated projects. I am sure you might have used it by now or are planning to use it in your next project. The point I am trying to put across here is that an Arduino board (preferable the Uno) can be used to debug your ESP8266. The procedure is as follows:
- Install the Arduino IDE to your PC
- Plug in your Arduino Uno to the USB port of your PC
- Connect the ESP8266 WiFi Module to your arduino as follows:Arduino Uno ESP8266 WiFi Module
RX (Pin 0) RX
TX (Pin 1) TX
VCC (3.3V) VCC , RST, CH_PD
- Open the Arduino IDE and load a new blank sketch file into you Arduino. (First, you will have to detach the RX and TX wires from the Uno in order to free up the UART port so that the empty sketch can be uploaded).
- Reconnect the Wires to the Tx and Rx then open the serial monitor.
- Change the baud rate of the serial monitor to 115200 then send AT commands.
- To determine if the module is properly connected and that the correct baud rate has been set, write
ATon the serial monitor and click send.
- If the response is
OK, then your device is in AT Mode. If it responds some gibberish, then you need to try another baud rate until and resend
ATuntil you get the
OKresponse as illustrated in the figure below.
How to Change the Baud Rate of ESP8266 WiFi Module
Now that you are in the AT Mode of you WiFi Module, I know you can’t wait to start tweaking some default settings. Using a unique baud rate for your module is definitely a pain. Therefore, I would like us to change it to 9600 (common baud rate for many applications). There are two alternative commands that can be used to achieve this:
When the first command returns an error message on your serial monitor, you can try the second one. The one that returns OK is the one that works for your ESP8266 firmware version! See how I changed did it in the image below…
In the next article, we shall explore how to communicate to the ESP8266 WiFi module serially using a different serial monitor with help of a USB-to-UART converter. I wish you have fun as you explore the WiFi Module and as you try various other AT commands.