ESP32 Thing Plus Hookup Guide

Pages
Contributors: Ell C, jimblom, Alex the Giant
Favorited Favorite 10

Introduction

The SparkFun ESP32 Thing Plus and the SparkFun ESP32 Thing Plus U.FL enjoy all the amenities of the ESP32 Thing, but with a few added sparkles. We've lengthened the board just a bit to accommodate a Qwiic connector for all your Qwiic breakout needs. We've also moved a few pins around to make the board compatible with the Adafruit Huzzah32 – ESP32 Feather Board such that you can use all of those lovely shields available out there! The ESP32 Thing plus also integrates a rich set of peripherals, ranging from capacitive touch sensors, SD card interface, Ethernet, high-speed SPI, UART, I2S and I2C.

SparkFun Thing Plus - ESP32 WROOM (Micro-B)

SparkFun Thing Plus - ESP32 WROOM (Micro-B)

WRL-15663
$22.50
14
SparkFun Thing Plus - ESP32 WROOM (U.FL)

SparkFun Thing Plus - ESP32 WROOM (U.FL)

WRL-17381
$22.50
11

With Espressif's ESP32 comprehensive development platform, Bluetooth low-energy support (i.e BLE, BT4.0, Bluetooth Smart), and nearly 30 I/O pins, these boards are jam packed with possibilities!

Not Yet Implemented: The Arduino core for the ESP32 microcontroller are still a work in progress. There are a handful of peripherals and features that have yet to be implemented, including:

The peripherals are available (if, also, still in their infancy) in the IoT Development Framework for the ESP32. If your application requires any of the features above, consider giving the ESP-IDF a try! (Updated: June 2022.)

Required Materials

Note: For the ESP32 Thing Plus U.FL, external antenna hardware is required. We offer various antennas options.

Much of the ESP32 Thing Plus's functionality can be used by simply powering the board. To do so, you'll need a Micro-B USB Cable. The ESP32 Thing Plus's USB interface can be used to both power and program the chip. Once you're done programming the chip, a 5V Micro-B USB Wall Adapter can be used to power the board.

USB Micro-B Cable - 6"

USB Micro-B Cable - 6"

CAB-13244
$2.10
3
USB Wall Charger - 5V, 1A (Black)

USB Wall Charger - 5V, 1A (Black)

TOL-11456
$4.50
2
Wall Adapter Power Supply - 5VDC, 2A (USB Micro-B)

Wall Adapter Power Supply - 5VDC, 2A (USB Micro-B)

TOL-15311
$6.50
Electrolytic Decoupling Capacitors - 100uF/25V

Electrolytic Decoupling Capacitors - 100uF/25V

COM-00096
$0.45

As an alternative power source, the ESP32 Thing Plus includes support for single-cell lithium-polymer (LiPo) batteries, which plug into the board's white 2-pin JST connector. LiPos are perfect for projects on-the-go, or those that just need a little extra umph. The board includes a LiPo charger -- the rechargeable batteries can be juiced back up by plugging the Thing Plus into a 5V USB source.

Lithium Ion Battery - 850mAh

Lithium Ion Battery - 850mAh

PRT-13854
$10.95
2
Lithium Ion Battery - 400mAh

Lithium Ion Battery - 400mAh

PRT-13851
$5.50
11
Lithium Ion Battery - 2Ah

Lithium Ion Battery - 2Ah

PRT-13855
$13.95
9

Lithium Ion Battery - 1Ah

PRT-13813
8 Retired

Should you wish to make use of the board's qwiic functionality, you'll need a qwiic cable:

Qwiic Cable - 100mm

Qwiic Cable - 100mm

PRT-14427
$1.50
Qwiic Cable - 50mm

Qwiic Cable - 50mm

PRT-14426
$0.95

Qwiic Cable - 200mm

PRT-14428
Retired

Qwiic Cable - 500mm

PRT-14429
1 Retired

Tools

To take advantage of the ESP32 Thing Plus's 28 external pins, you will need a soldering iron, solder, and general soldering accessories.

Break Away Headers - Straight

Break Away Headers - Straight

PRT-00116
$1.75
20
Solder Lead Free - 100-gram Spool

Solder Lead Free - 100-gram Spool

TOL-09325
$9.95
8
Feather Stackable Header Kit

Feather Stackable Header Kit

PRT-15187
$1.75

Weller WLC100 Soldering Station

TOL-14228
2 Retired

Suggested Reading

