@gfc
I think the data sheet is lots of info.
It's i2c..don't forget pull-ups
how is data requested and sent...sort that and away.
when you know the data feed then the maths is just decimal points.
floats have been a problem for me as c code doesn't tranlate easy to gcb.
I think you might get some support as similar devices have been sorted recently....lot's of effort for bmp280..see the forum.
I google it more for you...a few times only. I don't have or need one.
What info can YOU find?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Attached is a subroutine that I use for si7006 humidity sensors. They use the same addresses and the same calculations as the HTU21.
You will need to define many of the constants as word.
Hello.
Please, I need support for create this library.
Can you help me forthis.
Thanks in advance.
Is this correct data sheet?.
connect to pic or avr and see if it's address is found with address finder.
figure out the data format.
look up arduino solutions for help to convert to basic. last resort?
http://www.te.com/commerce/DocumentDelivery/DDEController?Action=showdoc&DocId=Data+Sheet%7FHPC199_6%7FA6%7Fpdf%7FEnglish%7FENG_DS_HPC199_6_A6.pdf%7FCAT-HSC0004
I find data sheets no help for writing basic code to use the device the data sheet is for hence say google device in other basic or c,python etc and convert.
Last edit: stan cartwright 2018-04-02
I googled the device. I think it would be another bmp280 tedious job.
double getTemperature(int fd)
{
unsigned char buf [4];
wiringPiI2CWrite(fd, HTU21D_TEMP);
delay(100);
read(fd, buf, 3);
unsigned int temp = (buf [0] << 8 | buf [1]) & 0xFFFC;
// Convert sensor reading into temperature.
// See page 14 of the datasheet
double tSensorTemp = temp / 65536.0;
return -46.85 + (175.72 * tSensorTemp);
}
// Get humidity
double getHumidity(int fd)
{
unsigned char buf [4];
wiringPiI2CWrite(fd, HTU21D_HUMID);
delay(100);
read(fd, buf, 3);
unsigned int humid = (buf [0] << 8 | buf [1]) & 0xFFFC;
// Convert sensor reading into humidity.
// See page 15 of the datasheet
double tSensorHumid = humid / 65536.0;
return -6.0 + (125.0 * tSensorHumid);
}
yes, it's so easy :)
Last edit: stan cartwright 2018-04-02
Thanks Stan
I check it.
Page 15 of datasheet explains the maths. Should be relatively easy.
@gfc
I think the data sheet is lots of info.
It's i2c..don't forget pull-ups
how is data requested and sent...sort that and away.
when you know the data feed then the maths is just decimal points.
floats have been a problem for me as c code doesn't tranlate easy to gcb.
I think you might get some support as similar devices have been sorted recently....lot's of effort for bmp280..see the forum.
I google it more for you...a few times only. I don't have or need one.
What info can YOU find?
Attached is a subroutine that I use for si7006 humidity sensors. They use the same addresses and the same calculations as the HTU21.
You will need to define many of the constants as word.
Last edit: David Stephenson 2018-04-03
Thanks David