Mini Digital Thermometer Humidity Hygrometer
Mini Digital Thermometer Humidity Hygrometer
The Mini Digital Thermometer Humidity Hygrometer is a compact, low-cost, and highly accurate environmental sensing device designed to measure temperature and humidity levels in various environments. This device is perfect for a wide range of applications, including industrial automation, embedded systems, robotics, weather stations, and DIY projects.
The Mini Digital Thermometer Humidity Hygrometer is a small, rectangular module that integrates a temperature sensor, humidity sensor, and a microcontroller to provide accurate and reliable readings. The device features a compact design, making it ideal for applications where space is limited.
1C (-40C to 125C)
5% (20% to 95% RH)
Component Documentation: Mini Digital Thermometer Humidity HygrometerOverviewThe Mini Digital Thermometer Humidity Hygrometer is a compact, low-cost IoT component that measures both temperature and humidity levels in the surrounding environment. This component is ideal for various applications, including weather stations, home automation, and environmental monitoring systems.Technical SpecificationsTemperature measurement range: -40C to 80C (-40F to 176F)
Humidity measurement range: 20% to 90% RH (Relative Humidity)
Accuracy: 1C (1.8F) for temperature, 5% RH for humidity
Communication protocol: I2C, 3-wire interface
Power supply: 3V to 5V DC
Dimensions: 23.5 mm x 15.5 mm x 7.5 mm (0.93 in x 0.61 in x 0.30 in)Pinout| Pin | Function |
| --- | --- |
| VCC | Power supply (3V to 5V DC) |
| GND | Ground |
| SCL | I2C clock line |
| SDA | I2C data line |Example CodeThe following code examples demonstrate how to use the Mini Digital Thermometer Humidity Hygrometer with various microcontrollers.Example 1: Arduino UnoIn this example, we will use the Arduino Uno board to read temperature and humidity data from the Mini Digital Thermometer Humidity Hygrometer.```c++
#include <Wire.h>#define THERMOMETER_ADDRESS 0x40 // I2C address of the thermometervoid setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication
}void loop() {
byte temperatureHIGH, temperatureLOW, humidityHIGH, humidityLOW;
// Read temperature data
Wire.beginTransmission(THERMOMETER_ADDRESS);
Wire.write(0x00); // Register address for temperature data
Wire.endTransmission();
Wire.requestFrom(THERMOMETER_ADDRESS, 2);
temperatureHIGH = Wire.read();
temperatureLOW = Wire.read();
float temperature = (temperatureHIGH 256 + temperatureLOW) / 10.0;
// Read humidity data
Wire.beginTransmission(THERMOMETER_ADDRESS);
Wire.write(0x01); // Register address for humidity data
Wire.endTransmission();
Wire.requestFrom(THERMOMETER_ADDRESS, 2);
humidityHIGH = Wire.read();
humidityLOW = Wire.read();
float humidity = (humidityHIGH 256 + humidityLOW) / 10.0;
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print("C, Humidity: ");
Serial.print(humidity);
Serial.println("% RH");
delay(1000); // Wait 1 second before taking the next reading
}
```Example 2: Raspberry Pi (Python)In this example, we will use the Raspberry Pi board to read temperature and humidity data from the Mini Digital Thermometer Humidity Hygrometer using Python and the `smbus` library.```python
import smbus
import time# I2C address of the thermometer
THERMOMETER_ADDRESS = 0x40# Initialize I2C communication
bus = smbus.SMBus(1)def read_temperature():
# Read temperature data
bus.write_byte(THERMOMETER_ADDRESS, 0x00) # Register address for temperature data
temperatureHIGH = bus.read_byte(THERMOMETER_ADDRESS)
temperatureLOW = bus.read_byte(THERMOMETER_ADDRESS)
return (temperatureHIGH 256 + temperatureLOW) / 10.0def read_humidity():
# Read humidity data
bus.write_byte(THERMOMETER_ADDRESS, 0x01) # Register address for humidity data
humidityHIGH = bus.read_byte(THERMOMETER_ADDRESS)
humidityLOW = bus.read_byte(THERMOMETER_ADDRESS)
return (humidityHIGH 256 + humidityLOW) / 10.0while True:
temperature = read_temperature()
humidity = read_humidity()
print("Temperature: {:.1f}C, Humidity: {:.1f}% RH".format(temperature, humidity))
time.sleep(1) # Wait 1 second before taking the next reading
```Note: The I2C address of the thermometer may vary, so be sure to check the datasheet or user manual for the specific device you are using.