Shop OBEX P1 Docs P2 Docs Learn Events
SHT-22 and Basic Stamp — Parallax Forums

SHT-22 and Basic Stamp

Paul SimonPaul Simon Posts: 22
edited 2014-09-16 20:12 in Accessories
I would like to use the new SHT -22 with a stamp which does not have 3.3V available for this new sensor. I understand it uses the same protocol at the SHT -11 which I have used successfully until it or the mounting/wiring became corroded in my greenhouse.
Paul
«1

Comments

  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-08-31 17:00
    Do you have a link to the SHT-22?
  • Paul SimonPaul Simon Posts: 22
    edited 2014-08-31 20:16
    NWCCTV wrote: »
    Do you have a link to the SHT-22?
  • Paul SimonPaul Simon Posts: 22
    edited 2014-08-31 20:17
    Here's the link: http://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity/Sensirion_Humidity_SHT21_Datasheet_V4.pdf

    It's at sensirion.com if ;you want to compare it to the sht11, which is spec'ed at 5 V.

    Paul
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-08-31 21:23
    So it's a SHT-21, not -22?
  • Paul SimonPaul Simon Posts: 22
    edited 2014-08-31 23:26
    Yes , it's a SHT-21. The only difference in the series is the accuracy o measurement. The interface to all the SHT-2X chips is the same.
  • ercoerco Posts: 20,256
    edited 2014-09-01 07:13
    FYI, Parallax has their original SHT-11 in stock and on sale through today, if interfacing the 3.3V version is problematic.

    http://www.parallax.com/product/28018
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-01 09:21
    erco wrote: »
    FYI, Parallax has their original SHT-11 in stock and on sale through today, if interfacing the 3.3V version is problematic.

    http://www.parallax.com/product/28018

    Yes, I know that. Two issues for me. First, it's for a greenhouse and the package seems to be designed for breadboard experimentation. The greenhouse environment is minimum 65 % and goes up to 90% during misting. The smaller packaged SMT-2X from china have a much smaller footprint and look a lot more amenable to humidity resistant packaging. My previous SHT-11( thank you Andrew, nice package) was passivated and conformal coated and still failed after several years.

    Secondly, the price from China for the SH -2X series is one tenth the price. Cost for me is not a significant issue but it seems that a step up to newer sensor technology makes sense all around.

    It seems time for the stamp to have 3.V available with all the new devices. Even a small inexpensive daughter board.
  • PublisonPublison Posts: 12,366
    edited 2014-09-01 10:28
    Paul Simon wrote: »
    Yes, I know that. Two issues for me. First, it's for a greenhouse and the package seems to be designed for breadboard experimentation. The greenhouse environment is minimum 65 % and goes up to 90% during misting. The smaller packaged SMT-2X from china have a much smaller footprint and look a lot more amenable to humidity resistant packaging. My previous SHT-11( thank you Andrew, nice package) was passivated and conformal coated and still failed after several years.

    Secondly, the price from China for the SH -2X series is one tenth the price. Cost for me is not a significant issue but it seems that a step up to newer sensor technology makes sense all around.

    It seems time for the stamp to have 3.V available with all the new devices. Even a small inexpensive daughter board.

    You could add a $3.00 voltage translator to the mix.

    https://www.sparkfun.com/products/12009
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-01 12:02
    From the way this thread is going I see that I was not clear in my original posting. I apologize.

    How do I connect this 3.3 V device to the stamp which is designed around using 5 V devices. Do I just use a stiff voltage divider to output 3.3 V, connect this to the device power pin and connect the two pullups to the same? I am not certain that the stamp has open collector output, and if so, is that all I have to do.
  • PublisonPublison Posts: 12,366
    edited 2014-09-01 15:54
    Paul Simon wrote: »
    From the way this thread is going I see that I was not clear in my original posting. I apologize.

    How do I connect this 3.3 V device to the stamp which is designed around using 5 V devices. Do I just use a stiff voltage divider to output 3.3 V, connect this to the device power pin and connect the two pullups to the same? I am not certain that the stamp has open collector output, and if so, is that all I have to do.

    What's wrong with the device in Post #9. It's exactly what your looking for. 3.3 volts to 5 volts OR 5 volts to 3.3 volts. Almost for the cost of resistors and perf board.
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-01 16:56
    Publison wrote: »
    What's wrong with the device in Post #9. It's exactly what your looking for. 3.3 volts to 5 volts OR 5 volts to 3.3 volts. Almost for the cost of resistors and perf board.

    Yes, you are correct. How do I connect the clock and data lines to the stamp pins? Where do the pullups go?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2014-09-02 06:46
    How do I connect the clock and data lines to the stamp pins? Where do the pullups go?

    Paul,

    I would use the circuit "Fig. 1" in the following document.

    http://www.nxp.com/documents/application_note/AN10441.pdf

    You don't have to hunt for any special FETs - a 2N7000 or VN10 or VN2222 like will do fine (no major currents, so "low" VGS is not going to be a factor.)
    3-4KΩ for Rp should suffice.
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-02 09:35
    PJ Allen wrote: »
    How do I connect the clock and data lines to the stamp pins? Where do the pullups go?

    Paul,

    I would use the circuit "Fig. 1" in the following document.

    http://www.nxp.com/documents/application_note/AN10441.pdf

    You don't have to hunt for any special FETs - a 2N7000 or VN10 or VN2222 like will do fine (no major currents, so "low" VGS is not going to be a factor.)
    3-4KΩ for Rp should suffice.

    Problem solved. Thanks to all of you for putting up with my questions. For some reason I thought that the pin I/O on the stamp were open collector, which of course are not. That way I could just use an external 3.3 V supply.

    Ill be using the level shifter as described above with a simple 3.3 V source, since the current draw is small.

    With all the 5 V stamp users out there and a lot of 3.3 V devices, perhaps Parallax should be selling a level shifter? Also there is an opportunity for a SHT-2X assembly.

    Thanks again to everyone.

    Paul Simon
  • GenetixGenetix Posts: 1,754
    edited 2014-09-02 10:17
    Paul, I would suggest you wait for Tracy Allen to reply to your post since this is his area of expertise. What exactly is it that you are trying to do with a greenhouse?
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-02 11:13
    Genetix wrote: »
    Paul, I would suggest you wait for Tracy Allen to reply to your post since this is his area of expertise. What exactly is it that you are trying to do with a greenhouse?

    Thanks for the response. As you can see above that I have solved the problem. Ignorantly I had assumed that the I/O pins on the stamp were open collector.

    I grow orchids in my10 by 20 foot greenhouse and being nerdish also, measure the temperature in three places and also outside. It's collected using LM34 and an Advantech 8 channel 12/16 bit A/D converter with RS-485 output. I <was> measuring humidity with a SHT-11 and the Stamp. The sensor lasted several years but eventually succumbed to the humidity although conformally coated.

    To make a long story short I collect the data in a database and send a 24 hour graph up to my web site, http://gophergulch.net.

    Paul Simon
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-09-02 16:47
    Glad to hear that the module lasted this long. You said it was coated, did it also have the filter cap? I also agree that Tracy Allen probably has a few more solutions up his sleeve.

    FYI, I still make the Sensiron modules and sell them for $15, so let me know if you are interested. I just don't get around to advertising them.
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-02 21:27
    Glad to hear that the module lasted this long. You said it was coated, did it also have the filter cap? I also agree that Tracy Allen probably has a few more solutions up his sleeve.

    FYI, I still make the Sensiron modules and sell them for $15, so let me know if you are interested. I just don't get around to advertising them.

    Andrew, good to hear from you! No I didn't have the filter cap. I probably forgot to order one and the couldn't figure out how to put one on. I also added some conformal coating which was a waste of time as all the sharp edges didn't coat well. I didn't know you were still offering the modules but I will continue with my efforts here.

    I would be happy to talk to Tracy Allen although my problem is solved here.

    Paul
  • GenetixGenetix Posts: 1,754
    edited 2014-09-02 22:05
    Paul, are you using StampPlot?
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-03 13:06
    Genetix wrote: »
    Paul, are you using StampPlot?

    No, I'm not using stamplot. The stamp for me is a device controller only. The application program that sends and collects data is written in Python. Data is stored in a SQLite database and a plot is generated using matplotlib, a Python library. As you can see, the plots are publication quality and only requires about 30 lines of Python code.

    As far as I can see, Python is the way to go. It is used at Google and Facebook here in Silicon Valley and has huge support. PBasic is fine for me writing for the Stamp.

    Paul
  • GenetixGenetix Posts: 1,754
    edited 2014-09-03 15:18
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-03 15:35
    Genetix wrote: »

    That website was blocked by my anti-virus software. Take a look at www.matplotlib.com for more examples of nice looking plots. There are examles that you can crib from and Python is pretty easy. You can make a plot from any kind of data dump.

    Paul
  • GenetixGenetix Posts: 1,754
    edited 2014-09-03 17:08
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-09-09 22:28
    I've been in China the past couple of weeks, out of touch with the forum. Have to catch up! Since my name came up here, I should add a couple of yuan's worth of comment.

    Paul, I see you've already worked out the interface issue, good. Did you also use the SHT21 formulas for conversion raw values to temperature and humidity? Those are different between the SHT11 and SHT21.

    While the SHT2x series are backward compatible with the SHT1x protocol, they are also meant to be fully i2c compliant. People had complained about the offbeat protocol of the '1x series. If you have a BS2p series Stamp, then the dedicated i2c is available on pairs of pins. On the other hand, if you stick with the old SHT11 protocol, then you can use any pair of pins you want.

    Under the old protocol, the clock line is unidirectional and only needs a voltage divider R/2R to bring the 5V Stamp output down to the 3.3V level, no pullup resistor. The data line tho does need the bidirectional level shifter and pullup resistors.

    If you choose to use the full i2c option, the SHT2x has a clock-hold mechanism, and you would probably want both scl and sda to have bidirectional level shifters. I think the BS2p series does support clock-hold, but I wouldn't swear to it.

    The SHT25, SHT21 and SHT20 are the same except for the accuracy specs. I've worked with the SHT2x on the Propeller and made a small circuit board for it.

    SHT21_pcb_layout.png
    479 x 581 - 38K
  • GenetixGenetix Posts: 1,754
    edited 2014-09-10 10:47
    Tracy, I was the one who mentioned your name because you are very knowledgeable with environmental sensors. I don't know if you read the whole thread be he is using this sensor in a very humid greenhouse (65-90%). He had a SHT-11 that was passivated and conformal coated but still failed after several years. I thought you might know what else he could do to extend the sensor's life or suggest a hardier sensor.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-09-10 12:05
    "The sensor lasted several years but eventually succumbed to the humidity although conformally coated." Several years is not bad at all for environmental sensors. I wanted to ask about the symptoms of succumbed. For example, it still returned temperature but not humidity, or, perhaps it simply stopped returning anything at all?

    I too would recommend the cap with the Goretex membrane. It helps to keep contaminants off of the sensor element. Here is a board with SHT25, with and w/o the SF2 membrane cap.

    SHT25_pcb.jpg
    640 x 396 - 51K
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-09-10 14:54
    Tracy, Welcome back stateside! I really love your SHT2x board. Sensirion did a much better job with the package design of the part and the associated cap and you did an excellent job executing the PCB to go along with it. Makes me want to pull out my SHT21 parts and make up some boards with them!
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-10 20:47
    Sorry I didn't answer earlier but I didn't get a notification by e-mail as usual.
    I appreciate your comments. I my earlier iterations of using theSHT-11 I used your code and was very pleased not only with the code itself but your excellent documentation. Now to answer your questions...

    I didn't realize that the conversion code for the SHT-21 was different from the SHT-11. I thought they were pin compatible and code compatible too. There's a little more work for me. As you have seen I plan on using the I2C protocol, bought parts, etc. I have on order several break out modules with the SHT-21 from China. I have no idea when they will arrive; it's been about two weeks so far. Also ordered are a few SI2007 sensors. I did buy a bidirectional level shifter and will use just a r/2r voltage divider as the current draw is so small. It seems wasteful to me to use a 3.3 V regulator with a load resistor to draw enough current t get the regulator to work.

    Your note about the board for the SHT-21 is interesting to me, although perhaps a little late. The new package seems a little more difficult to attach the sensor chip. Do you have a procedure/process for it?

    Relative to the durability of the original sensor on Andrew's board.. I had coated it with so-called conformal coating I got here at Fry's. Unfortunately the word conformal doesn't mean conformal as it flows and leaves edges and points with a thin coating. When the sensor/board failed I could see corrosion at the soldered areas of the resistors and capacitor and also where I had soldered the four wires to the board.

    From my software (Python/TkInter interface to the stamp) all I got were null data. When I cleaned up the board and brought in inside for testing, I just got zeroes for data from the sensor and your stamp software. I never checked for temperature.

    As far as the cap for the sensor I'm buying, it doesn't look like one would even fit. I've bought some Goretex fabric and plan on glueing it right on top of the sensor opening. If anybody needs a piece ;-) .

    As you can see from above I have instrumented the 10 by 20 greenhouse with several temperature sensors, etc. Humidity is important to me to keep it up around 60% during the day and high enough at night to avoid condensation.

    Thanks again, Tracy

    Paul Simon
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-09-11 00:23
    [QUOTE=Paul Simon;1292541Relative to the durability of the original sensor on Andrew's board.. I had coated it with so-called conformal coating I got here at Fry's. Unfortunately the word conformal doesn't mean conformal as it flows and leaves edges and points with a thin coating. When the sensor/board failed I could see corrosion at the soldered areas of the resistors and capacitor and also where I had soldered the four wires to the board.[/QUOTE]

    Paul, that is very valuable information actually. First, the conformal coating can play a factor in the performance of the SHT11 device if the material is absorbed into the polymer material used on the top of the part (the dull gray blob with the "11" marking). However, it also seems that corrosion from high humidity was also a factor meaning that the coating did not perform (seal) as expected, which you somewhat eluded to already and allowed the environment to affect the solder joints.
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-11 09:47
    Paul, that is very valuable information actually. First, the conformal coating can play a factor in the performance of the SHT11 device if the material is absorbed into the polymer material used on the top of the part (the dull gray blob with the "11" marking). However, it also seems that corrosion from high humidity was also a factor meaning that the coating did not perform (seal) as expected, which you somewhat eluded to already and allowed the environment to affect the solder joints.

    Hello Andrew,

    Thanks for the question. I don't believe the failure is directly related to the polyimide capacitor used for the humidity measurement. Having some experience in materials including polyimide, it is a very durable material which curiously is quite permeable to moisture. If it failed in its intended use for that, I would have expected it to fail gradually. Typically the surface of the chip would be covered with silicon dioxide which is quite corrosion resistant. However the wire bonding area is exposed and could/would corrode and open circuit. It's electrolytic corrosion and could also been an issue with the soldered connections. If I were still working (retired) I would take it apart and see where the failure was. Pity. I'm finding that low temperature hot melt works very well for coating bare metal.

    Paul
  • Paul SimonPaul Simon Posts: 22
    edited 2014-09-11 09:54
    Somehow my reply to you has gotten lost in that great bit bucket in the sky.

    I see now that the formulas are different for the two sensors. A little work here for me. Your work on the SHT-11 was very much appreciated here in getting going in the greenhouse.

    I also looked at the interface issue with the 3.3 vs. 5 volt issue and after some useful discussions here realized that the pin output of the Stamp goes to +5v and would not work. I'm will be using a level shifter break out board.

    I'm expecting some SHT-21 devices on break out boards from China soon as well the SI2007.

    Andrew, I think you would do well making a SHT-21 board!

    Paul
Sign In or Register to comment.