I’m trying to get Sparkfun’s SHT15 humidity breakout board working reliably on a Luminary LM3S1968 system, but I’m having problems. I’ve gotten it to work, and it does return reasonable humidity and temperature values, but not reliably.
The SHT15 uses a pseudo-I2C interface that’s different enough from the I2C standard that I can’t use the I2C peripheral on the microcontroller but have to bit bang it instead. The protocol is straightforward enough, and well-documented in the SHT15 datasheet.
The breakout board has two signal lines: a clock line with a 10K pull-down resistor, and a data line with a 10K pull-up. Since both the microcontroller and SHT15 drive the data line, I’ve configured the GPIO port I’ve got connected to the data line as an open-drain output.
The SHT15 requires a special start sequence (this is the reason why it’s not strictly I2C compatible, BTW) that looks like this, with the microcontroller controlling both clock and data:
___ ___
SCK : ___| |___| |______
_____ ________
DATA: |_______|
When everything works, the start sequence looks fine on the 'scope. When it doesn’t work, I see the microcontroller pull down the data line in the start sequence, but nothing when the microcontroller releases the data line that should cause the pull-up to take data high. The 'scope shows something that looks like this:
___ ___
SCK : ___| |___| |______
_____
DATA: |_______________
Anyone else get the SHT15 to work reliably? Do you always see clean startup sequences rather than sometimes abnormal ones where the microcontroller can’t pull the data line high a second time? (Actually, since it’s configured as an open-drain output, the microcontroller doesn’t “pull” data line high, it just tri-states the port and lets the pull-up resistor pull the line high). The only thing I can think of here is that the SHT15 itself is pulling the data line down, which makes no sense.
I’m following all of the timing specs for the sensor in my code, especially with respect to clock width, frequency, etc. One thing I did notice is that there’s a lot of slew in the data line. When the microcontroller tri-states the port controlling the data line, it takes around 2.5 microseconds for the line to be pulled up to a solid high.
I’ve got the sensor connected to my eval board with short jumpers (~2 inches), so I doubt this is an issue, especially since I’ve heard reports of people successfully using the SHT15 over 200 feet of Cat-5 cable.
Anyone have any ideas of what to check next?