In this article, we’re going to continue working with Wifi communication with Arduino. Starting with xbee, we’ve worked with various types of Arduino Wifi modules. Now we’re going to build circuits using ESP-WROOM-02, which has a Wifi module onboard and can be used as Arduino MCU.
One of the advantages of this ESP-WROOM-02 is that it can be purchased for less than $10 and that it has a very small form factor. The initial setup may be somewhat challenging, but to have an Arduino with a built-in Wifi at this price (not to mention the possibility of wireless communication in such a small size) is a satisfying reward! Over the next few articles, we’ll build gadgets controlled over Wifi.
There are many possibilities when it comes to building projects with ESP-WROOM-02. For instance, we could build a basic remote-controlled car or a small drone, taking advantage of the module’s small size.
In this article, we’re going to focus on what you need to know in order to set up and use the ESP-WROOM-02.
Estimated Time: 40 minutes
The ESP-WROOM-02 is originally a wifi module with the ESP8266EX chip on-board capable of wifi communication from Espressif Systems, Inc. As introduced in the beginning, the ESP-WROOM-02 has a few unique traits including: small form factor, affordable price, and the ability to write Arduino programs (it can be used as an Arduino) and to communicate over Wifi. For these reasons, more and more people are using this module in their projects.
As noted below, there are many companies that sell this module. Since each company’s version has slightly different specs, you have to be careful of what you buy.
The pin placement on the ESP-WROOM-02 is a 1.5mm pitch so it’s difficult to use it with a breadboard. As a result, some companies sell a breakout board that you can mount the ESP-WROOM-02 on, which converts the 1.5mm pitch to the 2.54mm pitch required for a breadboard.
These are conversion boards and each company’s specs may be different. Again, make sure you do research and pay careful attention to each module’s specs before you buy it.
You shouldn’t have any problem setting it up if you refer to the setup method page on your choice of module company website.
In this tutorial, I’ll be using the ESP-WROOM-02 breakout board from Micro Technica.
Reference: ESP-WROOM-02 sellers
You can also build your own breakout board using PCB design/schematic software like EAGLE.
In order to write Arduino programs to the ESP-WROOM, you need an FTDI -> USB serial adapter to connect it to a PC. For the Arduino UNO we’ve been using, a normal USB cable is fine but the ESP-WROOM-02 requires serial conversion like the Arduino Pro Mini in order to connect to a PC. There are several types of this adapter: 3.3v only, 5v only, and a 3.3v/5v jumper select type. The ESP-WROOM requires 3.3v supply so we need either the 3.3v or the 3.3/5v selection jumper. If you only have the 5v type, you need to use a 5v -> 3.3v LDO voltage regulator discussed in Using Arduino with Parts and Sensors – Solar Powered Arduino (Part 1).
Power can get a little tricky when using the ESP-WROOM-02. If your power source doesn’t provide enough current, this can cause the ESP-WROOM-02 to become unstable. Even if you have the correct voltage of 3.3v, it appears that this chip has instability issues if the current is deemed insufficient. According to the spec, the ESP-WROOM-02 requires a 80 mA current on average. When it’s connected to a PC, the current supplied by the FTDI cable sometimes isn’t enough. In addition, if the power source is from something like the 3.3v pin on Arduino UNO, there are older versions of that board where the 3.3v pin only supplies up to 50 mA of current. So, be careful how you power it!
Now that we’ve covered the basics of the ESP-WROOM-02, let’s get to work so we can actually use this module. In the case of the Micro Technica breakout board I’m using in this article, set up requires soldering and jumper pins. When soldering, the board and pin header have to be joined at a diagonal angle so it’s easier to solder with everything already mounted on the breadboard. That being said, if you take too long soldering, the plastic part of the breadboard can melt, so you need to be careful.
Next, connect pin headers above where H0L – H15L and RST are printed and solder on a jumper and a reset switch.
One thing to be cautious of when purchasing parts is the pitch of the pin headers. The normal breadboard pitch is 2.54mm but the the H0L-H15L & RST parts on the breakout board have a 2mm pitch. So, you have to use a 2mm pitch pin header and jumper.
When using the ESP-WROOM-02, you have to select the right operation mode for your particular usage scenario. On the Micro Technica breakout board, you can change it by switching out the jumper.
|UART Download Mode (Write Mode)||Low||High||Low|
|Flash Boot Mode (Run Mode)||Low||High||High|
|SD-Card Boot Mode||High||Low||Low|
This is the mode for writing the firmware. Since we’re going to write Arduino programs to run on it, we’ll set it to use this mode.
This is “run mode.” In this mode, you can operate the ESP-WROOM-02 using a run mode called AT command.
This mode uses an SD card. We won’t be using this mode in this tutorial.
Since we’re using UART Download Mode, I’ve placed the jumper as shown in Picture 7:
The Reset (RST) part has to be soldered across the three GND pins on the right so you can use switches of various widths.
We’ve finally completed the setup for the ESP-WROOM-02. In the next few articles, I’ll be writing and running some Arduino programs and trying my hand at Wifi communication.
If you have any comments or questions, please leave them for us at Google +. Follow us there; we will be posting more soon.