1. Introduction

FireBeetle ESP32-E, specially designed for IoT, is an ESP-WROOM-32E-based main controller board with dual-core chips. It supports WiFi and Bluetooth dual-mode communication, and features small size, ultra-low power consumption, on-board charging circuit and easy-to-use interface, which can be conveniently used for smart home IoT, industrial IOT applications, wearable devices and so on. You can easily create your own IoT smart home system when connecting it with an IoT platform like IFTTT. FireBeetle ESP32-E supports Arduino programming, and will support Scratch graphical programming and MicroPython programming very soon. We provide you with detailed online tutorials and application cases, and there are thousands of sensors with welding-free Gravity interface and actuators to help you get started easily. Besides, the stamp hole design makes it able to be easily embedded in your PCB, greatly saving your costs and time to build and test prototype.

2. What is FireBeetle Series?

FireBeetle was originally designed to be a high-performance and more Mini Arduino open-source development board series. Now it is not only fully compatible with Arduino development environment, but also comes with abundant hardware and software resources. FireBeetle will support the various development environment like MakeCode, Mind+, Pingpong and MicroPython (to be improved soon), which allows you to program your hardware by graphical programming, C language, Python or JS.

This open source board of high-flexibilty could bring you infinite possibilities! There are a large number of detailed tutorials and thousands of easy-to-use Gravity peripherals that provide you with the simplest way to program. No matter you are a student, an electronic enthusiast, an artist or a designer, this would be your best partner to open up the world of electronic without dealing with complicated circuits, brain-buring codings, and all complex communication protocols. Turn your worthy ideas into fantastic reality with this FireBeetle board!

3. Features

4. Specification

5. Board Overview

Board Overview

6. Pinout



FireBeetle ESP32-E has up to 22 physical GPIOs, of which the pins 34-39 are only used as input pins, and others can be used as both input and output pins. All logic voltages are 3.3V.





ESP32 has two UART ports, of which UART0 is for PC communication.

SerialPort Name Arduino TX RX
UART0 Serial Pin1 Pin3
UART2 Serial2 Pin17 Pin16

7. Getting Started (Use for first time)

7.1 Arduino IDE Configuration

When using FireBeetle maincontroller for the frist time, you need know the following steps:

Arduino IDE Setup

Open Arduino IDE, click File->Preferences, as shown below:

Arduino IDE

Click the icon marked with red below.

Arduino Setup

Copy the address to the newly popped up box:

Arduino Setup 1

Click OK.

Update Board

The board will be automatically updated.

Board Updated

Wait for while, then you will find the FireBeetle-ESP32(V0.0.8 Available now) in the list. Click "Install":

Install Board

Done! You can find the installed FireBeetle-ESP32 board in the list now.


This is a blink program for users who use Arduino for the first time. The LED will blink regularly when burning codes into your board.
The default blink LED for FireBeetle-ESP32 board is D9/2.

Select Port

 // the setup function runs once when you press reset or power the board
    void setup() {
      // initialize digital pin LED_BUILTIN as an output.
      pinMode(LED_BUILTIN, OUTPUT);

    // the loop function runs over and over again forever
    void loop() {
      digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);                       // wait for a second
      digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);                       // wait for a second

Burning Completed

Code Burning

7.3 Bluetooth Tutorial

The ESP32 supports Bluetooth function. This part will mainly demonstrate how to use two FireBeetle-ESP32-E for realizing Bluetooth Data Transparent Transmission.

//This example code is in the Public Domain (or CC0 licensed, at your option.)
//By Victor Tchistiak - 2019
//This example demostrates master mode bluetooth connection and pin 
//it creates a bridge between Serial and Classical Bluetooth (SPP)
//this is an extention of the SerialToSerialBT example by Evandro Copercini - 2018

#include "BluetoothSerial.h"

BluetoothSerial SerialBT;

String MACadd = "AA:BB:CC:11:22:33";
uint8_t address[6]  = {0xAA, 0xBB, 0xCC, 0x11, 0x22, 0x33};
//uint8_t address[6]  = {0x00, 0x1D, 0xA5, 0x02, 0xC3, 0x22};
String name = "ESP32test";
char *pin = "1234"; //<- standard pin would be provided by default
bool connected;

