Shop OBEX P1 Docs P2 Docs Learn Events
Sensirion SHT-11 driver and reference circuit — Parallax Forums

Sensirion SHT-11 driver and reference circuit

BRBR Posts: 92
edited 2010-07-10 06:10 in Propeller 1
I've been playing around with the Sensirion SHT-11 temperature sensor. Among other things, I've been adding some functionality to Cam Thompson's original driver object. In the process, I've tripped across a few things in the original object and in the Parallax docs that I am a bit unsure about and thought I'd toss out for folks to chew on.

I maintain the following to be true:
1) the parallax documentation for the device suggests that it is a good idea to put a 4.7K pulldown resistor on the clk pin. My understanding based on the datasheet is that the device will never drive this pin. Only the uC will drive this pin...so there's no need to protect the prop pin against overcurrent. It seems to work fine without the pulldown resistor...far as I can tell, it is entirely superfluous.

2) The Parallax docs don't show a current limiting resistor between the data pin and the uC. Seems to me it would be a good idea to put one in, particularly if one wants to hang the device off the I2C bus pins since there is a possibility one could inadvertently end up in a bus contention situation if not careful (e.g. one cog trying to communicate with an I2C device at the same time another cog is trying to talk to the SHT-11).

3) Since the device has a built-in pullup on the data line, the statement "outa[noparse][[/noparse]dpin]~~" should never appear in the driver. A high state should be signified by putting the data pin in a high impedance (input) state. I'm specifically thinking about lines 81-83 and 231-235 of the attached "Sensiron_full" driver object.

So...am I wrong? What am I missing?

EDIT: upon further contemplation, I guess I can see the reason for item #1...in the event that the prop pin happens to be in the input mode, the pulldown just ensures that the pin is pulled to ground. Still seems kinda superfluous if clk is being driven high and low by the prop, though.

Post Edited (BR) : 7/9/2010 3:18:22 AM GMT

Comments

  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2010-07-09 04:19
    The SHT11 from Sensirion is an excellent sensor and there is a ton of info on it on the internet. I have quite a bit on my web page for my module that I made 2 years ago and have been selling up til just recently. Here are some answers:

    1) The pulldown on the clock is only to ensure a clean power up state. See FAQ#23 on the Sensirion site.

    2) Parallax's module has a 330ohm inline resistor on the module itself.

    3) I believe driving the line high will produce a faster transition from low to high than a pullup, so it ensures a cleaner communication stream. However, your thoughts seem correct to me as well.


    Be sure to check out the details on Tracy Allen's site:
    www.emesystems.com/OL2sht1x.htm

    as well as the site for my module (check out the specs and links pages):
    www.aestheticacoustics.com/sht11_01.htm
    thread for my module:
    http://forums.parallax.com/showthread.php?p=690671

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    PowerTwig Dual Output Power Supply Module
    My Prop projects: Reverse Geo-Cache Box, Custom Metronome, Micro Plunge Logger
  • BRBR Posts: 92
    edited 2010-07-10 03:13
    Thanks Andrew, that's good information.

    Interestingly, their FAQ #5 says: "SHTxx should not share a I2C bus with I2C components. However sharing of the SCK line and using a dedicated DATA line for the SHTxx humidity sensor will work well."

    Which seems contradictory to what's in the latest data sheet: "The serial interface of the SHT1x is optimized for sensor readout and effective power consumption. The sensor cannot be addressed by I2C protocol; however, the sensor can be connected to an I2C bus without interference with other devices connected to the bus. The controller must
    switch between the protocols."

    I've got both data and clk on the same pins as I2C (pins 28 & 29) and it seems to work OK.

    EDIT: so to follow up on what you said,
    1) yep, makes sense
    2) yep I see that now...if it was a snake, it would've bit me.
    3) item 2 would protect the prop in the event of bus contention vs the SHT-11, but I guess there'd likewise need to be a current limiting resistor between pin 29 an every other I2C device in order to be absolutely protected. So therefore the safest thing is to simply make sure data is never driven high.

    Post Edited (BR) : 7/10/2010 3:34:09 AM GMT
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2010-07-10 06:10
    Good, glad I could help. If you really want to eliminate the worry of sharing the I2C bus, they do have a newer version that is full I2C compliant, the SHT21. They are supposedly in production, but only samples are available at this time. I already have a bunch of breakout boards for the SHT21 and have several sample SHT21s, but haven't got around to playing with them yet. The SHT21 comes in three protocols as well; I2C, PWM, and SDM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    PowerTwig Dual Output Power Supply Module
    My Prop projects: Reverse Geo-Cache Box, Custom Metronome, Micro Plunge Logger
Sign In or Register to comment.