It may look intimidating, but the ESP32 Thing Plus -- especially when you take advantage of its Arduino compatibility -- is a perfect IoT foundation for electronics users of all experience levels. There are, however, a few concepts you should be familiar with before venturing further into this tutorial. If any of the concepts below sound foreign to you, consider reading through that tutorial first:

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.

What is an Arduino?

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

Hardware Overview

Espressif's ESP32 WROOM is a powerful, generic Wi-Fi+BT+BLE MCU module that targets a wide variety of applications. At the core of this module is the ESP32-D0WDQ6 chip which is designed to be both scalable and adaptive. Its laundry list of features include:

  • Xtensa® dual-core 32-bit LX6 microprocessor
  • Up to 240MHz clock frequency
  • 16MB of flash storage
  • 520kB internal SRAM
  • Integrated 802.11 BGN WiFi transceiver
  • Integrated dual-mode Bluetooth (classic and BLE)
  • 3.0 to 3.6V operating range
  • 21 GPIO
  • 8-electrode capacitive touch support
  • Hardware accelerated encryption (AES, SHA2, ECC, RSA-4096)
  • 2.5 µA deep sleep current

The ESP32 Thing Plus is designed around the ESP32-WROOM module with everything necessary to run and program the microcontroller, plus a few extra goodies to take advantage of the chip's unique features.

Annotated top diagram

Peripherals and I/O

The ESP32 Thing Plus features your standard fare of hardware peripherals including:

  • 13 analog to digital converter (ADC) channels
  • 3 UARTs (only two are configured by default in the Arduino IDE, one UART is used for bootloading/debug)
  • 3 SPI (only one is configured by default in the Arduino IDE)
  • 2 I2C (only one is configured by default in the Arduino IDE)
  • 2 I2S Audio
  • 2 digital-to-analog converter (DAC) channels
  • 16 PWM outputs

And, thanks to the chip's pin multiplexing feature, those peripherals can be connected to just about any of the broken out I/O pins. Than means you decide which pins are RX, TX, MISO, MOSI, SCLK, SDA, SCL, etc.

There are, however, a few hardware features -- namely the ADC and DAC -- which are assigned to static pins. The graphical datasheet below helps demonstrate where you can find those peripherals (click to embiggen!).

Graphical datasheet

Click the image for a closer look.

One I2C, two of the UART interfaces, and one of the SPI interfaces can be assigned to any pin your project requires.

Powering the ESP32 Thing Plus

