Shop OBEX P1 Docs P2 Docs Learn Events
Problem with N&V Sensirion Temperature/Humidity Sensor and DS1620 Applied Senso — Parallax Forums

Problem with N&V Sensirion Temperature/Humidity Sensor and DS1620 Applied Senso

Brann FenixBrann Fenix Posts: 57
edited 2006-08-24 17:09 in BASIC Stamp
Hi,

I just got my order of parts in the mail today to my surprise and have spent the day reading over the What is a Microcontroller? book and working out of the Applied Sensors book. I figured I would start with the refresher course on all the basics for my current project. But, I seem to have a pretty big problem over here problem that I will try my best to explain in the greatest detail possible after playing around with it for hours and having my brain turn into a pile of goo 


Problem #1 with the DS1620:

I am working with the PDF Applied Sensors book located here http://www.parallax.com/dl/docs/books/edu/WebAppliedSensors-v1.4.pdf and on page 12 I setup my BoE just as directed with the Applied Sensors part kit I just got today. The I ran the code on page 13 here:

' Applied Sensors - DS1620Configuration.bs2
' Configure the DS1620 for CPU continuous conversion.
'{$STAMP BS2}
'{$PBASIC 2.5}
LOW 13 ' Puts the DS1620 in the waiting state.
FREQOUT 0, 1000, 3800 ' Sound shows us the program is running.
HIGH 13 ' Tells the DS1620 a command is coming.
SHIFTOUT 15, 14, LSBFIRST, [noparse][[/noparse]12,2] ' Command to set DS1620 configuration 2.
LOW 13 ' Completes the command cycle.
END ' End of program.




Then I loaded the code on page 17 here and the only change I made was adding the code to display in Fahrenheit:

' Applied Sensors - DS1620.bs2
' Obtain temperature readings from the DS1620.
'{$STAMP BS2}
'{$PBASIC 2.5}

x VAR Byte ' General purpose variable, byte.
degC VAR Byte ' Variable to hold degrees Celsius.
degF VAR Byte ' Variable to hold degrees Fahrenheit.

' Note: DS1620 has been preprogrammed for mode 2.
OUTS=%0000000000000000 ' Define the initial state of all pins,
'FEDCBA9876543210
DIRS=%1111111111111111 ' as low outputs.
FREQOUT 0, 20, 3800 ' Beep to signal that it is running.
HIGH 13 ' Select the DS1620.
SHIFTOUT 15, 14, LSBFIRST, [noparse][[/noparse]238] ' Send the "start conversions" command.
LOW 13 ' Do the command.
DO ' Going to display once per second.
HIGH 13 ' Select the DS1620.
SHIFTOUT 15, 14, LSBFIRST, [noparse][[/noparse]170] ' Send the "get data" command.
SHIFTIN 15, 14, LSBPRE, [noparse][[/noparse]x] ' Get the data.
LOW 13 ' End the command.
degC = x / 2 ' Convert the data to degrees C.
DEBUG ? degC ' Show the result on the PC screen.
degF = degC * 9 / 5 + 32
DEBUG ? degF
PAUSE 1000 ' 1 second pause.
LOOP ' Read & display temperature again.





I ran the code and got degC = 100 and degF = 212… Now it might be hot in New England this time of year, but it sure isn’t 212F. Any ideas what would cause the readings to be this far off? If I put my finger on the sensor like the book says the temp does go up to about 112C or 233F and if I put it in front of my AC the temp does drop. It is reading something, but the range is very out of whack.


Problem #2 SensirionTemperature/Humidity Sensor woes…

I planned on using the Sensirion sensor as the backbone of my project and ordered one along with my Applied Sensors kit and some other goodies. Now, I am very lost over here with hooking this sensor up to my BS2 and really hope I did not damage anything.
I started by reading the N&V column "Environmental Sensing" #91 (.pdf) here http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv91.pdf . After reading the whole file I hooked up my sensor as instructed on the first page of the file. I then loaded the code supplied at the end of the file to make sure the sensor was working. I have attached the actual code I wrote to the BS2 incase something did not copy over from the PDF file, but I doubt that is the case. I then took it for a test run and fired up the code only to get this output in my debug window:

