ESP8266 Thing Development Board Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t445

Contents

Introduction

The ESP8266 is a cost-effective, and very capable WiFi-enabled microcontroller. Like any microcontroller, it can be programmed to blink LEDs, trigger relays, monitor sensors, or automate coffee makers, and with an integrated WiFi controller, the ESP8266 is a one-stop shop for almost any Internet-connected project. To top it all off, the ESP8266 is incredibly easy-to-use: firmware can be developed in Arduino and uploaded over a simple, serial interface.

To take advantage of all of those benefits, we've created the ESP8266 Thing Development Board -- an ESP8266 development board, with an integrated FTDI USB-to-Serial chip.

SparkFun ESP8266 Thing - Dev Board

SparkFun ESP8266 Thing - Dev Board

WRL-13711
$18.50
71

SparkFun ESP8266 Thing Dev Starter Kit

KIT-15259
1 Retired

Having trouble viewing the videos? Try resizing the video by clicking on the shortcut to view the product showcase in full screen.

The ESP8266 Thing Development Board breaks out all of the module's pins, and the USB-to-serial converter means you don't need any peripheral components to program the chip. Just plug in a USB cable, download the Arduino board definitions, and start IoT-ing.

Covered in this Tutorial

This tutorial will help you get your ESP8266 Thing Development Board from zero to Internet-controlled blinking. It's split into the following sections:

Required Materials

If you are ordering the ESP8266 Thing Development individually, you will need a few components to get started. Beyond the ESP8266 Thing Development Board itself, all you should need to get started is a micro-B USB Cable, which will deliver power the board and set up our USB programming interface.

Depending on how you want to use the board, you may also want to add male headers, female headers, or hedge your bets with 10-pin stackable headers.

Break Away Headers - Straight

Break Away Headers - Straight

PRT-00116
$1.75
20
USB Micro-B Cable - 6 Foot

USB Micro-B Cable - 6 Foot

CAB-10215
$5.50
15
Female Headers

Female Headers

PRT-00115
$1.75
8
Arduino Stackable Header - 10 Pin

Arduino Stackable Header - 10 Pin

PRT-11376
$0.75
2

Suggested Reading

Before continuing on with this tutorial, you may want to familiarize yourself with some of these topics if they're unfamiliar to you:

How to Solder: Through-Hole Soldering

This tutorial covers everything you need to know about through-hole soldering.

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

How to Power a Project

A tutorial to help figure out the power requirements of your project.

Logic Levels

Learn the difference between 3.3V and 5V devices and logic levels.

Hardware Overview

The ESP8266 Thing Development Board is a relatively simple board. The pins are broken out to two parallel, breadboard-compatible rows. The USB connector sits next to an optional power supply input, and an ON/OFF switch -- controlling power to the ESP8266 -- sits next to that. And LEDs towards the inside of the board indicate power, charge, and status of the IC.

ESP8266 Dev Board top view

This section provides a quick overview of the Thing Dev Board's main components.

Serial and I2C Header

The header on the left provides an interface for serial, I2C, and power:

Pin LabelESP8266 I/O Function(s)Notes
GNDGround (0V).
3V33.3V
2GPIO2, SDACan either be used as ESP8266 GPIO2 or I2C serial data (SDA).
14GPIO14, SCL, SCLKCan either be used as ESP8266 GPIO14 or I2C serial clock (SCL).
Also used as the SPI clock (SCLK).
RSTThe ESP8266's active-low reset input. The board includes a 10kΩ pull-up resistor on this pin.
TXGPIO7, TX1ESP8266 UART1 data output.
RXGPIO8, RX1ESP8266 UART1 data input.
5VUSB supply output. If USB is connected, this pin will supply about 4.8V.
NCNot connected to anything.
GNDGround (0V).

The top portion of this header breaks out the ESP8266's I2C interface, a popular interface for a variety of sensors including motion sensor, light sensor, digital-to-analog converter, or OLED display, I2C is often the protocol of choice.

