HTU21D Temperature and Humidity Sensor

This is a highly accurate, digital humidity and temperature sensor with an I2C interface. The breakout board includes built in 4.7k pull up resistors.

Hello World

Import programHTU21D_HELLOWORLD

A sample program to read the temperature and humidity from the HTU21D sensor.

Library

Import libraryHTU21D

An updated, basic library to interface with the HTU21D digital temperature and humidity sensor

Pinout

Datasheet

https://dlnmh9ip6v2uc.cloudfront.net/datasheets/BreakoutBoards/HTU21D.pdf

Notes

API

HTU21D(PinName sda, PinName scl)
Constructor function, declares sensor .
int sample_ctemp(void)
Samples the temperature, input void, outputs an int in Celcius.
int sample_ftemp(void)
Samples the temperature, input void, outputs an int in Fahrenheit.
int sample_ktemp(void)
Samples the temperature, input void, outputs an int in Kelvin.
int sample_humid(void)
Samples the humidity, input void, outputs an int.

Links

HTU21D Breakout Board on Sparkfun

HTU21D Datasheet

HTU21D Schematic


You need to log in to post a discussion