SHT1x Demo

soT...... 65535
tC....... 615.3º
tF....... 1139.5º

soRH..... 65535
rhLin.... 2623.1%
rhTrue... 471.8%


I thought the DS1620 was bad telling me it was 200+F this poor thing is report 1139.5F [noparse]:([/noparse] I then did a test by placing my finger on the sensor and then putting it near my AC and the values remained unchanged. The DS1620 would change even though it was wrong, but this sensor just stays the same. The real fun stuff comes up when I started looking at all the docs I could find on the sensor and found what looked to me like 3 different ways for connecting it to the BS2 which I found very odd. Here is what I found:

1. http://www.parallax.com/images/catapps/humidity_02.gif the picture is pretty small. But it sure looks to me that it is a different setup than the N&V info.

2. Sensirion Kit Documentation.pdf located here http://www.parallax.com/dl/docs/prod/acc/SensirionDocs.pdf This one is the oddest to me since it doesn’t use pin 2 and uses pin 8 when the N&V info does not use any pins on that side of the sensor.

3. The N&V issue here http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv91.pdf

Now, I have what seems like 3 different sets of directions and maybe I have been playing with this too long and need some sleep… but wtf? I am 100% lost here and some advice/help would be awesome.


I would like to get the DS1620 figured out for the sake of finishing the Applied Sensor book, since I feel it has some solid info that will help me in my project and I order the parts kit for just that reason. But, I had planned to base my project around the Sensirion sensor and that makes it the #1 problem to fix on my list with a bullet.


Thanks in advance,
Brann

Comments

  • Tom WalkerTom Walker Posts: 509
    edited 2006-08-21 13:34
    Let's start with Problem 1. Could it perhaps have been 100 degrees F around the sensor? Then it would just be a problem of the sensor actually reporting Farenheit and you needing to convert it to Celsius...not the other way around. I haven't worked with one, yet, so forgive me if I'm way off.

    I should know better than to say ANYTHING until the caffeine has kicked in....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • steve_bsteve_b Posts: 1,563
    edited 2006-08-21 17:38
    Here's a Basic SHT11 program.· Run this and check your connections (I've also included the SHT11 application note with code)not the same code I've attached!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Brann FenixBrann Fenix Posts: 57
    edited 2006-08-21 18:34
    Steve_b,

    So that is the correct way to wire the SHT11? I am a little confused by that diagram in the pdf file. I see how on the SHT11 pin 1 is data, pin 3 is clock with the optional resistor to Vss and pin 4 is Vss. The thing I don’t understand is the 330 and 4.7k ohm resistors that seem to be in series between pins 1 and 8. I have never seen a diagram like this with components inside another component and I would much rather ask and run the change of being called a noob than just take a guess and blow this $30 sensor out.

    Thanks,
    Brann [noparse]:)[/noparse]
  • steve_bsteve_b Posts: 1,563
    edited 2006-08-21 20:01
    Brann,

    do you have a picture of your SHT11? The actual sensor is sitting in themiddle of a small circuit board. On this board you'll see two small black rectangle's at one end...these are the resistors shown in the diagram.

    How do you have yours connected?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-08-21 20:08
    Maybe the last thing you need is yet another reference, but here is my page on the SHT11:
    www.emesystems.com/OL2sht1x.htm


    The 4.7kohm resistor is a pullup for the data line, and it is required. The 330 ohm resistor sits between the Stamp data pin and the SHT11 data pin. It is there to limit the current in case both the Stamp and the SHT try to be outputs at the same time in opposite states. In fact, that is going to happen sometimes because of the way the program is written. The SHT is going to turn the data pin around to be an output before the Stamp can turn its output (from the SHIFTOUT) into an input (preparation for the SHIFTIN). That only happens for a fraction of a millisecond because of the speed of the Stamp interpreter. The 330 ohm resistor on the carrier board protects against any and all bad consequences. The 330 ohm and the 4.7kohm resistors are not inside the SHT11. They are mounted by Parallax on the DIP carrier board.

    Do include the 4.7 kohm resistor on the clock line. Usually the SHT11 will work okay without it, but if the power supply comes up badly the SHT can enter a bad state where all the readings are $fffff, like you were getting. Sensirion sent out a bulletin suggesting the resistor. You will notice that on my diagram there is also a 330 ohm resistor on the clock line as well as on the data line. That is optional and is there only to provide a modicum of protection to the chip from miswiring, to limit accidental currents. Quite often the wiring for sensors is accomplished under field conditions, and there is quite a high probablility that wires will be connected incorrectly.

    For the DS1620, be sure you have a good bypass capacitor across its power supply. It is sensitive to glitches there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 8/21/2006 8:54:12 PM GMT
  • Brann FenixBrann Fenix Posts: 57
    edited 2006-08-21 23:41
    Thanks for the input and welcome to my humble thread Mr. Allen [noparse]:)[/noparse]

    I have read over your site and it brings up another old question. Your info shows nothing connected to pin 8 and vdd on pin 4 of the SHT11 and the pdf docs here http://forums.parallax.com/forums/attach.aspx?a=8906 show vss on pin 4 and vdd on pin 8 ??? Which is the correct way to wire it? Do both ways work? Or is your version of the sensor different from the one in the docs? I think I am clear on everything other than that.

    Thanks in advance,
    Brann
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-08-22 01:21
    Brann,

    The SHT11 as it comes from the Sensirion factory a surface mount package with connections to its pins 1 through 4. My diagram refers to those pin connections. When I got my first SHT11, I mounted it on a small SMT to DIP conversion board, and it so happened that the pins lined up in the same way with pins 1 to 4 along the side.

    What Parallax does is to mount the SHT11 SMT package on their special SMT to DIP carrier board, including the two resistors. An in so doing they re-routed the connections in the manner you have noted. Look and you will see that the carrier has the Sensirion chip and those resistors. Maybe that is what is causing your confusion? There is a simple explanation, in that the SHT11 and SHT11-module-from Parallax have two different pinouts. The purpose of the carrier board is to make it easier for you to connect the part to your circuit board, without having to deal with the leadless surface mount package.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Brann FenixBrann Fenix Posts: 57
    edited 2006-08-24 06:33
    Another one solved thanks to some very helpful info on this forum yet again [noparse]:)[/noparse]

    Sorry it took this long to report my status. I just tested everything a few seconds ago and after Tracy Allen explain that there are 2 different pin outs it all adds up now since I do have the Parallax one. I used the docs that steve_b pointed out and then fired up my code then poof it worked [noparse]:)[/noparse] The temps were about 4F higher than I think they really are, but that is something to look into tomorrow after a good night of sleep now that I know I am on the right track to reach my goals. Next up in the DS1620 and adding a "good bypass capacitor across the power supply". Now, I understand the reason for using a capacitor as it would be a buffer for the power that goes to the sensor, but I was wondering how I would go about connecting the capacitor and what value I should be using. I would assume the .1 uF mono radial capacitor is what I need to wire up as shown in the Applied Sensors book for the DS1620 circuit. I figure it never hurts to ask since I am still learning and I like to be on the safe side rather than blowing something up.

    Thanks again for all the help!
    -Brann
  • steve_bsteve_b Posts: 1,563
    edited 2006-08-24 12:31
    Glad you got it running!
    I tend to use 10uF and 1uF caps for my power supply filtering. (sometimes larger if it's a big supply). What's the BOE use?
    Anyhow, I tend to use Electrolytics and they're fine.

    Cheers

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-08-24 17:09
    Congrats on getting it working.

    Connect the capacitor from pin 4 to pin 8 of the DS1620, and if it is an electrolytic like Steve suggested, the (+) side goes to pin 8. Leave pins 5, 6 and 7 of the DS1620 disconnected.

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