Probably about 12 years ago, I recovered the imaging sensor from an A4 flatbed scanner that had become obsolete. (I think its obsolescence was due to it having a parallel port interface and my family’s new computer didn’t have a parallel port) Apart from it not being able to communicate with a new computer, it still worked fine sadly. Fortunately, there were several useful components that I recovered from it including a stepper motor, v-belts and pulleys, CCFL light and the CCD.
New tutorial added! Make your own Stevenson Screen weather station using a HTU21D temperature and humidity breakout board and a NeoPixel Ring.
For all the details check out the detailed tutorial.
By default the HTU21D sets the temperature and humidity sensor resolutions are set at their highest. These default values are, humidity = 12bit and temperature = 14bit. This is all well and good for most situations when you are trying to get the best performance from your device. However, a higher resolution comes at the expense of increased measuring time. Consequently, a longer measuring time will increase the current consumption too.
To demonstrate, I’ve tabulated the maximum measuring times for the different sensor resolution modes from the HTU21D_datasheet.
Having both temperature and humidity sensor capabilities in a single package makes the HTU21D an ideal sensor for a home weather station. As such, if you’re a person who is interested in knowing the current weather conditions, you’ll probably want to know what the Dew Point is too. But before we can get carried away, we need to learn how to use an additional library.
This tutorial will show you how to interface your Arduino to a HTU21D humidity and temperature sensor and start taking measurements. Once you’ve got the basics, we’ll take a look at configuring the sensor to optimise its performance. What you’ll need:
- An Arduino or compatible clone
- A HTU21D temperature sensor. I’ll be using one of these from Adafruit.
- Jumper wires
A few days ago, my HTU21D temperature and humidity sensor from Adafruit arrived in the mail. I’m planning to use it for a temperature and humidity display at home.
In one night I managed to start reading temperature and humidity measurements from the sensor using my own code that uses the Arduino Wire library. I wrote my own code instead of using the Adafruit HTU21D library to practice and learn interfacing a micro to an I2C device. All the measurement results are then output to the serial terminal.