Hallo,
I am using "Arduino UNO" with "HDC1000" and "7 Segment LED HT16k33 Backpack". everything goes fine.
when I connect "HDC1000" and "7 Segment LED HT16k33 Backpack" with another microcontroller (i.e. efm8bb10f8g).
then the "Temperature and Humidity" both data are 100% correct , I compare it with "Arduino UNO".
the only difference is, in "Arduino UNO" Temperature and Humidity both does not shows same time in the 7-segment display, but one after another if I comment out and upload it to "Arduino UNO". e.g
void loop() {
int Temperature= (int)hdc.readTemperature(); //Casting for int
int Humidity = (int)hdc.readHumidity(); //Casting for int Result
matrix.print(Humidity); //Reading Temperature sensor
[ comment out code Line]
//matrix.print(Temperature); //Reading Humidity sensor
matrix.writeDisplay(); // Printing Temperature
delay(200);
But the value is 100% same in my another microcontroller (i.e. efm8bb10f8g).
So, it means efm8bb10f8g prog is also correct.
But the problem is, when Temperature increases then, Humidity goes to 00. And when Temperature is
stop increasing or stable then Humidity increase from 00 and reach to the correct value.
for example:
_____________________________________________________________________-
[ the output is]
23 /// Temperature
58 /// Humidity
[ End output ]
[ but when Temperature increases, the output is ]
28 /// Temperature
00 /// humidity
[end output]
So Temperature increasing from 23 to 24, 25, 26, 27 and finally 28.
the moment Tem start increasing from 23 to 28 at that moment Humidity is 00.
But the moment when Tem reach to 28 and stop increasing then Humidity start increasing
from 00 to 9, 11, 15,25, 28,36.... 58 and then stop increasing
and finally both are stable and correct value with
Temperature 28 and Humidity 58
The interesting thing is "Temperature and Humidity " both shows correct value according to the
room temperature and humidity compared with "Arduino UNO".
But the moment Temperature start increasing and until Temperature stop increasing(until it get stable), at that moment Humidity goes to 00 and stop working, until Temperature get a stable value.
when Temperature get stable value, that moment Humidity start to increasing from 00 to its final value.
And finally the both value "Temperature and Humidity" are correct.
My i2c bus connection is 100% correct, also other connection.
000000000000000000000________
What I have changed two Methos.
-
<float Adafruit_HDC1000::readHumidity(void) >
-
< uint32_t Adafruit_HDC1000::read32(uint8_t a, uint8_t d) >
-
Method is :
float Adafruit_HDC1000::readHumidity(void) {
float hum = (read32(HDC1000_TEMP, 20) & 0xFFFF); ///HDC1000_TEMP 0x00
hum /= 65536;
hum *= 100;
return hum;
}
- Method "readHumidity(void) " changes are :
------------------------------- changed Method -----------------------------------
it was :
< float hum = (read32(HDC1000_TEMP, 20) & 0xFFFF); > /// with this I didn't get correct value
changed to :
<float hum = (read33(HDC1000_HUMID, 20) >> 16);> /// its shows correct value
------------------------------- End changed Method -----------------------------------
- Method is :
uint32_t Adafruit_HDC1000::read32(uint8_t a, uint8_t d) {
Wire.beginTransmission(_i2caddr); ;
Wire.write(a);
Wire.write(HDC1000_TEMP);
Wire.endTransmission();
delay(50);
Wire.requestFrom((uint8_t)_i2caddr, (uint8_t)4);///wire.cpp ---> requestFrom 3
uint32_t r = Wire.read();
r <<= 8;
r |= Wire.read();
r <<= 8;
r |= Wire.read();
r <<= 8;
r |= Wire.read();
return r;
}
- Method "read32(uint8_t a, uint8_t d) " changes are :
I make another method but almost same called <read33(uint8_t a, uint8_t d)>
because, the same method <read32(uint8_t a, uint8_t d)>
I used for "Temperature" and its corret no problem with it. But problem with "Humidity"
and I used Method <read33(uint8_t a, uint8_t d)" for "Humidity>
and the changes for Method <read32(uint8_t a, uint8_t d)> To make a Method
<read33(uint8_t a, uint8_t d)> is :
it was :
< Wire.write(HDC1000_TEMP);>
changes to :
<Wire.write(HDC1000_HUMID);> /// changed for humidity
Thats it.
the full prog can be found in
for header file :
for cpp file :
I would really appreciate for the help of information...
Thanks