The Humiture Sensor by SunFounder (Part ID: Humiture Sensor) is a versatile device designed to measure both humidity and temperature. This sensor is commonly used in environmental monitoring, HVAC systems, weather stations, and various IoT applications. Its ability to provide accurate and reliable data makes it an essential component for projects that require precise environmental measurements.
Parameter | Value |
---|---|
Operating Voltage | 3.3V - 5V |
Humidity Range | 0% - 100% RH |
Temperature Range | -40°C to 80°C |
Humidity Accuracy | ±2% RH |
Temperature Accuracy | ±0.5°C |
Interface | Digital (Single-Wire) |
Response Time | < 2 seconds |
Dimensions | 15mm x 12mm x 5mm |
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V - 5V) |
2 | DATA | Data signal (Digital) |
3 | NC | Not connected |
4 | GND | Ground |
Below is a sample code to interface the Humiture Sensor with an Arduino UNO:
#include <DHT.h>
// Define the pin where the DATA line is connected
#define DHTPIN 2
// Define the type of sensor (DHT11, DHT22, etc.)
#define DHTTYPE DHT11
// Initialize the DHT sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// Start the serial communication
Serial.begin(9600);
// Initialize the sensor
dht.begin();
}
void loop() {
// Wait a few seconds between measurements
delay(2000);
// Read humidity
float humidity = dht.readHumidity();
// Read temperature in Celsius
float temperature = dht.readTemperature();
// Check if any reads failed and exit early (to try again)
if (isnan(humidity) || isnan(temperature)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Print the results to the Serial Monitor
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" *C");
}
By following this documentation, users can effectively integrate the SunFounder Humiture Sensor into their projects, ensuring accurate and reliable environmental measurements.