Shop OBEX P1 Docs P2 Docs Learn Events
trying to understand Tracy Allen's example code and circuit for the sensirion s — Parallax Forums

trying to understand Tracy Allen's example code and circuit for the sensirion s

TaylortronicTaylortronic Posts: 20
edited 2005-08-30 17:40 in BASIC Stamp
i'm working on a circuit to measure temperature and humidity using a sensirion sht75 sensor. in order to try it out and to understand it a little bit, i got some circuit and code examples from tracy allen's www.emesystems.com (one of the best sites).

the example i used was "Temperature & Humidity with the Sensirion SHT11, SHT15, SHT71, SHT75" nad i'm running it on a bs2p24 v.1.4.

okay, first of all, i bought this sensor on ebay from phanderson and i'm confused about something. it is a dual pin architecture and every sht75 i see on the sensirion website is single in line. the only dual pin sht's i see are the sht1x's (and not the sht7x's). i suppose this wouldn't matter if it wasn't for the fact that the pin layout is different between the sht1x's and the sht7x's.

anyway, proceeding as though it were an sht75 on a little board, i put the example circuit together and ran the code. and the debug screen shows me this (repeatedly, as programmed):

" 65535 -40.01 65535 %RH=3731.7 %RHtc=3880.9"

this is not supposed to read as "-40" degrees celsius, right? and in the sensor's position (on top of my cable box) i suppose it could be roughly 40 deg C. but the remarks in the code have me expecting a relative humidity reading in the form of three digits ("xx.x%") and i get a five digit reply. also the readings never change no matter what i do to change the environment (cigarette lighters, ice cubes, nothin).

when i disconnect the circuit and run the program i get a debug screen that reads like this:

" 0 -40.00 0 %RH=6549.6 %RHtc=1.9"

i'm reluctant to try the pin configuration for the sht1x's because i don't want to damage my stamp if i'm wrong. if anybody is familiar with this senso or example and can elucidate the solution to my problem, it would be greatly appreciated.

thanks,
taylor

Comments

  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-08-28 19:19
    Hi Taylor,

    If it is an 8 pin surface mount package, or an 8 pin surface mount package mounted for you on an 8-pin dip header, then it is certainly an SHT1x, and not a 7x. I know that Peter Anderson was selling both types.

    If you indeed have the SHT1x, you will have to refer back to the data sheet or to this URL
    www.emesystems.com/OL2sht1x.htm to find the correct pinout. Or to the Parallax or P Anderson application notes. Yes, the pinout of the two types is different. Be sure to include the resistors, pullup on the dta line, pulldown on the clk line, and protection resistors in series with both dta and clk. If you do that, there is no danger of damaging the Stamp. Also include the power supply bypass capacitor.

    I noticed that my web page at the above URL had somehow reverted to an earlier version. I just put the newer version back up.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • TaylortronicTaylortronic Posts: 20
    edited 2005-08-28 20:08
    mr. allen,

    thank you so much for responding to my post (and for all the instruction that i've gotten from your wonderful website). i am still a little confused about whether this is a sht-7x or a sht-1x... upon close inspection i see that it is labeled "75", but it is an 8-pin surface mount package... so it's still a bit unclear. (i don't think that mr. anderson would have misrepresented the sale and the auction WAS for an sht-75...).

    running the more newly posted version (version c, i believe) shows me the same values in the debug screen as before. in fact, i don't think i can really identify a difference between the code i just got from your site and the code that i had gotten before your reply to my post.

    okay, so i'm going to try tht sht-1x pin layout. in the schematic on the web page i see two 200 ohm protection resistors on the clk and data pins. the 4.7k resistor from the data pin must be the pullup and i'm not exactly sure about the pulldown resistor. is this the 330 ohm resistor mentioned in the remarks for the code? if so i'm assuming that it would go between the clock line on the sensor and the 200 ohm protection resistor before the stamp. what would i connect this 330 ohm resistor to?

    i would just like to explain that, although i have been an interested observer of stamp projects, i have only recently gotten my own setup and i am a hopeful neophyte. so i want to thank you in hindsight for inspiring me to get into this stuff and also to thank you in advance for your patience with my stupid questions.
  • TaylortronicTaylortronic Posts: 20
    edited 2005-08-28 21:16
    okay, @ this point i'm pretty confident that i'm working with an sht75, because switching from the sht7x pin layout to the sht1x layout yielded the same results that disconnecting the circuit and running the program gave me. so that's pretty much settled.

    but i'm still stuck. i don't understand why i get a 40 degc reading when the circuit is disconnected. and i don't understand why when the circuit IS connected i get 40.01 degc. i think there must be a problem with the calculations from the raw data from the sensor because i AM getting data from the sensor when it is connected (the number just don't mean anything to me) whereas when i connect it as though it's an sht1x or disconnect it my raw data values = 0. but then why would i get a 40.00 tempC reading? i wold expect them all to say 0 if the circuit is disconnected.

    i mean, this shouldn't be this complicated, right?

    thanks,
    taylor
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-08-29 01:07
    You should be able to tell if it is an sht7x or an sht1x just by looking at it. It is like telling an armadillo from a giraffe. The sht75 has a long narrow neck, and 4 spindly legs. The sht1x is flat and has no legs to speak of, except the 8 recessed gold contacts, 4 along each side. You may have a sht chip that has been mounted in some other way to make it easier for you to use.

    This is an SHT75:
    sht7x.jpg

    The reason you see -40 degrees C is, that is the minimum temperature the device reads, and that occurs when the raw binary data is %0000000000000000. That can happen when nothing is connected, or just a pulldown resistor. With a pullup resistor, or sometimes just by chance, you will get raw binary data of %1111111111111111, and that is -1 in twos complement binary, so your screen displays -40.01 degrees.

    Don't give up on it. I'm pretty sure you will get it to work. Check the power supply and the connections again, and please, please look at the Sensirion data sheet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • TaylortronicTaylortronic Posts: 20
    edited 2005-08-30 04:51
    thanks again for your attention to my problem. i'm working with the datasheet and i am making some progress (though i have to say i haven't completely accomplished my goal yet, but understanding the code and the data exchange is important whether that is my problem or not so i'm taking the time to really grok all of that).

    one thing, it is obvious to me that this is an sht75 (as advertised) because i actually do get sensor output (though meaningless to me) when i use this pin layout. when i use the sht-1x layout i get the same results as when i disconnect the circuit. peter anderson must be mounting these sht75's on a small dip board, but i am totally convinced that it is an sht75 (just so you know that these are out there). it also happens to be labeled with a very small white 75. but the form threw me off.

    one last question. i think i'm a little confused by the circuit because the schematic drawing on the site has two in line protection resistors @ 200 ohms, and no 330 ohm pull-up resistor as noted in the code remarks. once again, i'm just learning at this so this may be a stupid question, but i am unclear as to how the 330 ohm pull up is supposed to be connected to the circuit (as it is missing from the diagram).

    thanks a lot,
    taylor
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-08-30 17:40
    I don't see any 330 ohm pullup resistor in the code remarks. The pullup and pulldown resistors are both 4.7kohm. The value is not critical, but I would use something in the range of 4.7 to 20 kohms for the pullup/pulldown. I did go in and edit the format of the code remarks. The ascii schematic had gotten trashed somehow. I looked on ebay and see Peter Anderson's ad there for the SHT75. It looks to be straight out factory stock. No added mounting, so I still don't understand what you mean by the extra "small dip board".

    SHTxxPinouts.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.