I have connected pressure sensor hk1100c properly to arduino due.code is fine but values i get from sensor output randomly changes.like i am using bar unit so it keep on changing in a range of -0.20 to 0.20
why is it happening?i don't get that.when it is not connected to any pressure(keeping atmospheric pressure constant) then it should give a specific value or may be a a variation of 0.01 or 0.02 but not more than that.
so kindly help me with this mess.
[select]
void setup()
{
Serial.begin(9600);
}
void loop()
{
int sensorVal = analogRead(A0);
float voltage = (sensorVal*5.0)/1024.0; // converting sensorVal into voltage.
Serial.print("\nVoltage: ");
Serial.print(voltage);
float pressure_pascal = (3.0* ((float)voltage-0.75) )* 1000000.0;
float pressure_bar = pressure_pascal/10e5; // for pressure in bars unit.
Serial.print("\nPressure = ");
Serial.print(pressure_bar);
Serial.print(" bars");
delay(1000);
}