If you need the extra I/O, instead of I2C, the SDA and SCL pins can be used as GPIO 2 and 14 respectively. The SCL pin also serves as the clock (SCLK) for the ESP8266's SPI interface.

The lower part of the header breaks out one of the ESP8266's serial UARTs. This serial port is used to program the thing, so be careful using it for other tasks.

General I/O Header

The rest of the power, control, and I/O pins are broken out on the other side of the board. They are:

Pin LabelESP8266 I/O FunctionNotes
GNDGround (0V).
VINUSB connected: ~5V output
Can alternatively be used as a voltage supply input to the 3.3V regulator.
5GPIO5This pin is also tied to the on-board LED.
0GPIO0
4GPIO4
13GPIO13, MOSIHardware SPI MOSI
12GPIO12, MISOHardware SPI MISO
16GPIO16, XPDCan be connected to reset to wake the ESP8266 from deep sleep mode.
ADCA0A 10-bit ADC with a maximum voltage of 1V.
15GPIO15

External Power Supply

If your project requires a power source other than USB, the Thing Dev Board includes footprints for a 2-pin JST, 2-pin 3.5mm screw terminal, or a simple 0.1"-pitch 2-pin header.

Power input

You can supply anywhere between 3.3V and 6V into these inputs to power the board.

Note: Unlike the original ESP8266 Thing, the ESP8266 Thing Development Board does not have a built-in LiPo charger. A LiPo battery can be connected into a populated JST connector, but you'll need to add some extra circuitry to charge it.

Power-Saving Jumpers

A pair of jumpers on the back of the board can be used to help reduce the Thing's power consumption.

ESP8266 Thing Dev bottom

Jumper LabelDefault SettingNotes
SLEEP-ENOpenConnects GPIO16 (XPD) to the ESP8266's RST pin.
PWR-LEDClosedCompletes the power LED indicator circuit.

The SLEEP-EN jumper connects GPIO16 (which has the XPD functionality) to the ESP8266's reset input. This connection is required if you want the ESP8266 to automatically wake itself from deep sleep.

sleep jumper installed

The SLEEP_EN jumper set: enables using and waking up from deep sleep mode, but disables programming.

To use the jumper solder a 2-pin male header and slide a 2-pin jumper on and off. This is a through-hole jumper only, because you'll need to remove the jumper to program the ESP2866.

The PWR-LED jumper allows you to disable the power LED. The LED will normally pull about 7mA, which is a ton compared to the ESP8266's 10's of µA consumption in sleep mode.

To disable the power LED, slice the interconnecting trace with your handy hobby knife.

Selecting the Antenna

The Thing Dev Board's default WiFi antenna is a PCB trace antenna based on this TI app note. It's cost-effective and actually works really well!

If you need to connect a more sensitive antenna, or need to route outside an enclosure, a U.FL connector is also available on the board, but isn't connected by default to the ESP8266's antenna pin. To connect this antenna to the chip, you'll need to swap the jumper by removing the solder blob and pushing it over to the other side.

connecting an external antenna

Antenna-select jumper set to U.FL, and an external attached.

Then attach a U.FL WiFi antenna of your choice. Our adhesive antenna or a U.FL-to-RP-SMA adapter/2.4GHz Duck Antenna combo are good options.

Hardware Setup

To use any of the Thing Dev Board's GPIO pins, you'll need to solder something to the board. If you've never soldered before, this is a great time to start! These solder points are easy, through-hole pins, check out our How to Solder - Through-hole Soldering for help getting started.

What, exactly, you solder to the board depends on how you'll use it in your project. There are a variety of header options, including stackable headers, straight male headers, or straight female headers.

Stackable Headers make it convenient to both breadboard the Thing Dev Board and jumper wire out of it.

stackable headers soldered to esp8266

