I have an arduino uno, a grove shield and two grove sensors :
first : Grove - Temperature&Humidity Sensor (High-Accuracy & Mini) TH02 sensor
second one : Grove - Barometer (High-Accuracy) Sensor features a HP206C high-accuracy chip to detect barometric pressure ,Altimeter and temperature.
I’ve a problem when I want to use the 2 grove sensors together.
They both communicate with I2C bus.
If I download the HP20x_demo.ino program with only the appropriate sensor HP206C : no problem, it works
If I download the TH02_demo program with only the appropriate sensor TH02 : no problem, it works
If I download the HP20x_demo.ino program with the two sensors linked to the I2C : problem, it doesn’t work.
The message is “HP20x_dev isn’t available” and I can’t start the loop program.
If I download the TH02_demo program program with the two sensors linked to the I2C : it works. ( the data from TH02 are good)
I try a test program to verify the I2C adress, no problem, the two sensors are well detected . 0X40 and 0X76 adress.
I change the supply voltage from 3.3V to 5 V : it doesn’t change my problem.
Can you help to find a way to resolve that ?
i try it and see the same error on HP20x_demo.ino, it returns ret as 0 and stop the looping. i already feedback to software team about the issue.
here is the temporary solution. please disable all the items related with ret = HP20x.isAvailable(), thanks.
- Demo name : HP20x_dev demo
- Usage : I2C PRECISION BAROMETER AND ALTIMETER [HP206C hopeRF]
- Author : Oliver Wang from Seeed Studio
- Version : V0.1
- Change log : Add kalman filter 2014/04/04
unsigned char ret = 0;
/* Instance */
KalmanFilter t_filter; //temperature filter
KalmanFilter p_filter; //pressure filter
KalmanFilter a_filter; //altitude filter
Serial.begin(9600); // start serial for output
Serial.println(“HP20x_dev demo by seeed studio\n”);
Serial.println(“Calculation formula: H = [8.5(101325-P)]/100 \n”);
/* Power up,delay 150ms,until voltage is stable /
/ Reset HP20x_dev */
/* Determine HP20x_dev is available or not /
/ ret = HP20x.isAvailable();
if(OK_HP20X_DEV == ret)
Serial.println(“HP20x_dev is available.\n”);
Serial.println(“HP20x_dev isn’t available.\n”);
//if(OK_HP20X_DEV == ret)
long Temper = HP20x.ReadTemperature();
float t = Temper/100.0;
long Pressure = HP20x.ReadPressure(); Serial.println("Pressure:"); t = Pressure/100.0; Serial.print(t); Serial.println("hPa.\n"); Serial.println("Filter:"); Serial.print(p_filter.Filter(t)); Serial.println("hPa\n"); long Altitude = HP20x.ReadAltitude(); Serial.println("Altitude:"); t = Altitude/100.0; Serial.print(t); Serial.println("m.\n"); Serial.println("Filter:"); Serial.print(a_filter.Filter(t)); Serial.println("m.\n"); Serial.println("------------------\n"); delay(1000); //}
Ok thanks a lot to have resoved my problem
I’am going to test that solution tomorrow.
To day I tried the same sketch with a new sensor I bought.
The same problem appeared obviously now I read your answer.
If you find a solution or have an answer to your request, how can I know the result ?
On this forum ?
I will post the solution in the forum. thanks.
The library for Grove_Barometer_HP20x just made a mistake for isAvailable() function, I have deleted this function. Inside this function it used to read CMPS_EN bit as chip status indication, actually this register bit is to determine whether to enable compensation or not.