Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To send temperature and humidity readings from a DHT sensor to Arduino Cloud, create a Cloud Thing for your ESP8266, add temperature and humidity variables, connect the board to Wi-Fi, and update those variables in your sketch with valid sensor readings. You can then display the Cloud variables in a dashboard. The Arduino documentation and library catalog support these individual steps, but do not provide a verified, combined DHT-and-ESP8266 Cloud example; treat the sketch pattern below as an implementation guide, not an official tested example.

What you need

  • An ESP8266 board, such as a board supported by Arduino Cloud’s ESP32 / ESP8266 setup path.
  • A DHT-family sensor, such as a DHT11 or DHT22. The Arduino Library Manager catalog lists a DHT sensor library supporting both models and the ESP8266 architecture (DHT sensor library for ESPx, listing version 1.19.0, dated 2023-04-14).
  • A Wi-Fi network and its credentials, plus an Arduino Cloud account.
  • Wiring suitable for your particular board and sensor. Check both devices’ documentation for pinout, supply requirements, and input-level limits; those values are not universal across all boards and sensor modules.

1. Configure the ESP8266 in Arduino Cloud

Arduino’s Cloud documentation index links to setup guidance for ESP32 and ESP8266 boards (ESP32 / ESP8266 setup). Follow the current guide for your specific board to add or configure it as a Cloud device. Arduino’s general Thing workflow covers creating a Thing, attaching a device, defining variables, and entering network credentials (Arduino Cloud getting started tutorial, revision listed 2026-09-22).

  1. Create a Thing in Arduino Cloud and associate your ESP8266 device with it.
  2. Add a temperature variable and a humidity variable. Choose variable types that match the values your sketch will assign, and use the generated property names consistently in the code.
  3. Configure the required Wi-Fi network credentials in the Cloud workflow or generated sketch, following the current prompts for your device.

2. Wire the sensor and prepare its library

Identify the DHT model and the pin labels on your actual module before connecting it. Use the sensor and ESP8266 board documentation to confirm power, ground, data-pin wiring, and electrical compatibility. Do not assume every DHT breakout or ESP8266 board has identical pinout or voltage limits.

Install a DHT library from Arduino Library Manager. The cataloged DHT sensor library for ESPx lists DHT11 and DHT22 support and ESP8266 compatibility. Check the installed library’s documentation and current API for the exact include, constructor, sensor-type selection, and initialization sequence; these details can vary by library version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
HiLetgo 5pcs DHT11 Temperature Humidity Sensor Module Digital Temperature Humidity Sensor 3.3V-5V Humidity Measure Range 20%-95% Temperature Measure Range 0-50℃ Celsius with Wires
  • DHT11 digital temperature and humidity sensor is a digital signal output with a calibrated temperature and humidity combined sensor.
  • It uses a dedicated digital modules and acquisition of temperature and humidity sensor technology to ensure that products with high reliability and excellent long term stability.
  • Sensor consists of a resistive element and a sense of wet NTC temperature measurement devices, and with a high-performance 8-bit microcontroller connected.
  • The product has excellent quality, fast response, anti-interference ability, high cost and other advantages.
  • The single-wire wiring scheme makes it easy to be integrated to other applications.And the simple communication protocol greatly reduces the programming effort required.

3. Read the sensor and update Cloud variables

Use the sketch generated for your Cloud Thing as the starting point, because it supplies the board-specific Cloud properties and connection setup. Preserve its generated property names and connection-handling code. In the main loop, service the Cloud connection as the generated sketch requires, obtain readings through your installed DHT library, and assign only valid values to the corresponding Cloud variables.

Conceptually, the application logic is:

  1. Initialize the DHT sensor and Cloud properties in setup(), following the installed library and generated sketch conventions.
  2. In loop(), run the generated Cloud connection handler.
  3. Read temperature and humidity using the DHT library’s documented calls.
  4. Check that each reading is valid and finite before assigning it to its Cloud variable. If a read fails, do not publish the failed or non-finite value as a genuine measurement; skip that update or handle the error explicitly.

The exact integrated code is dependent on the generated Cloud sketch and installed library API. The cited Arduino material establishes the Cloud workflow and library compatibility, but not a directly verified end-to-end DHT-plus-ESP8266 sketch.

