ESP32 C3 Super Mini - DHT11
This beginner-friendly tutorial shows you how to use the ESP32 C3 Super Mini with a DHT11 temperature and humidity sensor to monitor environmental conditions. You'll learn to wire the DHT11 sensor to your ESP32 C3 Super Mini, program it to read data, and display real-time temperature and humidity readings on the Serial Monitor.
In this tutorial, you'll learn:
- What the DHT11 sensor is and how it measures temperature and humidity
- How to wire DHT11 sensor and module to ESP32 C3 Super Mini
- How to install the DHT library and write code to read sensor data
- How to display temperature in Celsius and Fahrenheit on Serial Monitor
- The difference between DHT11 raw sensor and module versions

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of DHT11 Temperature and Humidity Sensor
The DHT11 is a low-cost digital sensor that measures both temperature and humidity in the environment.
Key specifications:
- Humidity range: 20% to 80%
- Humidity accuracy: ±5%
- Temperature range: 0°C to 50°C
- Temperature accuracy: ±2°C
- Reading rate: 1Hz (one reading per second)
- Operating voltage: 3V to 5V
Why beginners love the DHT11:
- Very affordable and easy to find
- Simple digital interface - no complex analog reading needed
- Works perfectly with ESP32 C3 Super Mini projects
- Available as both raw sensor and ready-to-use module
DHT11 Pinout
The DHT11 comes in two forms: a raw sensor with 4 pins and a convenient module with 3 pins.

DHT11 Raw Sensor (4 pins):
- GND: Connect to ground (0V)
- VCC: Connect to power (3.3V or 5V)
- DATA: Communication pin to send readings to ESP32 C3 Super Mini
- NC: Not connected (leave unconnected)
DHT11 Module (3 pins):
- VCC (or +): Connect to power
- GND (or -): Connect to ground
- DATA (or OUT): Communication pin to ESP32 C3 Super Mini
Recommendation: Use the DHT11 module version as it has a built-in pull-up resistor, making wiring simpler and more reliable.
Wiring Diagram between DHT11 and ESP32 C3 Super Mini
Follow these wiring diagrams to connect your DHT11 sensor to the ESP32 C3 Super Mini.
- Note: If using the raw DHT11 sensor, you'll need a 10kΩ pull-up resistor between DATA and VCC pins for reliable communication.
ESP32 C3 Super Mini - DHT11 Sensor Wiring

This image is created using Fritzing. Click to enlarge image
| DHT11 Sensor Pin | ESP32 C3 Super Mini Pin |
|---|---|
| GND | GND |
| VCC | 3.3V |
| DATA | D4 |
- Note: Connect a 10kΩ resistor between DATA and VCC pins.
ESP32 C3 Super Mini - DHT11 Module Wiring
Most DHT11 modules have a built-in pull-up resistor, eliminating the need for external components.

This image is created using Fritzing. Click to enlarge image
| DHT11 Module Pin | ESP32 C3 Super Mini Pin |
|---|---|
| GND (or -) | GND |
| VCC (or +) | 3.3V |
| DATA (or OUT) | D4 |
ESP32 C3 Super Mini Code - DHT11
The following code reads temperature and humidity from the DHT11 sensor and displays the results on the Serial Monitor.
What this code does:
- Initializes the DHT11 sensor on D4
- Reads temperature and humidity every 2 seconds
- Displays humidity as a percentage
- Shows temperature in both Celsius and Fahrenheit
- Handles sensor read errors gracefully
Detailed Instructions
- New to ESP32 C3 Mini? Complete our Getting Started with ESP32 C3 Mini tutorial first to set up your development environment.
- Set up your Arduino IDE: If this is your first time with ESP32 C3 Super Mini, follow the environment setup tutorial for Arduino IDE.
- Wire the components: Follow the wiring diagram above to connect DHT11 to ESP32 C3 Super Mini.
- Connect the board: Plug your ESP32 C3 Super Mini into your computer using a USB Type-C cable.
- Open Arduino IDE: Launch the Arduino IDE on your computer.
- Select your board: Choose ESP32 C3 Super Mini and select the correct COM port.
- Open Library Manager: Click the Library Manager icon on the left sidebar.
- Search for DHT library: Type "DHT" in the search box and find the DHT sensor library by Adafruit.
- Install the library: Click the Install button.

- Install dependencies: When prompted, click Install All to install required dependencies.

- Copy the code: Copy the code provided above and paste it into Arduino IDE.
- Upload the code: Click the Upload button to compile and upload to your ESP32 C3 Super Mini.
- Test the sensor: Try changing the temperature by placing the sensor near something warm (like a coffee cup) or cool.
- Open Serial Monitor: View your readings in the Serial Monitor at 9600 baud rate.
- Pro Tip: Wait at least 2 seconds after powering up before taking your first reading for accurate results.
Serial Monitor Output
Open the Serial Monitor and you'll see temperature and humidity readings updating every 2 seconds:
Application and Project Ideas
Now that you can read temperature and humidity with your ESP32 C3 Super Mini and DHT11, try these project ideas:
- Smart home climate monitor: Track indoor temperature and humidity levels throughout the day
- Greenhouse automation: Monitor and log environmental conditions for plants
- Weather station: Build a basic weather monitoring system with data logging
- Comfort level indicator: Create LED alerts when humidity or temperature goes outside comfortable ranges
- Data logger: Record temperature and humidity to SD card or cloud service
- Terrarium controller: Monitor and maintain optimal conditions for reptiles or plants
Video Tutorial
Watch the video below for a visual walkthrough of this project.
Challenge Yourself
Ready to take your ESP32 C3 Super Mini DHT11 project further? Try these challenges:
- Easy: Add an LED that turns on when temperature exceeds 25°C
- Easy: Display "Comfortable" or "Uncomfortable" based on humidity levels (comfortable range: 30-60%)
- Medium: Add a push button to switch between Celsius and Fahrenheit display
- Medium: Store the last 10 readings and display minimum and maximum values
- Advanced: Send temperature and humidity data to a web server or IoT platform like ThingSpeak
- Advanced: Create a heat index calculator that combines temperature and humidity for "feels like" temperature