sensirion returning starnge value
avionikeren
Posts: 64
My sensirion sensor sensor returns 65535 for both temp and hum, what am I doing wrong?
Comments
Post Edited (bozo) : 2/21/2009 2:34:47 PM GMT
assuming that the object is fault-free,
(a) check that the propeller pins you're using for data and clock align with your definitions for SHT_DAT & SHT_CLOCK.
the definitions in the object code might use pins 0 and 1 and if you are using different pins you need to change the definitions in the CON block
(b) if that checks out OK, make sure you are connecting the propeller DAT pin to the SHT DAT pin (pin 1 from memory)
and that the propeller SCK pin connects to the SHT SCK pin (pin3)
(c) if that checks out OK, make sure ground and Vdd are correctly set up to the SHT (eth to pin4, Vdd to pin8)
(d) if that checks out OK, either the SHT is faulty or the object needs debugging
I doubt the SHT is faulty, mine has had a hard life and still works fine, but it could be possible.
\cheers, Mark
Have checked the connections over and over, and also observed the clock and data stream
with scope, looks good, but will·get another probe so I can watch them simultaneously...
Post Edited (bozo) : 2/21/2009 6:22:10 PM GMT
This·is·from my code, can you see anything wrong?
i.e.
pub main
sht.start(SHT_DAT, SHT_SCK)
also tried with and without the reset command...
Started to think if the input could have been damaged, i`m using a 1k resistor on the data line, shouldn`t that be enough?
in the module itself the data line is pulled high by a 4k7 resistor (between sensiron chip pin 2 and Vdd) and there's a 330R resistor in series (between sensiron chip pin 2 & pin 1 on the module board)
so if you've added 1k, it's quite likely you're upsetting the actual voltage on the data line ... and your commands are not reaching the sensiron and/or the data results are not reaching the prop with 1s and 0s within the voltage tolerance ranges
just a direct connection between prop and sensiron module is all that's needed
hopefully that'll cure everything
could that be the propblem, the sensirion on 5volt and the prop on 3,3?· when I look at the scope, there is 4,0volt on dataline high...
what object is defined as serial in your code? is there a possibility that everything is working ok but the call to the serial.dec routine is not translating the value properly? (does it convert a binary into a decimal? ...)
Post Edited (bozo) : 2/22/2009 10:30:08 AM GMT
I`m using the Extended_FDSerial object. And I tried to set (datastring[noparse][[/noparse]8] := 100) and that is transmitted perfect...
You've checked the board for obvious faults such as broken tracks, dry joints, corrosion, ...?
When you observe the data line are you able to confirm that both the propeller and the sensiron are responsible for driving it? When the addr/command is sent, the propeller is driving the line, when the data/measurement is being sent the sensiron is driving the line ... it happens so fast that unless you have a storage cro it can be tough to determine whether the data line is being used for addr/command or measurement data
one possible thing to try is to edit the sensiron object to put a few seconds of delay between the addr/command and reading the data ... that'll let you observe whether the sensiron is actually taking control of the data line
otherwise there aren't many other avenues to explore [noparse]:([/noparse]
Triple check that the physical propeller pin you are using for the data line is the one that you've defined in your code, or try another pin.
What is the status for? should I use the writeStatus command?
which pin on the module are you connecting the propeller data pin to?
Use 3.3V... and a single 1k on your data line
I don't have anything on the ground line... except ground(of course)
I promised to feed my son ... yesterday; so I really don't have time to look at the pinouts. Will check back later.
Rich
how do either of those suggestions fix the problem?
There is some possible confusion if you use the data sheet supplied by Sensirion. On page 7 the pinouts are not what you would expect from the Parallax document and might lead you astray.
can you post the full code you're using?
Usually it was a pin assignment in the software that I had read and re-read and just read it wrong.
We are the worst ones to edit our own mistakes.
At most you have blown a pin on the Prop... move things around.
You should be using the demo code to debug your setup.
If you can post a picture of your set-up that might help.
I also had a power supply problem... that I didn't know I had. Everything measured out ok with my multimeter... but I was getting crazy stuff that didn't go away until I plugged a power supply from SpinStudio into my breadboard.
Here`s· the full code, tell me if you see something wrong...(Everything else works perfect,·only the sensirion that is the problem)
will take another look in the morning.
Hang in there, you are almost done... and ready to start producing some interesting numbers. Make sure you post your results... and for that it would be useful if you had an SD card to record to.
For now, just look at the demo code by Cam Thompson...
For example he reads the temperature value into a long, which I call "getvalue," below:
getvalue:= f.FFloat(sht.readTemperature)
and then he does a string conversion on getvalue and then displays that value.
Try breaking out the code and just worry about the sht.... set it up, and run the demo...
once you have that working... it should work in your main program... unless you run out of cogs first[noparse]:)[/noparse]
I don't have mine set up at the moment and don't remember if voltage was an issue in your setup... but I used 3.3Volts and then as long as I got my the data and clock lines right, the rest didn't seem to matter. Of course it is best to set it up as documented[noparse]:)[/noparse]
By the way... I assume sht means... "sense humidity and temperature," but the guy that named it deserves a prize... it is hard to forget the name, which isn't true for most chips. I liked this chip first time I saw the name...
Rich