Adafruit Industries HTU21D-F Manual

Temperature & humidity sensor

Advertisement

Quick Links

Adafruit HTU21D-F Temperature & Humidity Sensor
Created by lady ada
Last updated on 2016-08-24 05:33:19 PM UTC

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the HTU21D-F and is the answer not in the manual?

Questions and answers

Summary of Contents for Adafruit Industries HTU21D-F

  • Page 1 Adafruit HTU21D-F Temperature & Humidity Sensor Created by lady ada Last updated on 2016-08-24 05:33:19 PM UTC...
  • Page 2: Table Of Contents

    Power Pins: I2C Logic pins: Assembly Prepare the header strip: Add the breakout board: And Solder! Wiring & Test Download Adafruit_HTU21DF Load Demo Library Reference Downloads Files & Datasheets Schematics PCB Print https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 2 of 18 sensor...
  • Page 3: Overview

    52% when it feels more like 77%. Enter the HTU21D-F Temperature + Humidity Sensor - the best way to prove the weatherman wrong! https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity-...
  • Page 4 Operation outside this range is still possible - just the accuracy might drop a bit. The temperature output has an accuracy of ±1°C from -30~90°C. If you're looking to measure temperature more accurately, we recommend the MCP9808 High Accuracy I2C Temperature Sensor Breakout Board. (http://adafru.it/1782) https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 4 of 18 sensor...
  • Page 5 5V power or logic. Each order comes with one fully assembled and tested PCB breakout and a small piece of header. You'll need to solder the header onto the PCB but it's fairly easy and takes only a few minutes even for a beginner. https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 5 of 18 sensor...
  • Page 6: Pinouts

    Pinouts The HTU21D-F is a I2C sensor. That means it uses the two I2C data/clock wires available on most microcontrollers, and can share those pins with other sensors as long as they don't have an address collision. For future reference, the I2C address is 0x40 and you can't...
  • Page 7: I2C Logic Pins

    GND - common ground for power and logic I2C Logic pins: SCL - I2C clock pin, connect to your microcontrollers I2C clock line. SDA - I2C data pin, connect to your microcontrollers I2C data line. https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 7 of 18 sensor...
  • Page 8: Assembly

    Assembly Prepare the header strip: Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - long pins down https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 8 of 18 sensor...
  • Page 9: Add The Breakout Board

    Add the breakout board: Place the breakout board over the pins so that the short pins poke through the breakout pads And Solder! Be sure to solder all pins for https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 9 of 18 sensor...
  • Page 10 (For tips on soldering, be sure to check out our Guide to Excellent Soldering (http://adafru.it/aTk)). You're done! Check your solder joints visually and continue onto the next steps https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 10 of 18 sensor...
  • Page 11 © Adafruit Industries Page 11 of 18 sensor...
  • Page 12: Wiring & Test

    Arduino, this is also known as A4, on a Mega it is also known as digital 20 and on a Leonardo/Micro, digital 2 The HTU21D-F has a default I2C address of 0x40 and cannot be changed! Download Adafruit_HTU21DF https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- ©...
  • Page 13: Load Demo

    (http://adafru.it/dw5). You can do that by visiting the github repo and manually downloading or, easier, just click this button to download the zip Download Adafruit HTU21D-F Library http://adafru.it/dw6 Rename the uncompressed folder Adafruit_HTU21DF and check that the Adafruit_HTU21DF folder contains Adafruit_HTU21DF.cpp and Adafruit_HTU21DF.h...
  • Page 14 Thats it! Now open up the serial terminal window at 9600 speed to begin the test. https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 14 of 18 sensor...
  • Page 15: Library Reference

    Once initialized, you can query the temperature in °C with htu.readTemperature() Which will return floating point (decimal + fractional) temperature. You can convert to Fahrenheit by multiplying by 1.8 and adding 32 as you have learned in grade school! https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 15 of 18 sensor...
  • Page 16 Reading the humidity is equally simple. Call htu.readHumidity() to read the humidity also as a floating point value between 0 and 100 (this reads % humidity) https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity- © Adafruit Industries Page 16 of 18 sensor...
  • Page 17: Downloads

    Downloads Files & Datasheets (the -F part is for the PTFE Filter, Datasheet for the HTU21D-F (http://adafru.it/dKR) which is the white insert on top of the sensor) Fritzing object in Adafruit Fritzing library (http://adafru.it/aP3) EagleCAD PCB files in GitHub (http://adafru.it/r5F)
  • Page 18 © Adafruit Industries Last Updated: 2016-08-24 05:33:18 PM UTC Page 18 of 18...

Table of Contents