We turned on the agr board as suggested.
Code:
float value_humidity_1 = 0; //Initialize variables for sensor readings
float value_humidity_2 = 0;
float value_temperature_1 = 0;
float value_temperature_2 = 0;
SensorAgr.setBoardMode(SENS_ON);
delay(100);
SensorAgr.setSensorMode(SENS_ON, SENS_AGR_SENSIRION);//TURN ON SENSOR
SensorAgr.setSensorMode(SENS_ON, SENS_AGR_HUMIDITY);//TURN ON SENSOR
SensorAgr.setSensorMode(SENS_ON, SENS_AGR_TEMPERATURE);//TURN SENSOR ON
delay(15000); //waiting for the sensor response time (15 seconds)
value_humidity_1 = SensorAgr.readValue(SENS_AGR_HUMIDITY);
value_temperature_1 = SensorAgr.readValue(SENS_AGR_TEMPERATURE);
value_humidity_2 = SensorAgr.readValue(SENS_AGR_SENSIRION, SENSIRION_HUM);
value_temperature_2 = SensorAgr.readValue(SENS_AGR_SENSIRION, SENSIRION_TEMP);
SensorAgr.setSensorMode(SENS_OFF, SENS_AGR_SENSIRION);//TURN OFF SENSOR
SensorAgr.setSensorMode(SENS_OFF, SENS_AGR_HUMIDITY);//TURN OFF SENSOR
SensorAgr.setSensorMode(SENS_OFF, SENS_AGR_TEMPERATURE);//TURN OFF SENSOR
SensorAgr.setBoardMode(SENS_OFF);
We noticed this fixed the input voltage on the humidity sensor's power pin. The power pin now reads 5V. The output voltage now reads 1.4V or 1400mV. This is correct. However, the command:
Code:
SensorAgr.readValue(SENS_AGR_HUMIDITY);
Is calculating a value of 15% which is not correct. As we understand it, this value is being converted by the sencera_conversion command:
Code:
float humidity = 0;
humidity = float(readValue) * 5000 / 1023;
humidity = (humidity - 800) / 31;
return(humidity);
The humidity output voltage value of 1400mV according to your conversion should return a value of 19.35%
19.35=(1400 - 800) / 31
So we are confused why SensorAgr.readValue(SENS_AGR_HUMIDITY);
is giving us 15 and not 19.