Download Print this page
sparkfun ESP8266 Hook-Up Manual

sparkfun ESP8266 Hook-Up Manual

Thing
Hide thumbs Also See for ESP8266:

Advertisement

Quick Links

1/23/2018
ESP8266 Thing Development Board Hookup Guide
Pages
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
board, with an integrated FTDI USB-to-Serial chip.
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:
Hardware Overview
Hardware Setup
– Tips and recommendations on what to solder to the Thing Development Board's I/O pins.
Setting Up Arduino
Example Sketch: Web Server
control LEDs!
Example Sketch: Blink with Blynk
monitor inputs with a simple multi-platform phone app.
Using the ESP8266 in Arduino
https://learn.sparkfun.com/tutorials/esp8266-thing-development-board-hookup-guide/all
ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com
– A quick rundown of the Thing Development Board's components and pinout.
– What truly makes the ESP8266 so powerful is its potential for Arduino-compatibility.
– Run an HTTP server on the Thing. Use it to serve web pages, print status messages, and
– One of our favorite new toys is the Blynk phone app, which allows you to toggle LEDs and
– A few gotchya's to look out for when programming the ESP8266 in Arduino.
ESP8266 Thing Development Board
– an ESP8266 development
1/24

Advertisement

loading
Need help?

Need help?

Do you have a question about the ESP8266 and is the answer not in the manual?

Questions and answers

Summary of Contents for sparkfun ESP8266

  • Page 1 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.
  • Page 2: Hardware Overview

    1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com Required Materials 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.
  • Page 3 Notes Label Function(s) Ground (0V). 3.3V GPIO2, SDA Can either be used as ESP8266 GPIO2 or I C serial data (SDA). GPIO14, Can either be used as ESP8266 GPIO14 or I C serial SCL, SCLK clock (SCL). Also used as the SPI clock (SCLK).
  • Page 4 (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.
  • Page 5 PWR-LED Closed Completes 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. https://learn.sparkfun.com/tutorials/esp8266-thing-development-board-hookup-guide/all...
  • Page 6: Selecting The Antenna

    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.
  • Page 7: Hardware Setup

    1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com 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.
  • Page 8 1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com 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...
  • Page 9 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.
  • Page 10 1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com 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. 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).
  • Page 11 1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com Then select your FTDI’s port number under the Tools > Port menu. Upload 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.
  • Page 12 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: Flash Mode: DIO Flash Frequency: 80MHz...
  • Page 13 Example Sketch: Web Server The previous example uses the ESP8266 in web client mode. If we instead use the ESP8266 as a web server, you can use a web browser to control the ESP8266’s LED, or read the status of its GPIO’s.
  • Page 14 Access Point (AP) Web Server Not only can the ESP8266 connect to a WiFi network and interact with the Internet, but it can also set up a network of its own, allowing other devices to connect directly to it. This example demonstrates how to turn the ESP8266 into an access point (AP), and serve up web pages to any connected client.
  • Page 15 1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com The sketch sets the network’s password to “sparkfun”. After connecting to your ESP8266’s AP network, load up a browser and point it to (unfortunately, mDNS doesn’t 192.168.4.1/read work in AP mode). The Thing Dev Board should serve up a web page showing you its ADC and digital pin 12 readings: After that, give a try.
  • Page 16 1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com You’ll also need to install the Blynk Arduino Library, which helps generate the firmware running on your ESP8266. Download the latest release from Blynk’s GitHub repo, and follow along with the directions there to install the required libraries.
  • Page 17 1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com The Auth Token is very important – you’ll need to stick it into your ESP8266’s firmware. For now, copy it down or use the “E-mail” button to send it to yourself.
  • Page 18 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com Add a Button, then click on it to change its settings. Buttons can toggle outputs on the ESP8266. Set the button’s output to gp5, which is tied to an LED on the Thing Dev Board. You may also want to change the action to “Switch.”...
  • Page 19 1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com Upload the Blynk Firmware Now that your Blynk project is set up, open Arduino and navigate to the ESP8266_Standalone example in the File > Examples > Blynk > BoardsAndShieldsmenu. https://learn.sparkfun.com/tutorials/esp8266-thing-development-board-hookup-guide/all 19/24...
  • Page 20 1/23/2018 ESP8266 Thing Development Board Hookup Guide - learn.sparkfun.com Before uploading, make sure to paste your authoriazation token into the variable. Also make sure to load your WiFi auth[] network settings into the function. Blynk.begin(auth, "ssid", "pass") Then upload! Run the Project After the app has uploaded, open the serial monitor, setting the baud rate to 9600.
  • Page 21 Then click the “Run” button in the top right corner of the Blynk app. Press the button and watch the LED! Then add more widgets to the project. They should immediately work on the ESP8266 without uploading any new firmware.
  • Page 22 Using the ESP8266 in Arduino If you’ve used Arduino in the past, there will be some new programming schemes to get used to in ESP8266 land. Here are a few of the most common gotchyas. For a more comprehensive reference, check out the ESP8266 Arduino Reference page.
  • Page 23 // Print button pressed message. ESP8266WiFi Class This is the ESP8266, so the WiFi class will probably be included in just about every sketch there is. If you’ve used the Arduino WiFi library before, the ESP8266 WiFi library will be very similar, there’s just a few key differences: To include the ESP8266 WiFi library call #include <ESP8266WiFi.h>...
  • Page 24: Pin Number

    – Espressif is also somewhat active on GitHub. They host a couple versions of the SDK here. The ESP8266 Thing is open source hardware! If you need, or just want to look at, the PCB design files, you can find them in ESP8266 Thing Development Board GitHub repository.