Note: this article is still under construction! There is a new version (v2) of this board with pin-spacing that is more convenient for use with breadboards (also available from other suppliers).
For some time now I observed a buildup of the buzz around the ESP8266 IoT devices. I only recently started with exploring microprocessors (uP’s) in more depth (Arduino family, TI TM4C123G and MSP430 Launchpads). I first saw the ESP8266 mentioned as a Wifi add-on device to these uP’s, however last months more and more standalone applications for these great little devices popped up in various articles. So I decided to buy a few and start experimenting with them. So this article is written from a beginners perspective.
Because these devices are so cheap (less then $3 on sites like eBay) I decided to buy a few of them so I could build multiple devices and applications. Also because I like to start the easy way I decided to buy a few development boards also. These boards are suited for use on a breadboard and have more GPIO pin breakouts than the ‘standard’ ESP8266 devices.
While investigating the possible options for the different ESP8266 based boards I wrote an article explaining the different available form factors for these boards (still to be published)
Besides some standard ESP-01 form factor boards I also ordered an ESP-07, and ESP-12 with and I/O adapter plate, and 2 development boards:
- Lua Nodemcu ESP8266 Based WIFI Network Development Board ($ 8,95 from eBay)
- ESP8266 Wireless Wifi Module Develop Board 8266 SDK Development Chip with the cable ($15 from aliexpress)
I ordered with different sellers on eBay and AliExpress. I was used to waiting for several weeks when ordering from Chinese web-shops, however this time the goods from 2 eBay sellers arrived within 8 days!
As the development boards and boards with I/O adapter plate have pin’s spaced at 0.1 inch (2.54 mm) I expected them to be suitable for breadboard experiments. Unfortunately the ESP-07 and ESP-12 based ones did not come pre-soldered, so I had to solder the ESP-8266 and the headers onto the I/O adapter plates. Fortunately the Lua Nodemcu development board did come with the headers soldered on so I expected I could start immediately experimenting.
However it turned out that the spacing of the rows of the boards was at 1 inch, so the width of the boards would cover all available holes in the terminal strips of the breadboard. So I started off using jump wires to connect the boards to the breadboard and other components directly.
The development boards have a micro USB connection that can be used for direct communication with the device from a computer, so there is no need to have a USB-to-TTL dongle available separately. For a first prototype I decided to try to build a fairly standard DS18B20 based temperature sensor IoT device first.
The first hurdle when starting with such a board is getting a serial connection to the board. When I plugged in the board I saw in device manager the dreaded yellow exclamation mark indicating no suitable driver was found. It turns out the board uses a CH340G USB/UART converter chip. I downloaded the driver from arduined.
Once the driver is installed you can obtain the assigned serial COM port number via the device manager (available in the control panel). It should be possible to connect via this COM port to the LUA interpreter running on the ESP8266 using your favorite terminal emulator program. Most boards are configured for 9600 baud (1 startbit, 8 data bits, no parity). If you don’t get any prompt it might be that there is no firmware on the devboard, or the firmware uses a different baud rate. Just try some settings untill you get a response.
An easy way to communicate with the LUA interpreter on the ESP8266 is by using the ESP8266 LuaLoader. It allows you to perform simple tasks (like setting the SSID and password for your wireless router so it can connect to you network) via a GUI. You can also read out or set the status of its GPIO ports, obtain information like the IP address or the chipID, or upload files. However after some more experimenting I finally settled on ESPlorer which has a more contemporary user interface and has syntax highlighting on LUA code.
To be continued… (Sorry article is not yet ready)
The following software was used in realizing the wireless temperature sensor:
- NodeMCU Flasher – for uploading the latest NodeMCU firmware to the ESP8266 devboard.
- ESP8266 LuaLoader – for easy interaction with the NodeMCU commandline.
- The home page of the NodeMCU team
- ESP8266 Quickstart Guide – a nice guide about starting with ESP8266 using NodeMCU.
- NodeMCU devboard information – Lots of detailed information including pin layout for the NodeMCU devboard
- NodeMCU review
- Description of ESP8266 at Nurdspace – lots of details about the ESP8266
- Onewire Library desciption
- Introduction to the GPIO API – also contains mapping from pin to GPIO (must read)