Here is another guide working with the HDC2080 high accuracy digital temperature & humidity sensor developed by Texas Instruments. The HDC2080 is an integrated humidity/temperature sensor the provides a high accuracy sensing acquisition with very low power consumption in a DFN – (Dual-flat no-leads)package featuring a new integrated digital heating element to dissipate the condensation moisture.
This sensor communicates on a two-wire protocol (i2C) and includes programmable interrupt thresholds that provide alerts and system wakeups without requiring input from the microcontroller to be continuously monitoring the system. Combines with deep sleep mode and programmable sampling intervals with low power consumption that supports a 1.8v supply voltage that suitable for a handheld device that runs on a battery-powered project.
HDC2080 provides you a high accuracy in terms proving a temperature and humidity suitable for smart environmental monitoring or an IOT project application such as smart appliance that monitors temperature, smart thermostats, smart home assistants, smart device’s specific applications, and mobile devices.
If your searching for an auto measurement sensor the strict the power-budget the HDC2080 is suited your requirements. For more technical details please refer to the datasheet below.
Requirements and Alternatives
- Arduino IDE | Atmel Studio | Energia | Processing
- SONY SPRESENSE Development Board
- Please refer to this link
- ESPRESSIF
- ESP8266 12, 12E, ESP32, ESP8266 NodeMCU, ESPDuino
- Microchip
- ATMEGA4809 Curiosity Nano, ChipKIT DP32, chipKIT WF32,
- ARDUINO
- MKR WAN, MK, MKR, PRO, FIO, NANO, EVERY, UNO, MINI, MEGA, PRO MINI, LEO, BT, DUE, ETHERNET,LILYPAD, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266,ATMEGA250 16 MHz, ATSAM3x8E, STM32,
- Note: For AVR (please see the flash size of the MCU and respective pin-outs & bus configuration )
- Note: The Diagram below is using ATMEGA328TQFP & ATMEGA4809. (please refer to each MCU’s respective pin-outs & bus configuration)
- Others
- Teensy 3, MSP430 Launchpad, Flora, Metro, Trinket, Pro Trinket, LinkItOne.
- HDC2080 Sensor or Module
- Resistors (See below required values)
- Capacitor(See below required values)
Wiring Guide
Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
#include <HDC2080.h> //Library can be downloaded below on this article. #define ADDR 0x40 //DHC2080 i2c Address HDC2080 sensor(ADDR); float temperature = 0, humidity = 0; void setup() { Serial.begin(9600); Serial.println("14CORE | HDC2080 TEST CODE"); delay(1000); Serial.println("Inistializing i2C ........"); sensor.begin(); // Initialize I2C communication sensor.reset(); // Begin with a device reset Serial.println("Settings up .............."); delay(1000); sensor.setHighTemp(28); // High temperature of 28C sensor.setLowTemp(22); // Low temperature of 22C sensor.setHighHumidity(55); // High humidity of 55% sensor.setLowHumidity(40); // Low humidity of 40% Serial.println("Configuring Measurements.."); delay(1000); sensor.setMeasurementMode(TEMP_AND_HUMID); // Set measurements to temperature and humidity sensor.setRate(ONE_HZ); // Set measurement frequency to 1 Hz sensor.setTempRes(FOURTEEN_BIT); sensor.setHumidRes(FOURTEEN_BIT); Serial.println("Reading.................."); delay(1000); sensor.triggerMeasurement(); } void loop() { Serial.print("Temperature (C): "); Serial.print(sensor.readTemp()); Serial.print("\t\tHumidity (%): "); Serial.println(sensor.readHumidity()); delay(1000); } |
ライブラリがコードに含まれていることを確認してください
Arduino IDEの使用中にエラーが発生した可能性があり、変数が宣言されていない可能性があります
ライブラリがコードに含まれていることを確認してください