Rank #2
Lonely Binary 6-Pack DHT22 DHT11 Temperature Humidity Sensor AM2302
  • 【MIXED SENSOR BUNDLE (3x DHT22 + 3x DHT11)】Includes 3 DHT22 sensors for applications like weather stations or greenhouses, and 3 DHT11 sensors for basic indoor monitoring, organized in a storage container.
  • 【CALIBRATED DIGITAL OUTPUT】Calibrated digital outputs for temperature and humidity readings — for ESP32, ESP8266, STM32, and other MCU-based DIY electronics.
  • 【GOLD IMMERSION PLATING】Gold-plated contacts for corrosion resistance and signal integrity in humid environments. Lead-free, RoHS-compliant.
  • 【WIDE COMPATIBILITY (3.3V–5V)】Works with microcontrollers operating on 3.3V to 5V (up to 6V for DHT22), using single-wire digital communication — no extra components needed for most projects like smart home automation or data logging.
  • 【DHT22 vs DHT11 SPECS】DHT22: -40°C to 80°C, 0–100% RH, ±0.5°C/±2% accuracy for precise needs. DHT11: 0–50°C, 20–80% RH, ±2°C/±5% accuracy for basic monitoring. Choose based on your project.

4. Display readings in a dashboard

After the Thing is online and its variables update, create an Arduino Cloud dashboard and add widgets linked to the temperature and humidity variables. Arduino Cloud documents dashboards and widgets as platform features (Arduino Cloud getting started tutorial). The data path is sensor reading in the sketch, assignment to Cloud variables, then visualization through the dashboard.

Troubleshooting

  • No sensor reading: Recheck the sensor’s wiring and power against its model documentation, verify the selected sensor type in the library initialization, and confirm the data pin matches the wiring.
  • Cloud device stays offline: Verify Wi-Fi credentials, network availability, and the connection status reported by the generated Cloud sketch.
  • Device is online but dashboard values do not change: Confirm that the sketch assigns values to the exact Cloud variables defined in the Thing and that their types match. Check that valid reads are occurring and that the loop continues to service the Cloud connection.
  • Intermittent or implausible values: Inspect connections and power, confirm the correct sensor model is selected, and avoid treating failed reads as measurements.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

DHT11 or DHT22?

The cited library catalog lists support for both DHT11 and DHT22, but that compatibility information alone does not establish their comparative accuracy, measurement range, update interval, or price. Choose based on the needs of your project and the manufacturer’s datasheet for the specific sensor. Whichever model you use, verify the module’s pinout and electrical requirements before wiring it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
2pcs DHT11 Temperature Humidity Sensor Module Digital Temperature Humidity Sensor 3.3V-5V with Wires for Arduino Raspberry Pi 2 3 (2pcs DHT11)
  • DHT11 digital temperature and humidity sensor is a digital signal output with a calibrated temperature and humidity combined sensor.It uses a dedicated digital modules and acquisition of temperature and humidity sensor technology to ensure that products with high reliability and excellent long term stability.
  • Sensor consists of a resistive element and a sense of wet NTC temperature measurement devices, and with a high-performance 8-bit microcontroller connected.
  • The single-wire wiring scheme makes it easy to be integrated to other applications.And the simple communication protocol greatly reduces the programming effort required.
  • Humidity Measure Range 20%-95%,humidity measurement error: +-5%; Temperature Measure Range 0-50°C,temperature measurement error: +-2 degrees.
  • Working voltage: DC 3.3V-5V.Output form: digital output.
Rank #4
Teyleten Robot DHT11 Digital Temperature and Humidity Sensor Module for Arduino Raspberry 5pcs
  • Humidity measuring range: 20% -95% and humidity measurement error: + - 5%
  • Temperature measuring range: 0 degrees -50 degrees
  • Operating Voltage 3.3V-5V
  • Weighs about 8g each
  • temperature measurement error: + - 2 degrees
Rank #3
6 Sets Digital Temperature & Humidity Sensor Modules, Compatible with DHT11
  • Quality & Precision: This digital sensor module offers accurate environmental readings, measuring humidity from 20% to 95% RH with a precision of ±5% RH, and temperature from 0°C to 50°C with an accuracy of ±2°C. (Compatible with DHT11 specifications.)
  • Reliable & Easy Integration: Designed with advanced digital signal output and a high-performance 8-bit microcontroller, this digital sensor module ensures long-term stability, quick response times, and strong anti-interference capabilities. Its single-wire wiring scheme simplifies integration into various applications. We recommend using AI tools to assist with programming.
  • Simple Power & Output Setup: Operating on a DC voltage of 3.3V to 5V, this sensor provides digital output that easily connects to microcontrollers via its simple 3-wire interface (VCC, GND, DO), offering a hassle-free experience for your projects.
  • Compact & User-Friendly: This digital sensor module is equipped with a red power indicator light for easy status monitoring. It features a compact size of 32mm (L) x 14mm (W) x 7.3mm (H) and a lightweight design at approximately 8g. A mounting hole with a diameter of 2.6mm allows for easy installation, making it suitable for various settings such as farms, poultry houses, pig farms, and cattle facilities.
  • Quality Assurance & Service: Each digital sensor module is thoroughly tested and carefully packaged to ensure premium quality. It comes in a convenient storage box, making it easy to store and transport, with necessary connection wires included for effortless setup. (Compatible with DHT11 specifications.) If you encounter any quality or other issues during use, please feel free to contact us at any time.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.