I have been playing with a new WiFi module that has recently come onto the market – the ESP8266 Serial WIFI Wireless Transceiver Module – that I found on eBay for about $4. This unit promises a lot and at this price is clearly a bargain if it delivers!
NOTE: There’s tons of information available online and some if it is excellent. However, I found that much of it was either incomplete or assumed the reader had a greater understanding of the module. I’ve tried to collect information that helped me – a novice to the module – to get started. It is drawn from myriad sources and I assume no ownership. Having said that, I tip my hat to the definitive source – the esp8266.com website.
As the module is not breadboard-friendly, I made a simple breakout board to spread the 8 pins of the module connector. Looking at the face of the module, the connector pins are as follows:
(top left) GND, GPIO2, GPIO0, RX
(bottom left) TX, CH_PD, RST, VCC.
For normal operation, Vcc and CH_PD (chip enable) pins are tied to 3.3V with GND to 0v, and TX and RX pins connected to your serial interface of choice (Arduino, FTDI USB interface, etc.). As the module operates at 3.3v, if your serial interface operates at 5v, you will need a level converter in the module’s RX line to prevent over-voltage. A simple resistor divider (1kΩ and 2.2kΩ) or resistor and 3.3v zenner will do the trick. For better performance, use a FET level shifter in both RX and TX lines.
Next, this puppy needs a rock-solid 3.3v PSU, and you not be able to supply it from your Arduino’s 3.3v supply, As it can draw up to 250mA (!) a 78L33-type 3.3v regulator will be dissipating too much power, getting too warm, and pulling the rail down. I designed a meatier one with a 5v and 3.3v power regulator in series (see ESP8266_PSU design files) so that the module could be powered from any supply above 5V. With a beefy supply you will find the operation of the ESP8266 to be more stable.
Now, with the power supply and level shifters, connecting the module’s RX and TX pins to the TX and RX pins (respectively) of an FTDI USB interface allows you to exercise the AT command set (ESP8266ATCommandsSet) and familiarise yourself with its capabilities and operation. Apparently not all versions of the firmware or module board revisions use the same baud rate. Mine used 9600 baud (apparently common to later versions of the board) while others are set to 115200. Whatever, you’ll need to play a bit here. If you’ve just received your module, connect your USB interface and open a terminal (I use CoolTerm and TeraTerm interchangeably) . Initially set the connection baud rate to 9600, transmit to both CR and LF, and receive to ignore framing errors. Now try typing “AT” (no quotes) in the terminal. If all’s well you should see both the TX/TR light of the USB interface, and the little light of the ESP8266 module flicker and see the response “OK” in the terminal. If all’s well, try exercising the AT commands to join your local WiFi network.
Useful ESP8266 references
- Wi07c electrodragon.com
- WiFi Temperature Data Logger
- ESP8266 Community Forum
- ESP8266 WiFi modules on eBay