SHT-22 and Basic Stamp
Paul Simon
Posts: 22
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
Paul
Comments
It's at sensirion.com if ;you want to compare it to the sht11, which is spec'ed at 5 V.
Paul
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.
You could add a $3.00 voltage translator to the mix.
https://www.sparkfun.com/products/12009
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.
Yes, you are correct. 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
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
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
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
http://www.selmaware.com/stampplot/samples/webpage_sample.htm
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
http://matplotlib.org/
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.
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.
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
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
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