Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Adding Formulas into Program


ZEI2 Aug 10, 2011 03:10 AM

We are measuring 30 humidity sensors in our setup using an AM16/32B connected to a CR1000. The variables in our program are as follows:

Dim i
Public BattV
Public RTempC
Public Temp_C(25)
Public RTempC_2
Public Temp_C_2(25)
Public SEVolt
Public SEVolt_2(30)

Units BattV=Volts
Units RTempC=Deg C
Units Temp_C=Deg C
Units RTempC_2=Deg C
Units Temp_C_2=Deg C
Units SEVolt=mV
Units SEVolt_2=mV

Note that "SEVolt" is the voltage that powers all of the humidity sensors. Each sensor is tied to a centrally located bus bar that is connected to the +5V of the CR1000. This means that all humidity sensors see a +5V constantly.

"SEVolt_2(30)" are the single ended voltage measurements for each of the 30 humidity sensors.

We would like to convert the millivolt readings obtained by the AM16/32B to relative humidity. The formula to do so is as follows:

Sensor RH = ((Vout/Vsupply)-0.16))/0.0062

Using the variables in our program, the forumla would look like this:

Sensor RH = ((SEVolt_2(#)/SEVolt)-0.16))/0.0062

Where is the best place to add this formula to get a data table of relative humidity values instead of millivolt readings? Can this be done when we take a sample? For example this ...

Sample(1,SEVolt_2(1),FP2)

Would become ...

Sample(1,((SEVolt_2(1)/SEVolt)-0.16))/0.0062,FP2)


JDavis Aug 16, 2011 04:12 PM

It is possible to write expressions within the output instructions of your data tables.

It is better to perform your calculations within the main part of your program, right after the measurement. That way, you can see the calculation value in realtime by viewing the Public table.

I am concerned about your description of powering the sensors. The +5V on the CR1000 is not a precise voltage and does not have a large sourcing current. If the current draw is too high, the voltage will drop. You could run the 5V through the AM16/32B, so not all sensors are powered at once. Running a wire from the 5V to an SE channel would allow you to measure the actual voltage.

If the sensors will works with a supply of 2.5V, use an excitation channel on the datalogger for a more accurate measurement.

Log in or register to post/reply in the forum.