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
![](/media/components/pinouts/temp._and_hum._wire_chart.png)
Datasheet
https://dlnmh9ip6v2uc.cloudfront.net/datasheets/BreakoutBoards/HTU21D.pdfNotes
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
You need to log in to post a discussion