void setup() {
  SerialBT.begin("ESP32master", true); 
  Serial.println("The device started in master mode, make sure remote BT device is on!");

  // connect(address) is fast (upto 10 secs max), connect(name) is slow (upto 30 secs max) as it needs
  // to resolve name to address first, but it allows to connect to different devices with the same name.
  // Set CoreDebugLevel to Info to view devices bluetooth address and device names
  connected = SerialBT.connect(name);
  //connected = SerialBT.connect(address);

  if(connected) {
    Serial.println("Connected Succesfully!");
  } else {
    while(!SerialBT.connected(10000)) {
      Serial.println("Failed to connect. Make sure remote device is available and in range, then restart app."); 
  // disconnect() may take upto 10 secs max
  if (SerialBT.disconnect()) {
    Serial.println("Disconnected Succesfully!");
  // this would reconnect to the name(will use address, if resolved) or address used with connect(name/address).

void loop() {
  if (Serial.available()) {
  if (SerialBT.available()) {
//This example code is in the Public Domain (or CC0 licensed, at your option.)
//By Evandro Copercini - 2018
//This example creates a bridge between Serial and Classical Bluetooth (SPP)
//and also demonstrate that SerialBT have the same functionalities of a normal Serial

#include "BluetoothSerial.h"

#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it

BluetoothSerial SerialBT;

void setup() {
  SerialBT.begin("ESP32test"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");

void loop() {
  if (Serial.available()) {
  if (SerialBT.available()) {


Result 1

Result 2

Send "I'm the master" from the mater port.
The slave port displays "The slave receives: I'm the master"
Send "I'm the slave" from the slave port.
The master port displays "The master receives: I'm the slave".

Member Functions

7.4 WiFi Tutorial

The ESP32 supports WiFi function. Here we build a WiFi server with the ESP32, and use the client to connect it to control an LED remotely.

  WiFiAccessPoint.ino Create a wifi hotspot, and provide a web service

  1. Connect to the wifi "yourAp"
  2. Visit to turn on the LED; Visit to turn off the LED
     Run raw TCP "GET /H" and "GET /L" on PuTTY terminal with as IP address and 80 as port

#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiAP.h>

// Set your wifi and password
const char *ssid = "esp32";
const char *password = "";

WiFiServer server(80);

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);//Set pin LED to output mode 
  Serial.println("Configuring access point...");

  // Configure wifi and get IP address
  WiFi.softAP(ssid, password);
  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");

  Serial.println("Server started");

void loop() {
  WiFiClient client = server.available();   // listen for incoming clients

  if (client) {                             // if you get a client,
    Serial.println("New Client.");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c =;             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor
        if (c == '\n') {                    // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");

            // the content of the HTTP response follows the header:
            client.print("Click <a href=\"/H\">here</a> to turn ON the LED.<br>");
            client.print("Click <a href=\"/L\">here</a> to turn OFF the LED.<br>");

            // The HTTP response ends with another blank line:
            // break out of the while loop:
          } else {    // if you got a newline, then clear currentLine:
            currentLine = "";
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(LED_BUILTIN, HIGH);               // GET /H turns the LED on
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(LED_BUILTIN, LOW);                // GET /L turns the LED off
    // close the connection:
    Serial.println("Client Disconnected.");


Connect to the WiFi with a phone, and access through the browser. As shown in the figure, the IP address is, and the server has been started.

Server started

Use the browser to access the IP address, then you will get the result as shown in the figure below

Result 1-1

Click to turn the LED on/off.

Member Functions

7.5 Hall Sensor

The ESP32 comes with a hall sensor that presents positive/negative number when approaching a mangnetic field.

void setup()
void loop()


Hall sensor code

Member Function

7.5 Compacitive Keys

ESP32 provides the function of capacitive touch sensor. There are 9 touch sensors (T0, T2 ~ T9)available, corresponding to pins 4, 2, 15, 13, 12, 14, 27, 33 and 32 respectively. There is no need to set PinMode. The return value of touchRead() is within 0 ~ 255. The greater the touch force, the smaller the return value. Burning this sample code into your board, use the pin 4/D12 as the touch key, the touch value will be returned through the serial port monitor.

void setup()

void loop()



Member Functions

7.6 GDI

This is a DFRobot special GDI display interface. It can be conveniently connected to a screen with 18pin-FPC cable, easy to get started.

The pin list for GDI:

FPC PINS FireBeetle M0 PINS Description
VCC 3V3 3.3V
BLK(PWM adjustment) 12/D13 Backlit
SCLK 18/SCK SPI clock
MOSI 23/MOSI Master output, slave input
MISO 19/MISO Master input, slave output
DC 25/D2 Data/command
RES 26/D3 Reset
CS 14/D6 TFT chip select
SDCS 13/D7 SD card chip select
FCS 0/D5 Font library
TCS 4/D12 Touch
SCL 22/SCL I2C Clock
SDA 21/SDA I2C Data
INT 16/D11 INT
BUSY-TE 17/D10 Anti-tearing Pin
X1 NC User-defined pin 1
X2 NC User-defined pin 2

When using FPC to connect a screen, configure the corresponding pins according to GDL demo. Generally, you only need to configure the three pins for different maincontrollers.

GDI supported screen:

  1. 1.54inch 240x240 IPS TFT LCD Display with MicroSD Card Breakout
  2. 2.0inch 0x240 IPS TFT LCD Display with MicroSD Card Breakout
  3. 2.8inch 320x240 IPS TFT LCD Touchscreen with MicroSD
  4. 3.5inch 480x320 TFT LCD Capacitive Touchscreen
/*ESP32 and ESP8266*/
#elif defined(ESP32) || defined(ESP8266)
#define TFT_DC  25
#define TFT_CS  14
#define TFT_RST 26

For more details, please refer to:


FastLED is a powerful but easy-to-use Arduino third-party library for controlling LED strips such as WS2812 and LPD8806. At present, FastLED is recognized as one of the most widely used LED controlling libraries by Arduino developers. FireBeetle integrates FastLED into the core library. The following code demonstrates how to use the 5/D8 conneted RGB_LED.

#include <FastLED.h>

// How many leds in your strip?
#define NUM_LEDS 1

// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define DATA_PIN 5
#define CLOCK_PIN 13

// Define the array of leds

void setup() { 
    // Uncomment/edit one of the following lines for your leds arrangement.
    // ## Clockless types ##
    FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);  // GRB ordering is assumed

void loop() { 
  //LED light up in red 
  leds[0] = CRGB::Red;;
  // LED light up in green 
  leds[0] = CRGB::Green;;
  // LED light up in blue 
  leds[0] = CRGB::Blue;;

Member Functions

7.8 Sleep Mode

In sleep mode, the power consumption can be reduced to 10μA (disconnect the low-power pad). The following will demonstrate how to enter the sleep mode at a set time.

#define uS_TO_S_FACTOR 1000000ULL  /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP  5        /* Time ESP32 will go to sleep (in seconds) */

RTC_DATA_ATTR int bootCount = 0;

Method to print the reason by which ESP32
has been awaken from sleep
void print_wakeup_reason(){
  esp_sleep_wakeup_cause_t wakeup_reason;

  wakeup_reason = esp_sleep_get_wakeup_cause();

    case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break;
    case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break;
    case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break;
    case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break;
    case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break;
    default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break;

void setup(){
  delay(1000); //Take some time to open up the Serial Monitor

  //Increment boot number and print it every reboot
  Serial.println("Boot number: " + String(bootCount));

  //Print the wakeup reason for ESP32

  First we configure the wake up source
  We set our ESP32 to wake up every 5 seconds
  esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
  Serial.println("Setup ESP32 to sleep for every " + String(TIME_TO_SLEEP) +
  " Seconds");

  Next we decide what all peripherals to shut down/keep on
  By default, ESP32 will automatically power down the peripherals
  not needed by the wakeup source, but if you want to be a poweruser
  this is for you. Read in detail at the API docs
  Left the line commented as an example of how to configure peripherals.
  The line below turns off all RTC peripherals in deep sleep.
  //esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
  //Serial.println("Configured all RTC Peripherals to be powered down in sleep");

  Now that we have setup a wake cause and if needed setup the
  peripherals state in deep sleep, we can now start going to
  deep sleep.
  In the case that no wake up sources were provided but deep
  sleep was started, it will sleep forever unless hardware
  reset occurs.
  Serial.println("Going to sleep now");
  Serial.println("This will never be printed");

void loop(){
  //This is not going to be called

Member Functions

8. Arduino Tutorial Basics

8.1 GPIO

Digital IO

Control LED via Keys

Analog IO

8.2 Serial



Software Serial

Running time Function

Delay Functions

8.3 Tone Functions

8.4 Interrupt

8.5 I2C

IIC Master/Slave Pin

Different from the one-to-one communication mode of serial port, bus communication is usually divided into master and slave. During communication, the master is responsible for starting and terminating data transmission, and also outputs clock signal; the slave is addressed by the host and responds to the communication request of the host. The communication rate is controlled by the host, and the master outputs clock signal for all slaves on the bus through SCL pin. At the same time, I2C is a half duplex communication mode, that is, the devices on the bus transmit communication data through SDA pins, and the sending and receiving of data are controlled by the host computer. Esp32 has two I2C controllers (also known as ports) that handle communication on both I2C buses. Each I2C controller can run as a master or slave. Pin 21 is default to SDA, pin 22 to SCL.

8.6 SPI


ESP32 has four SPI peripherals: SPI0,SPI1, HSPI and VSPI.

  1. SPI0 is used for flash cache, and ESP32 maps the attached SPI flash device to memory.
  2. SPI1 and SPI0 share one hardware line, SPI1 is used to write flash chip.
  3. HSPI and VSPI can be used arbitrarily.
  4. SPI1, HSPI and VSPI have three chip selection lines, so as SPI host, ESP32 is allowed to drive up to three SPI devices.

9. Advanced Tutorials

9.1 How to use SD Library

SD Class

File Class

The file class provides the function of reading / writing files. The function of this class is very similar to the that of serial port related functions used before. The member functions are as follows.

9.2 IR Remote Control

IRrecv Class

IRrecv class can be used to receive and decode infrared signals. Before using this class, you need to instantiate an object of the class. Its member functions are as follows.

IRsend class

The IRsend class can encode and send infrared signals.

9.3 WIFI

ESP32 supports WiFi connection of both STA and AP mode.

#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
HTTPClient http;
const char* ssid="dfrobotOffice";
const char* password="dfrobot2011";
const char* ntpServer = "";
const long gmtOffset_sec = 28800;
const int daylightOffset_sec = 0;
DynamicJsonDocument doc(1024);
DynamicJsonDocument doc1(1024);

void printLocalTime(){
 struct tm timeinfo;
   Serial.println("Failed to obtian time");
   return ;
 Serial.println(&timeinfo,"%A, %B %d %Y %H:%M:%S");

void printLocalWeather(){
    int httpCode = http.GET();
    if(httpCode == HTTP_CODE_OK){
      String pageData = http .getString();
      JsonObject obj =<JsonObject>();
      String weatherInfo = obj["weatherinfo"];
      JsonObject obj1 =<JsonObject>();
      String city = obj1["city"];
      String temp1 = obj1["temp1"];
      String temp2 = obj1["temp2"];
      String weather = obj1["weather"];
      String cityInfo ="Address:"+ city;
      String tempInfo =" Temperature: " + temp1 + "~" + temp2;
      String cityWeatherinfo = " Weather: " + weather;
      Serial.println("The weather conditions obtained are as follows: ");
      Serial.println("GET ERR");

void setup() {
  Serial.printf("Connecting to %s",ssid);
  Serial.println(" CONNECTED");
  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);

 // printLocalWeather();  

void loop() {
  if(WiFi.status() == WL_CONNECTED){
    Serial.println("WiFi  Disconnect");

Description: This demo shows how to obtain the network time through WiFi function and get the weather by visiting the . "101010100" in this interface is the city code.

Note: you need to download arduino json library in this example, as shown below.








9.4 Blutooth

This demo creates a BLE_Server that can provide data and send notification for the client. When the server receives the data from the client, it will send the received data to the client in the form of notification. That is, the notification service provided by BLE server in this demo only serves to return the received client data.

#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
#define SERVICE_UUID             "DFCD0001-36E1-4688-B7F5-EA07361B26A8"
#define CHARACTERISTIC1_UUID     "DFCD000A-36E1-4688-B7F5-EA07361B26A8"
bool deviceConnected = false;
BLEServer *pServer;
BLEService *pService;
BLECharacteristic* pCharacteristic;
class MyServerCallbacks: public BLEServerCallbacks {
    void onConnect(BLEServer* pServer) {
      deviceConnected = true;

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

      if (value.length() > 0) {
        Serial.print("New value: ");
        for (int i = 0; i < value.length(); i++){
void setupBLE()
  BLEDevice::init("DFRobot_ESP32");   //Create BLE device 
  pServer = BLEDevice::createServer();   //Create BLE server 
  pServer->setCallbacks(new MyServerCallbacks());   //Set the callback function of the server 
  pService = pServer->createService(SERVICE_UUID); //Create BLE service 
  pCharacteristic = pService->createCharacteristic(
                                                 BLECharacteristic::PROPERTY_WRITE);   //Create the characteristic value of the service 
  pCharacteristic->setCallbacks(new MyCallbacks());    //Set the callback function of the chracteristic value 
  pCharacteristic->addDescriptor(new BLE2902());
  pCharacteristic->setValue("Hello DFRobot");
  BLEAdvertising *pAdvertising = pServer->getAdvertising();
void setup() {

void loop() {

BLE Usage

In this demo, the module FireBeetle ESP32-E acts as the BLE server, and the client could be a mobile phone. Install a BLE helper on the phone to establish BLE connection with the ESP32 module. Here we use the Light Blue on iPhone to show you how to do that, such kind of Bluetooth software can also be found on Android phones.

The operation on the client is as follows:








#### BLECharacteristic


10 Using with IFTTT

What is IFTTT?

If This Then That (commonly known as IFTTT, /ɪft/), is a web-based service that allows users to create chains of conditional statements triggered by changes that occur within other web services. It is both a website and a mobile app of free service with the following slogan: "Put the Internet to work for you". IFTTT aims to help people use the open API of various websites to monitor the triggers set by users. If triggers are triggered, actions set by users will be executed. Usually, we can create n applets to meet our various automation needs.


Email Sending


Configure IFTTT

  1. Enter IFTTT website, register an account if you don't have one. Then Sign in.


  1. The following interface will appear when you signed in.


  1. Click "Create" to enter the interface below.


  1. Click "if this" and input "webhooks" in the search bar.



  1. The following interface when entering for the first time, click "Receive a web request".


  1. Fill in the Event Name with "Message", then click "create this.


  1. The webpage will return back automatically. Click "that" and select "Email". Then click "send me an email".



  1. Click "Connect", fill in your emial address, and click "send PIN" to send a PIN code to your email box.



  1. Check your email to find the PIN code, and fill it in the webpage, then click "Connect".


  1. Click "Send me an Email" to edit the email.


  1. You can write the content to be sent to your email box in the interface below. Click "Create action".


  1. Click "Continue" to review, then click "Finish".



  1. Check IFTTT_Key: click your avatar, click "My services"-"Webhooks"-"Documentation", then copy your key.



Sample Code

Sample Code

#include <WiFi.h>
#include <HTTPClient.h>
//Configure WiFi name and password
char *WIFI_SSID           = "WIFI_SSID";
//Configure IFTTT
char *IFTTT_ENVENT        = "Your_Event";
char *IFTTT_KEY           = "Your_Key";
//IFTTT Send Message
char *IFTTT_VALUE_1       = "Value1";
char *IFTTT_VALUE_2       = "Value2";
char *IFTTT_VALUE_3       = "Value3";
HTTPClient ifttt;
unsigned long lastTime = 0;
unsigned long timerDelay = 10000;
void setup() {
while(WiFi.status() != WL_CONNECTED) {
Serial.print("Wifi Connect Success");
void loop() {
//Send an HTTP POST request every 10 seconds
if ((millis() - lastTime) > timerDelay) {
//Check WiFi connection status
if(WiFi.status()== WL_CONNECTED){
      int dataSendState = ifttt.IFTTTSend(IFTTT_VALUE_1,IFTTT_VALUE_2,IFTTT_VALUE_3);
       Serial.println(dataSendState);//Whether the printing data is sent successfully
    }else {
    Serial.println("WiFi Disconnected");
lastTime = millis();
//Configure WiFi name and password
char *WIFI_SSID           = "WIFI_SSID";//Input WiFi name 
char *WIFI_PASSWORD       = "WIFI_PASSWORD";//Input WiFi Password 
//Configure IFTTT
char *IFTTT_ENVENT        = "Your_Event";//Input Event Name 
char *IFTTT_KEY           = "Your_Key";//Input the key you found in IFTTT
//IFTTT Send Message
char *IFTTT_VALUE_1       = "Value1";
char *IFTTT_VALUE_2       = "Value2";
char *IFTTT_VALUE_3       = "Value3";//Configure the three values in email information 


Receive the data from FireBeele-ESP32-E in the Email box.




Q1. the driver is not installed automatically after plugging into the device?
A1. Windows——click to download the CH340 driver program Mac——click to download the CH340 driver program

If you have any questions about using this product, please check the FAQ list for that product for a corresponding solution. And for any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Get FireBeetle_Board_ESP32_E from DFRobot Store or DFRobot Distributor.

Turn to the Top