Here are a couple of pictures of the Sensirion Temp/RH sensor operating on my Basic Stamp dev system.


Here are some chunks of code that make it work:
' ------------------------------------------------------------------------------
' Subroutines
' ------------------------------------------------------------------------------
' connection reset: 9 clock cyles with ShtData high, then start sequence
'
SHT_Connection_Reset:
SHIFTOUT ShtData, Clock, LSBFIRST, [$FFF\9]
' generates SHT1x "start" sequence
'
'SHT_Start:
INPUT ShtData ' let pull-up take line high
LOW Clock
HIGH Clock
LOW ShtData
LOW Clock
HIGH Clock
INPUT ShtData
LOW Clock
RETURN
' measure temperature
' -- celcius = soT * 0.01 - 40
' -- fahrenheit = soT * 0.018 - 40
'
SHT_Measure_Temp:
GOSUB SHT_Start ' alert device
ioByte = ShtTemp ' temperature command
GOSUB SHT_Write_Byte ' send command
GOSUB SHT_Wait ' wait until measurement done
ackBit = Ack ' another read follows
GOSUB SHT_Read_Byte ' get MSB
soT.HIGHBYTE = ioByte
ackBit = NoAck ' last read
GOSUB SHT_Read_Byte ' get LSB
soT.LOWBYTE = ioByte
' Note: Conversion factors are multiplied by 10 to return the
' temperature values in tenths of degrees
tC = soT / 10 - 400 ' convert to tenths C
tF = soT ** 11796 - 400 ' convert to tenths F
RETURN
' measure humidity
'
SHT_Measure_Humidity:
GOSUB SHT_Start ' alert device
ioByte = ShtHumi ' humidity command
GOSUB SHT_Write_Byte ' send command
GOSUB SHT_Wait ' wait until measurement done
ackBit = Ack ' another read follows
GOSUB SHT_Read_Byte ' get MSB
soRH.HIGHBYTE = ioByte
ackBit = NoAck ' last read
GOSUB SHT_Read_Byte ' get LSB
soRH.LOWBYTE = ioByte
' linearize humidity
' rhLin = (soRH * 0.0405) - (soRH^2 * 0.0000028) - 4
'
' for the BASIC Stamp:
' rhLin = (soRH * 0.0405) - (soRH * 0.004 * soRH * 0.0007) - 4
'
' Conversion factors are multiplied by 10 and then rounded to
' return tenths
'
rhLin = (soRH ** 26542)
rhLin = rhLin - ((soRH ** 3468) * (soRH ** 3468) + 50 / 100)
rhLin = rhLin - 40
' temperature compensated humidity
' rhTrue = (tC - 25) * (soRH * 0.00008 + 0.01) + rhLin
'
' Conversion factors are multiplied by 100 to improve accuracy and then
' rounded off.
'
rhTrue = ((tC / 10 - 25) * (soRH ** 524 + 1) + (rhLin * 10)) + 5 / 10
RETURN
' sends "status"
'
SHT_Write_Status:
GOSUB SHT_Start ' alert device
ioByte = ShtStatW ' write to status reg command
GOSUB SHT_Write_Byte ' send command
ioByte = status
GOSUB SHT_Write_Byte
RETURN
' returns "status"
'
SHT_Read_Status:
GOSUB SHT_Start ' alert device
ioByte = ShtStatW ' write to status reg command
GOSUB SHT_Read_Byte ' send command
ackBit = NoAck ' only one byte to read
GOSUB SHT_Read_Byte
RETURN
' sends "ioByte"
' returns "ackBit"
'
SHT_Write_Byte:
SHIFTOUT ShtData, Clock, MSBFIRST, [ioByte] ' send byte
SHIFTIN ShtData, Clock, LSBPRE, [ackBit\1] ' get ack bit
RETURN
' returns "ioByte"
' sends "ackBit"
'
SHT_Read_Byte:
SHIFTIN ShtData, Clock, MSBPRE, [ioByte] ' get byte
SHIFTOUT ShtData, Clock, LSBFIRST, [ackBit\1] ' send ack bit
INPUT ShtData ' release data line
RETURN
' wait for device to finish measurement (pulls data line low)
' -- timeout after ~1/4 second
'
SHT_Wait:
INPUT ShtData ' data line is input
FOR toDelay = 1 TO 250 ' give ~1/4 second to finish
timeOut = INS.LOWBIT(ShtData) ' scan data line
IF (timeOut = No) THEN SHT_Wait_Done ' if low, we're done
PAUSE 1
NEXT
SHT_Wait_Done:
RETURN
' reset SHT1x with soft reset
'
SHT_Soft_Reset:
GOSUB SHT_Connection_Reset ' reset the connection
ioByte = ShtReset ' reset command
ackBit = NoAck ' only one byte to send
GOSUB SHT_Write_Byte ' send it
PAUSE 11 ' wait at least 11 ms
RETURN