And, of course, wire can be soldered to any of the pins that have a long way to connect to something.

Powering the Thing Development Board

The easiest way to power the Thing Dev Board is by connecting a USB cable to the micro-B USB jack. The other end of the USB cable can be connected to your computer or a USB wall wart. After powering the board, make sure the ON/OFF switch is slid into the "ON" position, and you should see the "PWR" LED illuminate.

Power the board with a USB cable

Alternatively, you can solder a variety of connectors into the VIN position to run the board on some other power supply. For example, you could solder a 2-pin JST connector and mate the board with a 2xAA Battery Holder to power your project.

power the board with a battery

(A pair of AA batteries may slightly underpower the 3.3V regulator, but the board should still provide more than the 1.8V required for the ESP8266.)

Driver Install: If you've never used an FTDI device, you may need to install drivers on your computer before you can program the ESP8266. For help with that, follow along with our How to Install FTDI Drivers tutorial.

We have installation directions documented for all major operating systems:

Windows Mac Linux

Setting Up Arduino

There are a variety of development environments that can be equipped to program the ESP8266. You can go with a simple Notepad/gcc setup, fine-tune an Eclipse environment, or use a virtual machine provided by Espressif. If you're just getting started, though, we recommend the comfy confines of the Arduino IDE.

The amazing ESP8266 community has cooperatively created an ESP8266 addon for the IDE, which is what we'll focus on using throughout this tutorial. This ESP8266 addon for Arduino is based on the amazing work by Ivan Grokhotkov and the rest of the ESP8266 community. Check out the ESP8266 Arduino GitHub repository for more information.

Installing the Addon With the Arduino Boards Manager

With the release of Arduino 1.6.4, adding third party boards to the Arduino IDE is easily achieved through the board manager. If you're running an older version of Arduino (1.6.3 or earlier), we recommend upgrading now. As always, you can download the latest version of Arduino from arduino.cc.

To begin, you'll need to point the Arduino IDE board manager to a custom URL. Open up Arduino, then go to the Preferences (File > Preferences). Then, towards the bottom of the window, paste this URL into the "Additional Board Manager URLs" text box:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

You can add multiple URLs by clicking the window icon, and pasting in one URL per line.

Adding Board Manager URL to Arduino preferences

Hit OK. Then navigate to the Board Manager by going to Tools > Boards > Boards Manager. Look for esp8266. Click on that entry, then select Install.

Installing additional boards from Board Manager

The board definitions and tools for the ESP8266 include a whole new set of gcc, g++, and other reasonably large, compiled binaries, so it may take a few minutes to download and install (the archived file is ~110MB). Once the installation has completed, an Arduino-blue "INSTALLED" will appear next to the entry.

Selecting the ESP8266 Thing Board

With the Board addon installed, all that's left to do is select "SparkFun ESP8266 Thing Dev" from the Tools > Boards menu.

Board selection

Then select your FTDI's port number under the Tools > Port menu.

Example 1: Blink

To verify that everything works, try uploading the old standard: Blink. But instead of blinking pin 13, toggle pin 5, which is attached to the onboard LED.

language:c
#define ESP8266_LED 5

void setup() 
{
  pinMode(ESP8266_LED, OUTPUT);
}

void loop() 
{
  digitalWrite(ESP8266_LED, HIGH); // LED off
  delay(500);
  digitalWrite(ESP8266_LED, LOW); // LED on
  delay(500);
}

Upload Fails – Troubleshooting

If you get the following error ending with something like esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header:

Upload Error 1

Make sure that you select the SparkFun ESP8266 Thing Dev as the board. Selecting just the "SparkFun ESP8266 Thing" without the word "Dev" can cause problems uploading when using the ESP8266 Community Board Add-On.

If every upload attempt results in an error ending with something like error: espcomm_open failed:

Try changing the board to Generic ESP8266 Module, and in the sub menus, make sure the following sub-menu's are also set: