Hello people!!
I am in a bit need of a support yet again!!
Well I am just writing an I2C interface for communicating and reading digital pressure values from HCLA02X5EB (amplified pressure sensors range) sensor from SensorTechnics (First-Sensors) using ARDUINO UNO board.
Please find below the used sketch for the communication I have been able to develop using the help from the forums:
#include <Wire.h>
float pressure_diff = 0;
int P_counts_diff; // 16bit value
float sensitivity_p_diff = 0;
byte byte_MSB;
byte byte_LSB;
#define P_min_diff -25 // min. for the differential pressure sensor
#define P_max_diff 25 // max. for the differential pressure sensor
#define press_sensor 0x78
#define Out_min 1638 // min. counts for the sensors (same for both sensors)
#define Out_max 27852 // max. counts for the sensors (same for both sensors)
void setup(){
Serial.begin(9600);
// delay(1000);
Wire.begin();
}
float read_press (){
// initiate measurement
Wire.beginTransmission(press_sensor);
Wire.write(0);
Wire.available();
int Ack = Wire.read(); // receive a byte
Wire.endTransmission();
delay(1000); //This particular delay is the delay between the displayed values (in msec)...
// READ DATA from here on
Wire.beginTransmission(press_sensor);
Wire.requestFrom(press_sensor,2); //Reade 1 byte
Wire.available();
byte_MSB = Wire.read(); // receive most significant byte
byte_LSB = Wire.read(); // receive least significant byte
P_counts_diff = ((int)byte_MSB << 8) | byte_LSB; // Putting both bytes together
sensitivity_p_diff = (Out_max - Out_min)/(P_max_diff - P_min_diff); // calculate the differential pressure sensors sensitivity
pressure_diff = (P_counts_diff - Out_min)/sensitivity_p_diff + P_min_diff; // calculate the differential pressure in [mbar]
return pressure_diff;
Wire.endTransmission();
}
void loop(){
float Differential_pressure = read_press();
Serial.print("pressure in mBar : ");
Serial.println(Differential_pressure);
}
Now the problem is.. That the sensor is constantly showing a fixed pressure value on the Serial monitor.. Even if I blow air into the port the value does not change.. I have also tried changing the sensors with brand new... but the problem persist...
As given in the I2C application note (http://www.first-sensor.com/cms/upload/appnotes/AN_I2C-Bus_HMI_HDI_HCLA_HCA_SSI_E_11155.pdf), I have also checked the analog output of the sensor.. But surprisingly it shows also a fixed value of 2.23-2.25 V
This voltage, according to the datasheet (http://www.first-sensor.com/cms/upload/datasheets/DS_Standard-HCLA_E_11629.pdf), is the default zero-offset
What is it going wrong here... I am totally confused about the reason for this problem!
Please help!!
Deeply appreciate your support!
Regards
Pramit