Introduction: Humidity Sensor

Humidity is the amount of water vapor present in the air. It can be a reliant indication of the likelihood of precipitation. Higher humidity reduces the effectiveness of the sweating in cooling the body by reducing the rate of evaporation of the moisture from the skin...but lets not get into much detail. So, why would you build a humidity sensor? Well. one of the uses of this sensor is to monitor the internal humidity of the beehive. Humidity of the brood nest is important for the overall fitness of a honeybee colony. Numerous studies have demonstrated that either high or low levels of humidity affect the health of the brood and adult bees. Monitoring hive humidity can provide very useful information for beekeepers.

Step 1: Getting Hardware

To get started, you need to obtain the following components:

  • HIH 5030/31 Humidity sensor (this instructable will be based on this sensor. There are also other sensors for measuring humidity but they might not work with this instructable).

To see the datasheet for this sensor, click here.

  • 1x 65 kΩ resistor
  • Soldering Iron and solder or prototype breadboard
  • single and 7 strand wires
  • Snips and pull-nose pliers
  • Arduino UNO ADC and the USB cable to connect to PC

Once you get all of these you are ready to build the circuit and connect it to the Arduino.

Step 2: Building a Circuit and Connecting to Arduino

The circuit is very straight forward, as you can see in the picture above.

The red wire is supplying the sensor with 3.3 Volts from the Arduino board.

The black wire is ground i.e. 0 Volts.

The blue wire is the ouput signal, which varies from 0 to 2.5 Volts.

Step 3: Programming the Arduino

Once you have made all the connections you are ready to program the arduino. Just copy and paste the following code into Arduino:

#define SENSOR_PORT A0 //define input port
float rhRead,rhsensorPinOut = 0; //declaring variables float RH, rhvoltage;

void func_humidity(void);

void setup() { //execute this instruction only once



void loop() { //this function repeats forever

rhRead = analogRead(A0); //read analogue inpu signal from port A0


Serial.print("RELATIVE HUMIDITY: "); //print text

Serial.print(RH); //print variable



delay(1000); //delay for 1s


void func_humidity(void){ //this is where the digital units

rhvoltage = (rhRead/512)*2.5; // are converted into relaive humidity percentage

RH = ((rhvoltage/3.3)-0.1515)/0.00636;


Step 4: Testing

Here you can see a demonstration. Its assuming that the temperature is at 25 °C. If you want to be more precise you can incorporate a temperature sensor which will tell the arduino current temperature. When you have the readings from temperature sensor you can use the to calculate true relative humidiy. the formula is as follows.

True RelativeHumidity = (Sensor RH)/(1.0546 0.00216T), where Sensor RH is in % and T is in °C.