SHT75 QB8

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SHT75 QB8

6,853 Views
ppcco
Contributor I
I'm trying measure temp and humidity with an SHT75 sensor and HC908QB8 microcontroller, any have idea how start?, I wish program in C (CW), sorry, I'm newer in this area
Labels (1)
0 Kudos
6 Replies

561 Views
ppcco
Contributor I
Thanks, i'm trying program it with your help, a question, the frequency in clock pin may be any? or exist any freq that recomend me to sure data transmission?, thanks a lot
0 Kudos

561 Views
MichaelB
Contributor I
I just finished interfacing the SHT75 to a HCS08GT60 processor, and found the sample C code on Sensirions website to be extremely helpfull.  (You can find it at the bottom of the page the details the specific sensor information).
0 Kudos

561 Views
bigmac
Specialist III

Hello,

I notice that the sample code requires floating point operations, specifically in the calc_sth11 and calc_dewpoint functions.  I would suspect that the HC908QB8 may not have sufficient capacity for the floating point library, if you need to do these calculations.

Regards,
Mac

 

0 Kudos

561 Views
hypocrisy
Contributor I
the web page sensirion give a c code to begin to this work. Im adapting the code for the use in the sh8 mcu. I have a compile code ok, but I m think the form to convert the float data to humidity and temp to ascii characters to visualization... the qb8 must support the c code... 
0 Kudos

561 Views
hypocrisy
Contributor I
the data sheet says the frequency in the sck line, this depend of the VDD voltage, if you work the sensor with 5V the max frequency is 5MHz, if you work with 3V, the max sck frequency is up to 1Mhz
0 Kudos

561 Views
bigmac
Specialist III

Hello ppcco,

It appears that the data transfer arrangements for the SHT75 device are neither compatible with I2C nor SPI.  This means you will need to 'bit bang' the transfer routine using two of the GPIO pins, using one pin for the clock output, and the other for data I/O.

For the data output mode (sending the command bits) the high logic state of the data line must be non-driven, and an external pull-up resistor used (10k).  The internal pull-up alone may not be sufficient, depending on the clock speed.  A method of achieving the required output characteristic is to set the output latch for the data pin continuously low, and control the output state using the data direction bit.  This bit would be set for logic low, and cleared for logic high.  The bit would also be cleared when receiving data from the device.

To write the code, you will need to refer to the waveforms shown in the data sheet for the sending of the command and reading the returned data.  I will leave this as an exercise for you to attempt.  I might suggest that you will need a function to initialise the GPIO used, and another function for the transmission start sequence and the sending of the command bits.  Further functions would be required to read the humidity/temperature data, and possibly to read and write the status register, if required.  The CRC data attached to the humidity/temperature data can probably be ignored.

Regards,
Mac

 

0 Kudos