1125 Humidity Sensor Formula
Posted: Wed May 09, 2018 11:57 pm
I would really appreciate some help making an 1125 Humidity sensor read correctly.
The voltage ratio output from the sensor going through my code matches the values shown in control panel.
I am using Voltage ratio and getting a value of 0.446
If I set the sensor type to 1125 it shows 44.8%
According to the weather the humidity is in the 70%'s
When I run my code with the formula shown in the user guide I get a value of -23. (which is different than the manager shows).
The way it looks to me now, I guess that at least one thing may not be correct:
1. The value coming from the sensor may be wrong.
2. The formula in the user guide is wrong?
That one is confusing because it shows a formula for voltage, not voltage ratio.
Note the docs also say to set sensorType to 1125_HUMIDITY, but that raises an error.
https://www.phidgets.com/?tier=3&catid= ... &prodid=96
This is my code.
The voltage ratio output from the sensor going through my code matches the values shown in control panel.
I am using Voltage ratio and getting a value of 0.446
If I set the sensor type to 1125 it shows 44.8%
According to the weather the humidity is in the 70%'s
When I run my code with the formula shown in the user guide I get a value of -23. (which is different than the manager shows).
Code: Select all
textBox1.Text = ((humidity_voltage_ratio.VoltageRatio*38.12)-40.2).ToString() + "%";
The way it looks to me now, I guess that at least one thing may not be correct:
1. The value coming from the sensor may be wrong.
2. The formula in the user guide is wrong?
That one is confusing because it shows a formula for voltage, not voltage ratio.
Note the docs also say to set sensorType to 1125_HUMIDITY, but that raises an error.
https://www.phidgets.com/?tier=3&catid= ... &prodid=96
This is my code.
Code: Select all
namespace Phidgets_Basic
{
public partial class Form1 : Form
{
VoltageRatioInput humidity_voltage_ratio;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
humidity_voltage_ratio = new VoltageRatioInput();
humidity_voltage_ratio.DeviceSerialNumber = 496925;
humidity_voltage_ratio.HubPort = 0;
humidity_voltage_ratio.IsHubPortDevice = true;
humidity_voltage_ratio.Channel = 0;
//humidity_voltage_ratio.SensorType = humidity_voltage_ratio;
humidity_voltage_ratio.Attach += humidty_voltage_ratio_attach;
humidity_voltage_ratio.VoltageRatioChange += humidty_voltage_ratio_change;
humidity_voltage_ratio.SensorChange += humidty_voltage_ratio_sensor_change;
humidity_voltage_ratio.Error += humidty_voltage_error;
//humidity_voltage.Detach += humidty_voltage_detach;
try
{
humidity_voltage_ratio.Open();
}
catch (PhidgetException ex)
{
MessageBox.Show("Error: " + ex.Description);
}
}
//Attach voltage sensor for humidity
void humidty_voltage_ratio_attach(object sender, Phidget22.Events.AttachEventArgs e)
{
{
try
{
VoltageRatioInput attachedDevice = (VoltageRatioInput)sender;
}
catch (PhidgetException ex) { textBox1.Text = ("Error initializing device: " + ex.Message); }
}
}
void humidty_voltage_ratio_change(object sender, Phidget22.Events.VoltageRatioInputVoltageRatioChangeEventArgs e)
{
textBox1.Text = ((humidity_voltage_ratio.VoltageRatio*38.12)- 40.2) .ToString() + "%";
}
private void humidty_voltage_ratio_sensor_change(object sender, VoltageRatioInputSensorChangeEventArgs e)
{
// textBox1.Text = e.SensorValue.ToString() + " " + e.SensorUnit.Symbol;
}
void humidty_voltage_error(object sender, Phidget22.Events.ErrorEventArgs e)
{
textBox1.Text = (e.Description);
//errorBox.addMessage(e.Description);
}
}
}