Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommendations to be able to get correct sensor values #2

Open
ardatekin opened this issue Aug 2, 2019 · 0 comments
Open

Recommendations to be able to get correct sensor values #2

ardatekin opened this issue Aug 2, 2019 · 0 comments

Comments

@ardatekin
Copy link

ardatekin commented Aug 2, 2019

Hi bfaliszek

First of all thank you very much for sharing such a valuable project with community.
I have fully reproduced your project with the same hardware set and also InfluxDB and Grafana and I have found some bugs because I was not able to get the correct sensor values using the code. Let me share how I tuned the Arduino code.

In ClosedCube_HDC1080.cpp::begin function Wire.begin(); line needs to be enabled. Otherwise none of the below code gives the correct data

  Serial.print("Manufacturer ID=0x");
  Serial.println(hdc1080.readManufacturerId(), HEX); // 0x5449 ID of Texas Instruments
  Serial.print("Device ID=0x");
  Serial.println(hdc1080.readDeviceId(), HEX); // 0x1050 ID of the device

  printSerialNumber();

I have restored the function Wire.begin(); line again and disabled SoftwareReset option,

void ClosedCube_HDC1080::begin(uint8_t address) {
	_address = address;
	Wire.begin();
	
	// https://github.com/closedcube/ClosedCube_HDC1080_Arduino/pull/8/commits/724a233c76da13d4e559262eb6eeaa5037d33f09
	// HDC1080_Registers reg;
	// reg.SoftwareReset = 1;
	// writeRegister(reg);
	// delay(100);

	setResolution(HDC1080_RESOLUTION_14BIT, HDC1080_RESOLUTION_14BIT);
}
  1. Based on TI HDC1080 reference code HDC1080 Arduino Example Code v1.0 in page http://www.ti.com/product/HDC1080
    I added some typecasts and the most important diff I have seen regarding to receive the wrong temperature value 125.0 is that what was fixing this value is to change the delay(9) to delay(20) as written in sample TI code. I am sharing the final ClosedCube_HDC1080.cpp code I have used.

ClosedCube_HDC1080.zip

Here is the the wiring
20190802_185708

Kind Regards
Arda

facugomez added a commit to facugomez/ClosedCube_HDC1080_Arduino that referenced this issue Nov 30, 2019
Increase delay time, according to bfaliszek/CJMCU-8118_InfluxDB#2
Solve the problem of wrong temperature value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant