MakerLab
ESP32ESP32-C2 (ESP8684)

ESP32-C2 (ESP8684): The Compact and Capable Wi-Fi Microcontroller

Explore the ESP32-C2, a cost-effective and power-efficient Wi-Fi and Bluetooth LE microcontroller from Espressif, ideal for simple IoT devices and battery-powered applications.

ESP32-C2 (ESP8684)

The ESP32-C2, officially known by its SoC name ESP8684, is a recent addition to Espressif's popular ESP32 family, released around 2022. It represents a more streamlined and cost-optimized offering compared to its more feature-rich siblings like the ESP32 or ESP32-S3. Designed for applications where basic Wi-Fi connectivity and low power consumption are paramount, the ESP32-C2 is an excellent choice for makers and engineers looking for an affordable entry point into the world of connected embedded systems.

At its heart, the ESP8684 SoC features a single-core 32-bit RISC-V processor, which, while less powerful than the dual-core Xtensa LX6 or LX7 found in other ESP32 variants, provides sufficient performance for many IoT tasks. It integrates 2.4 GHz Wi-Fi (802.11 b/g/n) and Bluetooth 5 (LE) capabilities, making it versatile for wireless communication. This combination makes it suitable for a wide range of applications, from simple sensor nodes to basic smart home devices.

The ESP32-C2 is positioned as a budget-friendly alternative for projects that don't require the extensive peripherals or processing power of higher-end ESP32 chips. Its strengths lie in its low power consumption, compact size, and integrated wireless connectivity, making it ideal for battery-operated devices or applications where space and cost are critical constraints. Makers focused on simple data logging, remote control, or basic automation will find the ESP32-C2 a compelling option.

While it may lack some of the advanced features of other ESP32 chips, such as hardware cryptographic acceleration or a rich set of peripherals like a camera interface or extensive I2S, the ESP32-C2 compensates with its simplicity and affordability. It's a great platform for learning about embedded systems, IoT development, and wireless communication without a significant financial investment.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCESP8684
Architecture32-bit RISC-V single-core processor
Clock speedUp to 160 MHz (typical)
Flash / StorageOn-chip 4MB SPI Flash
RAM / SRAM272 KB SRAM (including 16KB cache)
Operating voltage3.0V - 3.6V
Digital I/O pinsUp to 24 GPIO
Analog / ADCUp to 5 ADC channels (12-bit resolution)
PWMYes, up to 16 channels
ConnectivityWi-Fi 802.11 b/g/n (2.4 GHz), Bluetooth 5 (LE)
USBUSB-to-Serial (via external chip, e.g., CP2102 or CH340)
Power inputTypically via 5V micro-USB or 3.3V pin
DimensionsVaries by development board, typical module ~25.6mm x 19.2mm

Pinout & pin functions

PinFunction
3V3Power input (3.3V)
GNDGround
ENEnable pin (active high)
IO2GPIO2 (Input/Output, ADC2, touch)
IO3GPIO3 (Input/Output, ADC1, touch)
IO4GPIO4 (Input/Output, ADC0, touch)
IO5GPIO5 (Input/Output, touch)
IO6GPIO6 (Input/Output, SPI Flash CS)
IO7GPIO7 (Input/Output, SPI Flash DO)
IO8GPIO8 (Input/Output, SPI Flash DI)
IO9GPIO9 (Input/Output, SPI Flash CLK)
IO10GPIO10 (Input/Output, SPI Flash HD)
IO11GPIO11 (Input/Output, SPI Flash WD)
IO12GPIO12 (Input/Output, UART2 TX)
IO13GPIO13 (Input/Output, UART2 RX)
IO14GPIO14 (Input/Output, I2C SDA)
IO15GPIO15 (Input/Output, I2C SCL)
IO16GPIO16 (Input/Output, SPI MOSI)
IO17GPIO17 (Input/Output, SPI MISO)
IO18GPIO18 (Input/Output, SPI SCK)
IO19GPIO19 (Input/Output, UART1 TX)
IO20GPIO20 (Input/Output, UART1 RX)
IO21GPIO21 (Input/Output, touch)
VPADC1_CH0 (Analog input)
VNADC1_CH3 (Analog input)
APADC2_CH4 (Analog input)
ANADC2_CH5 (Analog input)

Wiring & circuit basics