The two main power inputs to the ESP32 Thing Plus are USB and a single-cell lithium-polymer (LiPo battery. If both USB and the LiPo are plugged into the board, the onboard charge controller will charge the LiPo battery at a rate up to 500mA.

⚡ The ESP32's operating voltage range is 3.0 to 3.6V. Under normal operation the ESP32 Thing Plus will power the chip at 3.3V. The I/O pins are not 5V-tolerant! If you interface the board with 5V (or higher) components, you'll need to do some logic level shifting.

The 3.3V regulator on the ESP32 Thing Plus can reliably supply up to 600mA, which should be more than enough overhead for most projects. The ESP32 can pull as much as 250mA during RF transmissions, but we've generally measured it to consume around 150mA -- even while actively transmitting over WiFi. The output of the regulator is also broken out to the sides of the board -- the pin labeled "3V3". This pin can be used to supply external components.

ESP32 power inputs/outputs

In addition to USB and battery connectors, the VBAT, and VUSB pins are all broken out to the sides of the board. These pins can be used as an alternative supply input to the Thing Plus. The maximum, allowable voltage input to VUSB is 5.8V, and VBAT should not be connected to anything other than a LiPo battery. Alternatively, if you have a regulated voltage source between 3.0V and 3.6V, the "3V3" line can be used to directly supply the ESP32 and its peripherals.

Assembly Tips

Headers

The ESP32 Thing Plus ships without anything soldered into the header pins -- ensuring that you can mold the board to best fit your project. To use the chip's pins you'll need to solder something to the I/O and power rail vias broken out to either side of the board.

New to soldering? Check out our Through-Hole Soldering Tutorial for a quick introduction!

What you solder to the ESP32 Thing Plus's I/O pins is completely up to you. The header rows are breadboard-compatible, so you may want to solder male headers in.

ESP32 Thing with male headers soldered
ESP32 Thing Plus with soldered male headers.

Then plug it into the breadboard, hanging the USB and LiPo connectors off the end, and start wiring!

Alternatively, female headers (you may need two separate strips to solder all the pins), right-angle headers, or stranded wire are all good options, depending on your project's needs.

Connecting an Antenna

U.FL connectors are very good but they are a designed to be implemented inside a small embedded application like a laptop. Exposing a U.FL connector to the wild risks it getting damaged.

patch antenna connected
duck antenna connected
U.FL antenna options connected to ESP32 Thing Plus (U.FL).

Software Setup

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE.

Installation for the ESP32 Thing Plus is two-fold. Like the ESP32 Thing, you will want to install the board definitions via the Arduino Boards manager. In addition, you will also need to download and install the latest CP2104 USB Driver. Note, some older versions of the driver (including the version that Windows auto-installs) will cause the auto-reset to fail during upload.

Installing Board Definition

Espressif has added support for the Arduino Boards Manager that includes a slew of great built-in examples. Instructions for installing via the board manager can be found at espressif's arduino-esp32 documentation.

For more information on installing boards via the Arduino Board Manager, check out the add-ons section of our Installing Arduino IDE tutorial.

Installing Arduino IDE

March 26, 2013

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

If you are familiar with installing boards via the Arduino IDE Boards Manager, the url to add is:

language:c
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Note: If you have previously installed the ESP32 Arduino Core, we strongly recommend removing the associated folders before installing via the boards manager.

To remove previous arduino core installs for the esp32, start by finding your .../Arduino/hardware folder. This can be located by looking at your Sketchbook location under File > Preferences.

Click to enlarge.

Go to this location in your finder and delete the esp32 folder.


Once you have deleted the esp32 folder, you can then install using the Arduino Boards Manager.

Selecting the Board Definition

Once installed, use the Adafruit ESP32 Feather board in the Arduino Board dropdown.

Choosing the Adafruit ESP32 Feather Board in the Arduino Board Dropdown
Selecting board definition from Tools drop down menu.


Installing the CP2104 USB Driver

Note: Make sure to manually install the driver for the CP210X with the following instructions. The driver that Windows auto-installs will not work with the auto-reset circuit on the board and cause serial uploads to fail.

You will also need to install the SiLabs CP2104 Driver, which can be found here: USB to UART Bridge VCP Driver

Note: If applicable, make sure you are using the proper driver files for your CPU architecture. This is usually indicated by a folder or file name with "x86" for 32-bit processors or "x64" for 64-bit processors.

With the ESP32 Arduino core installed, you're ready to begin programming. If you haven't already, plug the ESP32 Thing Plus into your computer using a micro-B USB cable.

ESP32 Thing Plus plugged into breadboard

Once the board is plugged in (and drivers installed), it should be assigned a unique port identifier. On Windows machines, this will be something like COM#, and on Macs or Linux computers it will come in the form of /dev/tty.usbserial-XXXXXX.

Select the Board and Port

Make sure you have the Adafruit ESP32 Feather board definition selected under your Tools > Board menu.

Arduino board select

Then select your ESP32 Thing Plus' serial port under the Tools > Port menu.

Port Selection for Esp32 Thing Plus

You can also select the Upload Speed: "921600" baud -- the fastest selectable rate -- will get the code loaded onto your ESP32 the fastest, but may fail to upload once-in-a-while. (It's still way worth it for the speed increase!)

Loading Blink

To make sure your toolchain and board are properly set up, we'll upload the simplest of sketches -- Blink! The LED attached to GPIO 13 is perfect for this test. Plus, with the ESP32 attached to your computer, this is a good time to test out serial communication. Copy and paste the example sketch below into a fresh Arduino sketch:

language:c
int ledPin = 13;

void setup()
{
    pinMode(ledPin, OUTPUT);
    Serial.begin(115200);
}

void loop()
{
    Serial.println("Hello, world!");
    digitalWrite(ledPin, HIGH);
    delay(500);
    digitalWrite(ledPin, LOW);
    delay(500);
}

With everything setup correctly, upload the code! Once the code finishes transferring, open the serial monitor and set the baud rate to 115200. You should see Hello, world!'s begin to fly by.

If the blue LED remains dimly lit, it's probably still sitting in the bootloader. After uploading a sketch, you may need to tap the RST button to get your ESP32 Thing Plus to begin running the sketch.

Example serial port output

You may also notice that when the ESP32 boots up it prints out a long sequence of debug messages. These are emitted every time the chip resets -- always at 115200 baud.

Arduino Example: WiFi

The ESP32 Arduino core includes a handful of WiFi examples, which demonstrate everything from scanning for nearby networks to sending data to a client server. You can find the examples under the File > Examples > WiFi menu.

Here's another example using the WiFi library, which demonstrates how to connect to a nearby WiFi network and poll a remote domain (http://example.com/) as a client.

language:c
#include <WiFi.h>

// WiFi network name and password:
const char * networkName = "YOUR_NETWORK_HERE";
const char * networkPswd = "YOUR_PASSWORD_HERE";

// Internet domain to request from:
const char * hostDomain = "example.com";
const int hostPort = 80;

const int BUTTON_PIN = 0;
const int LED_PIN = 13;

void setup()
{
  // Initilize hardware:
  Serial.begin(115200);
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  pinMode(LED_PIN, OUTPUT);

  // Connect to the WiFi network (see function below loop)
  connectToWiFi(networkName, networkPswd);

  digitalWrite(LED_PIN, LOW); // LED off
  Serial.print("Press button 0 to connect to ");
  Serial.println(hostDomain);
}

void loop()
{
  if (digitalRead(BUTTON_PIN) == LOW)
  { // Check if button has been pressed
    while (digitalRead(BUTTON_PIN) == LOW)
      ; // Wait for button to be released

    digitalWrite(LED_PIN, HIGH); // Turn on LED
    requestURL(hostDomain, hostPort); // Connect to server
    digitalWrite(LED_PIN, LOW); // Turn off LED
  }
}

void connectToWiFi(const char * ssid, const char * pwd)
{
  int ledState = 0;

  printLine();
  Serial.println("Connecting to WiFi network: " + String(ssid));

  WiFi.begin(ssid, pwd);

  while (WiFi.status() != WL_CONNECTED) 
  {
    // Blink LED while we're connecting:
    digitalWrite(LED_PIN, ledState);
    ledState = (ledState + 1) % 2; // Flip ledState
    delay(500);
    Serial.print(".");
  }

  Serial.println();
  Serial.println("WiFi connected!");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

void requestURL(const char * host, uint8_t port)
{
  printLine();
  Serial.println("Connecting to domain: " + String(host));

  // Use WiFiClient class to create TCP connections
  WiFiClient client;
  if (!client.connect(host, port))
  {
    Serial.println("connection failed");
    return;
  }
  Serial.println("Connected!");
  printLine();

  // This will send the request to the server
  client.print((String)"GET / HTTP/1.1\r\n" +
               "Host: " + String(host) + "\r\n" +
               "Connection: close\r\n\r\n");
  unsigned long timeout = millis();
  while (client.available() == 0) 
  {
    if (millis() - timeout > 5000) 
    {
      Serial.println(">>> Client Timeout !");
      client.stop();
      return;
    }
  }

  // Read all the lines of the reply from server and print them to Serial
  while (client.available()) 
  {
    String line = client.readStringUntil('\r');
    Serial.print(line);
  }

  Serial.println();
  Serial.println("closing connection");
  client.stop();
}

void printLine()
{
  Serial.println();
  for (int i=0; i<30; i++)
    Serial.print("-");
  Serial.println();
}

Make sure you fill in the networkName and networkPswd variables with the name (or SSID) and password of your WiFi network! Once you've done that and uploaded the code, open your serial monitor.

WiFi example serial terminal output

After your ESP32 connects to the WiFi network, it will wait for you to press the "0" button. Tapping that will cause the ESP32 to make an HTTP request to example.com. You should see a string of HTTP headers and HTML similar to the screenshot above.

Arduino Example: ESP32 BLE

Both the board manager install and the ESP32 arduino core install come with Bluetooth examples that range from acting as a simple BLE device to functioning as either a Bluetooth server or client. Here we will briefly go over the BLE_write example that can be found in Files > Examples > ESP32 BLE Arduino. This example allows you to write messages on your phone that can then be read in a serial monitor on your computer.

This example works with a BLE scanner on your phone. A good, basic app is the BLE Scanner for iPhone or Android. Make sure to install the app to follow along with this example.

Compile and upload the following code, or if you wish, open the BLE_write example from the Files > Examples > ESP32 BLE Arduino menu. Make sure you have ESP32 Dev Module as your board and the correct port has been selected.

language:c
/*
    Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleWrite.cpp
    Ported to Arduino ESP32 by Evandro Copercini
*/

#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>

// See the following for generating UUIDs:
// https://www.uuidgenerator.net/

#define SERVICE_UUID        "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"


class MyCallbacks: public BLECharacteristicCallbacks {
    void onWrite(BLECharacteristic *pCharacteristic) {
      std::string value = pCharacteristic->getValue();

      if (value.length() > 0) {
        Serial.println("*********");
        Serial.print("New value: ");
        for (int i = 0; i < value.length(); i++)
          Serial.print(value[i]);

        Serial.println();
        Serial.println("*********");
      }
    }
};

void setup() {
  Serial.begin(115200);

  Serial.println("1- Download and install an BLE scanner app in your phone");
  Serial.println("2- Scan for BLE devices in the app");
  Serial.println("3- Connect to MyESP32");
  Serial.println("4- Go to CUSTOM CHARACTERISTIC in CUSTOM SERVICE and write something");
  Serial.println("5- See the magic =)");

  BLEDevice::init("MyESP32");
  BLEServer *pServer = BLEDevice::createServer();

  BLEService *pService = pServer->createService(SERVICE_UUID);

  BLECharacteristic *pCharacteristic = pService->createCharacteristic(
                                         CHARACTERISTIC_UUID,
                                         BLECharacteristic::PROPERTY_READ |
                                         BLECharacteristic::PROPERTY_WRITE
                                       );

  pCharacteristic->setCallbacks(new MyCallbacks());

  pCharacteristic->setValue("Hello World");
  pService->start();

  BLEAdvertising *pAdvertising = pServer->getAdvertising();
  pAdvertising->start();
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(2000);
}

Once you have uploaded your code, open a Serial Monitor set at 115200 baud so you can see the message that we will write.

Arduino Serial Monitor ESP32

Then open your BLE Scanner app on your phone. You will see multiple options; scroll through these and connect to MyESP32.

Connect to MyESP32

Now we need to drill down to the communication capability we want. Once you are connected to MyESP32, you will be taken to the following page. Select CUSTOM SERVICE.

Choose Custom Service

The next page will show you communications and options for doing so. Select Write,Read.

Choose Write,Read

Finally, we can choose the option that allows us to write a message. Select Write Value.

Choose Write

Now we can write our message. Make sure you choose Text, write yourself a message, and click the Write button.

Write your message!

So now what? Go have a look at your serial monitor. You should see "New value:" with your message.

Received message on the Serial Monitor

This is just a quick walk through of one of the provided examples. We recommend looking through the rest of the provided samples and playing with the code to see what may work for your application. For more information on Bluetooth technology and how it works, check out our Bluetooth Basics Tutorial.

Troubleshooting

If you are having trouble uploading from the Arduino IDE, please double check that you are using the latest USB driver for the CP210X Uart IC. If you are using an older driver (or the one that automatically installs with Windows), then this can cause serial upload failures and you may experience the following error message in the debug console of Arduino:

alt text

The driver actually controls how the auto-reset circuit works, and so it is necessary to use a version at or above 10.1.3.2130.

If you want to double-check what driver you are currently using, you can open Device Manager and navigate to the properties of your COM port. You should see the following in the "driver" tab of the properties window:

alt text

To install the correct driver, please follow the driver installation instructions above.

Resources and Going Further

For more resources related to the ESP32 Thing Plus, check out the links listed here:

Espressif has some great resources built around the ESP32:

For more ESP32 related tutorials, check out the following.

MicroMod ESP32 Processor Board Hookup Guide

A short hookup guide to get started with the SparkFun MicroMod ESP32 Processor Board.

SparkFun RTK Surveyor Hookup Guide

Learn how to use the enclosed RTK Surveyor product to achieve millimeter level geospatial coordinates.

Qwiic ToF Imager - VL53L5CX Hookup Guide

Hookup Guide for the Qwiic ToF Imager - VL53L5CX

Audio Codec Breakout - WM8960 Hookup Guide

The SparkFun Audio Codec Breakout - WM8960 is a low power, high quality stereo codec chock full of features. In this tutorial, some of these features by using an Arduino microcontroller to configure the audio codec and pass audio to the headphone or speaker channels.

If you need some project inspiration, check out some of these IoT-focused projects and get making!

Using Artnet DMX and the ESP32 to Drive Pixels

In this tutorial, we'll find out how to use Resolume Arena, a popular video jockey software, to control custom-made ArtNet DMX fixtures.

Using Home Assistant to Expand Your Home Automations

An introduction to Home Assistant, an open source home automation hub.

Artemis Development with Arduino

Get our powerful Artemis based boards (Artemis Nano, BlackBoard Artemis, and BlackBoard Artemis ATP) blinking in less than 5 minutes using the SparkFun Artemis Arduino Core!

MicroMod Ethernet Function Board - W5500 Hookup Guide

Add Ethernet and PoE capabilities to your MicroMod project using the Ethernet Function Board - W5500.

Or check out this related blog post: