Fun with the ESP8266 SoC
Can texting be leveraged for use in IoT Wi-Fi devices? Jeff has been using Wi-Fi widgets for a lot of IoT projects lately. This month Jeff lays the groundwork for describing a project that will involve texting. He starts off with a look at Espressif System’s ESP8266EX SoC.
By Jeff Bachiochi
Believe it or not, texting while driving as of this writing is still legal in a few states. About 10% of all motor vehicles deaths in the US can be traced back to distracted drivers. Granted that includes any distraction—however cell phone distraction has quickly become a serious issue. While hazards exist for any technology, common sense should tell you this is a dangerous act.
When the technology is used correctly, texting can deliver essential information quickly—without requiring both (or many) parties to be active at the same time. This allows you to make better use of your time. I still use email for much of my correspondence, however it’s great to be able to send your spouse a text to add milk to the grocery list—after they’ve already left for the store! And even though I chuckle when I see two people sitting next to each other texting, it is a sad commentary on emerging lifestyles.
I’ve been using Wi-Fi widgets for a lot of IoT projects lately. The cost to enter the fray is low, and with free tools it’s easy to get started. This month’s article is a about a project that will involve text, even though that may not be apparent at first. Let’s start off slowly, laying the groundwork for those who have been thinking about building this kind of project. We’ll then quickly build from this foundation into crafting a useful gadget.
A Look at the ESP8266EX
The innovative team of chip-design specialists, software/firmware developers and marketers at Espressif System developed and manufactures the ESP8266EX system-on-chip (SoC). This 32-bit processor runs at 80 MHz and embeds 2.4 GHz Wi-Fi functionality—802.11 b/g/n, supporting WPA/WPA2—as well as the normal gamut of general-purpose I/O and peripherals. It has a 64 KB boot ROM, 64 KB instruction RAM and 96 KB data RAM. Their WROOM module integrates the ESP8266 with a serial EEPROM and an RF front end with a PCB antenna for a complete IoT interface.
Anyone who has ever used a dial-up modem is most likely familiar with the term AT command set. The Hayes command set is a specific command language originally developed in 1981 by Dennis Hayes for the Hayes 300 baud Smartmodem. Each command in the set begins with the letters AT+ followed by a command word used for high-level control of internal functions. For the modem these enabled tasks like dialing the phone or sending data. As an application for the WROOM, an AT command set seemed like a perfect match. This allows an embedded designer to use the device to achieve a goal without ever having to “get their hands dirty.”
I first learned of the ESP8266 years ago and purchased the ESP-01 on eBay. It was around $5 at the time (Photo 1). I used it along with the MEGA 2560—my favorite Arduino module because of its high number of I/Os and multiple hardware UARTs. With the ESP-01 connected to a serial port on an Arduino, an application could directly talk with the ESP-01 and get the Arduino connected to your LAN. From this point, the world is under your control thanks to the AT Wi-Fi and TCP commands.
The ESP8266 literature states the Wi-Fi stack only requires about 20% of the processing power. Meanwhile, 80% is still available for user application programming and development.
So why not eliminate the Arduino’s Atmel processor altogether and put your Arduino code right in the 8266? Espressif Systems has an SDK and while it provides a development and programming environment, the Arduino IDE is comfortable for many. And it offers the installation of third-party platform packages using the Boards Manager. That means you can add support for the ESP8266EX and use much of the code you’ve already written.
Using the ESP-01
Since the ESP-01 has only 8 pins, adding the necessary hardware is pretty simple. This low power device runs on 2.5 V to 3.6 V, so you must make appropriate level corrections if you wish to use it with 5 V devices like Arduino boards. …
Read the full article in the March 332 issue of Circuit Cellar