What's wrong with my SHT11?
Hi there,
I just installed a SHT11 sensor I bought few months ago and I'm receiving "strange" values.
rawTemp = 771
rawHumidity = 460
Celcius = -323
RelHumidity = 140
TcHumidity = 113
If I place it in a warmer place, I get higher value for the temp. If I place it in the fridge, I get lower value.
rawTemp = 12
rawHumidity = 800
Celcius = -399
RelHumidity = 266
TcHumidity = 218
The code is pretty straight forward.
I have install the resistor for the clock pin to Vss and there is no other components on those CPU.pinx.
The only thing is that sensor is at about 40 feet from the Javelin.
Any clue what the issue can be? If it's the distance, can I add delays everywhere on the code to make it slower?
Thanks,
JM
I just installed a SHT11 sensor I bought few months ago and I'm receiving "strange" values.
rawTemp = 771
rawHumidity = 460
Celcius = -323
RelHumidity = 140
TcHumidity = 113
If I place it in a warmer place, I get higher value for the temp. If I place it in the fridge, I get lower value.
rawTemp = 12
rawHumidity = 800
Celcius = -399
RelHumidity = 266
TcHumidity = 218
The code is pretty straight forward.
Sht11 sht11 = new Sht11(CPU.pin9, CPU.pin8); int rawTemp = sht11.rawTemp(); int rawHumidity = sht11.rawHumidity(); System.out.print("rawTemp = "); System.out.println(rawTemp); System.out.print("rawHumidity = "); System.out.println(rawHumidity); System.out.print("Celcius = "); System.out.println(sht11.celsius(rawTemp)); System.out.print("RelHumidity = "); System.out.println(sht11.relHumidity(rawHumidity)); System.out.print("TcHumidity = "); System.out.println(sht11.tcHumidity(sht11.celsius(rawTemp), rawHumidity, sht11.relHumidity(rawHumidity)));
I have install the resistor for the clock pin to Vss and there is no other components on those CPU.pinx.
The only thing is that sensor is at about 40 feet from the Javelin.
Any clue what the issue can be? If it's the distance, can I add delays everywhere on the code to make it slower?
Thanks,
JM
Comments
then the resistors are already in the module.
Have you tried the testprogram (or your own program)
with the sensor close to the javelin?
What results do you get then?
regards peter
So I removed all the resistors attached to the module, and moved it close to the Javelin with 20cm long only cables.
Result:
09:41:04
rawTemp = 972
rawHumidity = 540
Celcius = -303
RelHumidity = 171
TcHumidity = 142
But it's moving...
09:42:36
rawTemp = 2048
rawHumidity = 194
Celcius = -195
RelHumidity = 38
TcHumidity = 26
I don't always get the same information.
09:43:58
rawTemp = 2177
rawHumidity = 130
Celcius = -182
RelHumidity = 12
TcHumidity = 3
Are you sure the 3 resistors are build in?
Based on this document, we still need to add on 4.7K resistor. http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/SensirionDocs.pdf
I just did some test and found something strange.
I have connected the SHT11 close to the javelin board, and it's working fine.
BUT...
If I keep the SHT11 connected to the javelin board, and I connect the line which is 40 feet long, it's not working anymore, even if there is nothing connected at the end of the 40 feet line.
I verified the line, and there is nothing wrong with it. No short-circuit, everything is well.
So it look like the line is generating some dirt on the signal which is why the sensor is failing.
If I disconnect the line, SHT11 is working fine. As soon as I connect the line, not working anymore.
So the issue is really there. It's only appenning with the data pin. Clock pin seems not to cause any issue.
What can I do to reduce the noise on this line? Should I put some pull-up or pull-down on the SHT11 side (40 feet away)? Or on the javelin side?
Any clue?
Thanks,
JM
You can try using shielded cable with the shield connected to GND.
Since the data wire has a reletive high impedance it will always pickup
noise. The shield hopefully eliminates most of the·noise.
regards peter
Thanks,
JM
Sensirion SHT11 page with datasheet:
www.sensirion.com/en/01_humidity_sensors/02_humidity_sensor_sht11.htm
Webpage for my SHT11 module that has the aformentioned resistors built-in:
www.aestheticacoustics.com/sht11_01.htm
I have used my module with 208 feet of Cat5 cable without issues.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andrew Williams
WBA Consulting
WBA-TH1M Sensirion SHT11 Module
Special Olympics Polar Bear Plunge, Mar 20, 2010
Thanks for the feedback regarding the Cat5 cable.
Parallas module already has one 4.7K resistors and one 330. If I'm still not able to make it works with the Cat5 cable, I will probably try your module.
My other solution will be to add one Javelin to the 3rd floor, and an RS-485 connection between the 2, but that's way more expensive than the actual solution...
I will keep the forum, posted.
Thanks,
JM
methods, which are native and they operate on 50kHz or so. Due to long cable
(and therefore increased capacitance) that frequency may be·too high.
Attached is a modified sht11 class that replaces the shiftIn and shiftOut methods
by discrete writePin() methods, plus it adds a delay after each pin toggle.
The new constructor is
static sht11slow mySht11 = new sht11slow(datapin,clockpin,delay);
delay is specified in milliseconds. You may want to to try this.
The class goes into same folder as sht11.java
regards peter
As far as the Parallax SHT11 module, you can easily add the pulldown for the clock as shown on page one of the Parallax Datasheet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andrew Williams
WBA Consulting
WBA-TH1M Sensirion SHT11 Module
Special Olympics Polar Bear Plunge, Mar 20, 2010
Thanks for the code.
I'm getting an error when I try to compile.
writeByte contains a constant out of range.
How can I fix that?
Thanks,
JM
····· if ((data & 0x8000) != 0) CPU.writePin(datapin,true);
into
····· if ((data & (short)0x8000) != 0) CPU.writePin(datapin,true);
regards peter
I pushed the new code, and it's strange, because I'm getting:
rawTemp =6658
rawHumidity =1219
Celcius =266
RelHumidity =412
TcHumidity =413
With 20cm or with 50 feet...
I tried with 0, 10 and 100 for the delay.
I will try with the previous class to see if that's the cause.
JM
Whatever rawTemp that gives should also be given
by class sht11slow.java with either short or long wires.
If sht11slow.java gives a rawTemp that is much different
then I probably made an error converting the shift methods.
Edit: celsius = 266 means 26.6 degrees. That could be right
if heater is on.
regards peter
·
You're right! I forgot that I have to divide by 10... SHT11 heater is not on, but my fireplace is, and it's pretty warm at home...
I placed a DS1620 as close as possible of the SHT11 to compare, and I have celius = 287 for the sht11 and celcius = 260 for the DS1620.
It's not a big difference. The 2 sensors are about 10cm away. 3 celcius is realistic for the error, even if it's still to much for me.
Also, I tried with and without the 50 feet wire and get the same result. That's a good news. I'm using 1 for the delay.
Do you know which one of the DS1620 and SHT11 is the more accurate?
Thanks again for your help.
JM
After 1 night, the difference between the 2 sensors is still 2 to 3 degrees. (21.8 vs 23.8)
That should be enought for my application.
Thanks again for your help.
JM