Product Introduction
The ESP32-C3 SuperMini is an IoT mini development board based on the Espressif ESP32-C3 WiFi/Bluetooth dual-mode chip. The ESP32-C3 is a 32-bit RISC-V CPU that contains the FPU (floating point unit) for 32-bit single-precision operations with powerful computing power. It has excellent performance and supports IEEE 802.11b/g/n WiFi and Bluetooth 5 (LE) protocols. The board comes with an external antenna to enhance signal strength for wireless applications. It also has a small and delicate form factor combined with a single-sided surface mount design. It is equipped with a wealth of interfaces, with 11 digital I/Os that can be used as PWM pins and 4 analog I/Os that can be used as ADC pins. It supports four serial interfaces: UART, I2C, and SPI. The board also has a small reset button and a boot loader mode button.
Combined with the above features, the ESP32C3SuperMini is positioned as a high-performance, low-power, cost-effective IoT mini development board for low-power IoT applications and wireless wearable applications.
Product Parameters
- Powerful CPU: ESP32-C3, 32-bit RISC-V single-core processor, running up to 160 MHz
- WiFi: 802.11b/g/n protocol, 2.4GHz, supports Station mode, SoftAP mode, SoftAP+Station mode, hybrid mode
- Bluetooth: Bluetooth 5.0
- Ultra-low power consumption: Deep sleep power consumption of about 43uA
- Rich board resources: 400KB SRAM, 384KB ROM, built-in 4MB flash
- Chip model: ESP32C3FN4
- Ultra-small size: As small as a thumb (22.52x18mm) classic shape, suitable for wearables and small projects
- Reliable security features: Encryption hardware accelerators that support AES-128/256, hashing, RSA, HMAC, digital signatures, and secure startup
- Rich interface: 1x I2C, 1x SPI, 2x UART, 11x GPIO (PWM), 4x ADC
- Design: Single-sided components, surface mount design
- Onboard LED: Blue light on GPIO8 pin
Board Dimensions
The board measures approximately 18.00mm in width and 22.52mm in height. The chip itself is a QFN32 5x5 package.
[Diagram Description: A top-down view of the ESP32-C3 SuperMini board showing pin labels and dimensions. Key pins labeled include 5V, GND, 3.3V, RST (Reset), BOOT, and various GPIO pins (0-10, 20, 21). Dimensions 18.00mm and 22.52mm are indicated. A small image of the ESP32-C3 chip package (QFN32 5x5) is also shown.]
External Power Supply
If an external power supply is required, connect the positive (+) terminal to the 5V pin and the GND to the negative terminal. The supported voltage range is 3.3V to 6V. Note that when using an external power supply, USB cannot be accessed simultaneously; you must choose one or the other.
Caution: When soldering, be careful not to short-circuit the positive and negative electrodes, as this can burn the battery and equipment.
WIFI Antenna
The board is equipped with an external antenna for enhanced WiFi signal strength.
Hardware Setup
To get started, you will need:
- 1x ESP32-C3 SuperMini board
- 1x Computer
- 1x USB Type-C data cable (ensure it supports data transfer, not just power)
[Diagram Description: An illustration showing the ESP32-C3 SuperMini board and a USB Type-C connector, with an arrow indicating connection. The board diagram highlights the USB-C port.]
Software Setup
This section guides you through setting up the Arduino IDE to program the ESP32-C3 SuperMini.
Step 1: Install Arduino IDE
Download and install the latest version of the Arduino IDE suitable for your operating system.
Step 2: Start the IDE Application
Launch the Arduino IDE after installation.
Step 3: Add ESP32 Board Package
Navigate to File > Preferences and add the following URL to the "Additional Boards Manager URLs" field:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Step 4: Open Boards Manager
Go to Tools > Board > Boards Manager.... Search for "esp32", select the latest version available, and click "Install".
Step 5: Select Development Board and Port
Navigate to Tools > Development board > ESP32 and select "ESP32C3 Dev Module". The list can be long, so scroll to find it.
Next, go to Tools > Port and select the serial port name corresponding to your ESP32-C3 SuperMini (e.g., COM3 or higher, as COM1 and COM2 are often reserved for hardware serial ports).
Flashing LED Example
This example demonstrates how to control the onboard LED.
Code
// Define led according to pin diagram
int led = 8;
void setup() {
// Initialize digital pin led as an output
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH); // Turn the LED on
delay(1000); // Wait for a second
digitalWrite(led, LOW); // Turn the LED off
delay(1000); // Wait for a second
}
After uploading this code, the onboard LED will flash on and off with a 1-second delay between each state.
FAQ
Com Port Cannot Be Recognized on IDE
Method 1: Press and hold the BOOT button while powering on the board.
Method 2: Press and hold the BOOT button, then press and release the RESET button, and finally release the BOOT button. This will put the ESP32C3 into download mode. Note that you may need to re-enter download mode for each connection, and port instability can occur.
Program Will Not Run After Upload
After a successful upload, press the RESET button to execute the program.
ESP32 C3 SuperMini Serial Port Cannot Print
Ensure that "USB CDC On Boot" is set to "Enabled" in the Arduino IDE settings.
WiFi Functionality
Scan WiFi Networks (Station Mode)
This example shows how to scan for available WiFi networks in Station (STA) mode.
Code
#include "WiFi.h"
void setup() {
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
}
void loop() {
Serial.println("scan start");
// WiFi.scanNetworks() will return the number of networks found
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n == 0) {
Serial.println("no networks found");
} else {
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i) {
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*");
delay(10);
}
}
Serial.println("");
// Wait a bit before scanning again
delay(5000);
}
Upload the code and open the serial monitor to see the scanned WiFi networks.
Connect to WiFi Network
This example demonstrates connecting the board to a WiFi network.
Code
#include <WiFi.h>
const char* ssid = "your-ssid"; // Your WiFi Name
const char* password = "your-password"; // Your WiFi password
void setup() {
Serial.begin(115200);
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// Empty loop for this example
}
Upload the code and use the serial monitor to verify the connection and IP address.
WiFi Hotspot
This example configures the ESP32-C3 SuperMini to act as a WiFi access point.
Code
#include "WiFi.h"
void setup() {
Serial.begin(115200);
WiFi.softAP("ESP_AP", "123456789"); // Set AP name and password
}
void loop() {
Serial.print("Host Name:");
Serial.println(WiFi.softAPgetHostname());
Serial.print("Host IP:");
Serial.println(WiFi.softAPIP());
Serial.print("Host IPV6:");
Serial.println(WiFi.softAPIPv6());
Serial.print("Host SSID:");
Serial.println(WiFi.SSID());
Serial.print("Host Broadcast IP:");
Serial.println(WiFi.softAPBroadcastIP());
Serial.print("Host mac Address:");
Serial.println(WiFi.softAPmacAddress());
Serial.print("Number of HostConnections:");
Serial.println(WiFi.softAPgetStationNum());
Serial.print("Host Network ID:");
Serial.println(WiFi.softAPNetworkID());
Serial.print("Host Status:");
Serial.println(WiFi.status());
delay(1000);
}
Upload and monitor the serial output for details about the created WiFi access point.
Bluetooth Functionality
Scan Bluetooth Devices
This example demonstrates scanning for nearby Bluetooth devices.
Code
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>
int scanTime = 5; // Scan duration in seconds
BLEScan* pBLEScan;
class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
void onResult(BLEAdvertisedDevice advertisedDevice) {
Serial.printf("Advertised Device: %s \n", advertisedDevice.toString().c_str());
}
};
void setup() {
Serial.begin(115200);
Serial.println("Scanning...");
BLEDevice::init("");
pBLEScan = BLEDevice::getScan(); // Create new scan
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
pBLEScan->setActiveScan(true); // Active scan uses more power, but gets results faster
pBLEScan->setInterval(100);
pBLEScan->setWindow(99); // less or equal setInterval value
}
void loop() {
// Put your main code here, to run repeatedly:
BLEScanResults foundDevices = pBLEScan->start(scanTime, false);
Serial.print("Devices found: ");
Serial.println(foundDevices.getCount());
Serial.println("Scan done!");
pBLEScan->clearResults(); // Delete results from BLEScan buffer to release memory
delay(2000);
}
Upload the code and use the serial monitor to view discovered Bluetooth devices.
As a Bluetooth Server
This example sets up the ESP32-C3 SuperMini as a Bluetooth server, allowing a smartphone to connect and display data.
Code
#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);
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);
}
Usage with LightBlue App
- Upload the code and open the serial monitor.
- Download and install the LightBlue app on your smartphone.
- Turn on Bluetooth on your phone, place it near the ESP32-C3 SuperMini, scan for devices, and connect to "MyESP32".
- Open the LightBlue application and click the "Bonded" tab.
- Click "CONNECT" next to "MyESP32".
- Tap where "Readable, Writable" is displayed.
- Under the "Data Format" dropdown, select "UTF-8 String".
- Type "Hello" under "WRITTEN VALUES" and click "WRITE".
You will see the text string "Hello" output on the IDE's serial monitor.
ChatGPT Integration
The ESP32-C3 SuperMini can be used for applications involving ChatGPT. For example, you can configure a ChatGPT Q&A page. The SuperMini records your question, uses an API call method provided by OpenAI via an HTTP client to send a request, gets the ChatGPT answer, and prints it to the serial port.
Steps:
- Connect the ESP32C3SuperMini to the network.
- Build embedded web pages.
- Submit questions via the built-in web page.
- Get answers from ChatGPT.
For more information, search for related materials.
Pin Usage
The ESP32C3SuperMini offers versatile interfaces: 11 digital I/Os (usable as PWM pins) and 4 analog inputs (usable as ADC pins). It supports UART, I2C, SPI, and I2S serial communication interfaces.
The default motherboard GPIO numbering starts from 010, 20, 21. Pins A0-A5 are also available. The following pin map helps identify pin functions (analog or digital) when the "ESP32C3 Dev Module" is selected in the Arduino IDE.
Pin Map
[Diagram Description: A textual representation of the pin map, listing pin numbers and their corresponding functions.]
static const uint8_t TX = 21;
static const uint8_t RX = 20;
static const uint8_t SDA = 8;
static const uint8_t SCL = 9;
static const uint8_t SS = 7;
static const uint8_t MOSI = 6;
static const uint8_t MISO = 5;
static const uint8_t SCK = 4;
static const uint8_t A0 = 0;
static const uint8_t A1 = 1;
static const uint8_t A2 = 2;
static const uint8_t A3 = 3;
static const uint8_t A4 = 4;
static const uint8_t A5 = 5;
Digital Pin Control
Upload the following code to make the onboard LED light up every second.
Code
int led = 8; // LED connected to digital pin 8
void setup() {
// Initialize digital pin led as an output
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH); // Turn the LED on
delay(1000); // Wait for a second
digitalWrite(led, LOW); // Turn the LED off
delay(1000); // Wait for a second
}
Digital PWM
Upload the following code to observe the onboard LED gradually dimming and brightening.
Code
int ledPin = 8; // LED connected to digital pin 8
void setup() {
// Declare LED pin as output
pinMode(ledPin, OUTPUT);
}
void loop() {
// Fade in from min to max in increments of 5 points
for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
// Set the value (range from 0 to 255)
analogWrite(ledPin, fadeValue);
// Wait for 30 milliseconds to see the dimming effect
delay(30);
}
// Fade out from max to min in increments of 5 points
for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
// Set the value (range from 0 to 255)
analogWrite(ledPin, fadeValue);
// Wait for 30 milliseconds to see the dimming effect
delay(30);
}
}
Analog Pin Control
Connect a potentiometer to pin A5. Upload the following code to control the flashing interval of the LED by turning the potentiometer knob.
Code
const int sensorPin = A5;
const int ledPin = 8;
void setup() {
pinMode(sensorPin, INPUT); // Declare the sensorPin as an INPUT
pinMode(ledPin, OUTPUT); // Declare the ledPin as an OUTPUT
}
void loop() {
// Read the value from the sensor
int sensorValue = analogRead(sensorPin);
// Turn the ledPin on
digitalWrite(ledPin, HIGH);
// Stop the program for <sensorValue> milliseconds
delay(sensorValue);
// Turn the ledPin off
digitalWrite(ledPin, LOW);
// Stop the program for <sensorValue> milliseconds
delay(sensorValue);
}
Serial Port
The board features two hardware serial ports:
- USB serial port: Enabled by default. Connect the board via USB Type-C to your PC and use the serial monitor in the Arduino IDE to view data.
- ART serial port: To use this, connect pin 20 as TX and pin 21 as RX using a USB serial adapter. You will also need to disable "USB CDC On Boot" in the Arduino IDE settings.
[Diagram Description: A pinout diagram of the ESP32-C3 SuperMini board, similar to the one shown earlier, highlighting the USB Type-C connection and indicating the TX/RX pins (20/21) for serial communication. Color-coded legend for pin types: Power, ADC, SPI, GND, UART, Digital.]
Software Serial Port
For additional serial ports, the SoftwareSerial library can be used to create software serial ports.
I2C Communication
This section details the connection of the ESP32C3 SuperMini with a 0.96-inch OLED display via I2C.
ESP32C3SuperMini | 0.96" OLED |
---|---|
5V | VCC |
GND | GND |
SCL | SCL |
SDA | SDA |
Steps to use with OLED:
- Open Arduino IDE and navigate to Sketch > Include Library > Manage Libraries....
- Search for "u8g2" and install it.
- Upload the code to display text strings on the OLED display.