Go Down

### Topic: sensor HIH 43030 sparkfun [fr] (Read 371 times)previous topic - next topic

#### florent117

##### Apr 21, 2014, 10:27 pmLast Edit: Apr 22, 2014, 07:15 pm by florent117 Reason: 1
Bonjours, pouvez vous m'aider à comprendre le programme svp. C'est pour mon bac , je dois faire un programme pour mesurer la tempérarure, humidté etc. Je voudrais qu'on m'explique la partie avec les calculs. Merci de votre aide

int HIH4030_Pin = A0; //analog pin 0

void setup(){
Serial.begin(9600);
}

void loop(){

//To properly caculate relative humidity, we need the temperature.
float temperature = 25; //replace with a thermometer reading if you have it
float relativeHumidity  = getHumidity(temperature);

Serial.println(relativeHumidity);

delay(500); //just here to slow it down so you can read it
}

float getHumidity(float degreesCelsius){
//caculate relative humidity
float supplyVolt = 5.0;

// read the value from the sensor:
float voltage = HIH4030_Value/1023. * supplyVolt; // convert to voltage value

// convert the voltage to a relative humidity
// - the equation is derived from the HIH-4030/31 datasheet
// - it is not calibrated to your individual sensor
//  Table 2 of the sheet shows the may deviate from this line
float sensorRH = 161.0 * voltage / supplyVolt - 25.8;
float trueRH = sensorRH / (1.0546 - 0.0026 * degreesCelsius); //temperature adjustment

return trueRH;
}

#### michinyon

#1
##### Apr 22, 2014, 03:01 am
Est google brisé dans votre pays ?

#2
??

#### robtillaart

#3
##### Apr 22, 2014, 08:09 pm
Please rephrase your question in English on the international part of the forum...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up