Powering the ESP32-C2 module or development board is straightforward. Most boards feature a micro-USB port which provides 5V power. An onboard voltage regulator steps this down to the 3.3V required by the ESP8684 SoC and other components. Alternatively, you can power the board by applying a stable 3.3V to the '3V3' pin and connecting ground to a 'GND' pin. Ensure your power source can supply at least 500mA, especially when Wi-Fi is active, to prevent brownouts and instability.

The ESP32-C2 operates at a logic level of 3.3V. This means its GPIO pins output and expect signals within the 0V to 3.3V range. Connecting a 5V device directly to a GPIO pin can damage the microcontroller. If you need to interface with 5V logic devices, use a level shifter. For example, to connect an LED, you would connect a GPIO pin to the anode of the LED, the cathode to a current-limiting resistor (typically 220-330 ohms), and the other end of the resistor to a GND pin.

For connecting sensors, I2C is a common choice. The ESP32-C2 has dedicated pins for I2C communication, typically GPIO14 (SDA) and GPIO15 (SCL). To connect an I2C sensor like a BME280 or an MPU6050, connect the sensor's SDA pin to GPIO14, its SCL pin to GPIO15, its VCC to the board's 3V3 pin, and its GND to the board's GND pin. Remember to check the sensor's datasheet for its operating voltage and any specific wiring requirements, such as pull-up resistors (though many development boards have these built-in).

Programming & getting started

The ESP32-C2 is well-supported by popular development environments. For Arduino users, you can add ESP32 board support to the Arduino IDE via the Board Manager, selecting the ESP32-C2 or a compatible board. MicroPython and CircuitPython also offer firmware for the ESP8684, allowing you to program the device using Python. For more advanced control and lower-level access, Espressif's ESP-IDF framework is the official SDK, providing C/C++ development capabilities. PlatformIO is another excellent option, integrating support for multiple frameworks and boards within a single IDE.

To upload your first program (a 'Blink' sketch for Arduino IDE), connect your ESP32-C2 board to your computer via USB. Select the correct board and COM port in the Arduino IDE. Write or paste the Blink sketch, which blinks the onboard LED (usually connected to GPIO2). Click the Upload button. The IDE will compile the code and flash it to the ESP32-C2. You may need to press and hold the 'BOOT' or 'FLASH' button on your board while uploading if the auto-reset mechanism doesn't work.

Project ideas

Simple Weather StationMonitor temperature and humidity using an I2C sensor (e.g., BME280) connected to GPIO14/15. The ESP32-C2 can then upload this data via Wi-Fi to a cloud service or local server, teaching basic sensor interfacing and Wi-Fi networking.
Remote Controlled LED DimmerControl the brightness of an LED connected to a PWM-capable GPIO pin using a web interface hosted by the ESP32-C2. This project demonstrates PWM control and web server implementation.
Battery Powered Motion DetectorUse a PIR motion sensor connected to a digital input pin. The ESP32-C2 can wake from deep sleep when motion is detected, send a notification via Wi-Fi, and then return to deep sleep to conserve power, illustrating low-power techniques.
Basic Bluetooth LE BeaconConfigure the ESP32-C2 to broadcast sensor data (e.g., temperature) using Bluetooth Low Energy. This is useful for creating simple proximity alerts or data logging on a nearby smartphone, teaching BLE advertising.
Wi-Fi Connected ButtonConnect a simple push button to a GPIO pin. When pressed, the ESP32-C2 sends a message over Wi-Fi to a server or triggers an action, such as turning on a light via a smart home hub, covering basic input sensing and network communication.
Smart Plug MonitorUse a current sensor (e.g., ACS712) and a relay module with the ESP32-C2. The device can monitor power consumption of an appliance and remotely switch it on/off via Wi-Fi, demonstrating power monitoring and control.

Buying tips & gotchas

When purchasing an ESP32-C2, you'll likely find it on small development boards rather than as a bare module. Look for boards with a USB-to-serial converter (like CP2102 or CH340) for easy programming. Be aware that while the ESP8684 chip has many GPIOs, not all are broken out on every development board. Always check the specific board's pinout diagram. Avoid powering the board directly from a weak USB port; use a powered USB hub or a dedicated 5V power supply if encountering issues. Ensure you have appropriate 3.3V logic level shifters if interfacing with 5V components. Consider accessories like breadboards, jumper wires, and a selection of sensors (temperature, humidity, motion) to get started quickly.