Pages: [1]   Go Down
Author Topic: Wiring the Sensirion SHT15  (Read 1699 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 38
NerdArch
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In the playground, the author says: "Note: the Sensirion data sheet recommends using a 10K ohm pullup - the Arduino internal pullup ranges from 20K to 50K ohms."

Using the example sketch ReadSHT1xValues, I started with the 10k pullup resistor as the datasheet instructed, and tried w/o it thinking that this was what was being suggested in the above quote.  I got the same results on both tries.

Starting up
Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.69%
Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.69%
Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.69%

I have seen people mention calibration of the sensors.  Am I missing a step that involves this?
Logged

0
Online Online
Shannon Member
****
Karma: 206
Posts: 12113
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like you haven't achieved communication successfully yet.

Post the example sketch and wiring diagram / description?
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 38
NerdArch
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This example code is said to be for the SHT10, but I think it should work for both.  I've used the other examples out there, and have been met with the same results.  I will attach them as well.  I should also mention that I have edited some functions and variable names in the .cpp and .h source files.  Instead of temperature, there is temp_c_indoor; getTemp is now calcTempC; calcDewpoint is now calcDewpointC.  I also added the variable temp_f_indoor, and the functions calcTempF and calcDewpintF.  I'll attach them here as well, and follow up with a picture of the circuit.

The images should illustrate that I have set this up as indicated in the datasheet for the SHT15.

Quote
/*
 * Query a SHT10 temperature and humidity sensor
 *
 * A simple example that queries the sensor every 5 seconds
 * and communicates the result over a serial connection.
 * Error handling is omitted in this example.
 */

#include <Sensirion.h>

const uint8_t dataPin  =  2;
const uint8_t clockPin =  3;

float temp_c_indoor;
float humidity;
float dewpoint_c;

Sensirion tempSensor = Sensirion(dataPin, clockPin);

void setup()
{
  Serial.begin(57600);
}

void loop()
{
  tempSensor.measure(&temp_c_indoor, &humidity, &dewpoint_c);

  Serial.print("Temperature: ");
  Serial.print(temp_c_indoor);
  Serial.print(" C, Humidity: ");
  Serial.print(humidity);
  Serial.print(" %, Dewpoint: ");
  Serial.print(dewpoint_c);
  Serial.println(" C");
  
  delay(5000); 
}


* NonBlocking2.ino (6.49 KB - downloaded 13 times.)
* SimpleSensirion.pde (0.77 KB - downloaded 12 times.)
* Sensirion.cpp (13.78 KB - downloaded 23 times.)
* Sensirion.h (3.25 KB - downloaded 23 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 38
NerdArch
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

See picture/diagram here.

* Untitled Extract Pages.pdf (54.63 KB - downloaded 14 times.)

* 2012-05-03 11.06.40 (1).jpg (124.19 KB, 800x480 - viewed 79 times.)

* 2012-05-03 11.06.22 (1).jpg (121.59 KB, 800x480 - viewed 76 times.)

* 2012-05-03 11.07.07 (1).jpg (121.65 KB, 800x480 - viewed 82 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 38
NerdArch
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The error checking section of code in the non-blocking example yields:


Error: No response (ACK) received from sensor!
Status reg = 0xFF
Error: No response (ACK) received from sensor!
Error: No response (ACK) received from sensor!
Status reg = 0xFF
Error: No response (ACK) received from sensor!
Error: No response (ACK) received from sensor!
Temperature = -40.10 C, Humidity = 0.10 %, Dewpoint = -90.17 C
Error: No response (ACK) received from sensor!
Error: No response (ACK) received from sensor!
Temperature = -40.10 C, Humidity = 0.10 %, Dewpoint = -90.17 C
Error: No response (ACK) received from sensor!
Error: No response (ACK) received from sensor!
Temperature = -40.10 C, Humidity = 0.10 %, Dewpoint = -90.17 C
Error: No response (ACK) received from sensor!
Error: No response (ACK) received from sensor!
Temperature = -40.10 C, Humidity = 0.10 %, Dewpoint = -90.17 C
Error: No response (ACK) received from sensor!
Error: No response (ACK) received from sensor!
Temperature = -40.10 C, Humidity = 0.10 %, Dewpoint = -90.17 C
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 38
NerdArch
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There may be a bad connection on the sensor shield.  When I checked for voltage on the SCR lead, I got nothing.  When I put the jumper from the 2 pin directly to that lead I get:

Error: CRC mismatch!
Error: CRC mismatch!
Temperature = 2581.30 C, Humidity = 0.10 %, Dewpoint = 265.37 C

My soldering work, and that of the shield look fine so I'm not sure what the deal is here.

Regardless, even with the connection working I get an error.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 216
Posts: 13676
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Temperature = 2581.30 C, ... My soldering work,
Your soldering would melt at those temps smiley-wink

Do you have the latest libraries?  do you have a link?

Is the lib in accordance with the datasheet?


Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 38
NerdArch
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have two seperate libraries (senserion and sth1x).  As far as I know they're up to date.  I wouldn't know how to find out if the lib is in accordance with the datasheet.  Both libs can be found at http://arduino.cc/playground/Code/Sensirion.  STH1x can also be found at https://github.com/practicalarduino/SHT1x.
Logged

0
Online Online
Shannon Member
****
Karma: 206
Posts: 12113
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try shortening the leads from microcontroller to the SHT15, and run ground wires parallel to both SDA and SCL signals - these are high-speed logic signals and should be kept short and low-inductance to avoid crosstalk and ringing.  You have 4k7 pullups on each?
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 38
NerdArch
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a 10k pullup on the SCK line, the datasheet doesn't call for one on the data line.  I can try that and the other hints you mentioned just as soon as I get a new Arduino board...my FIO/XBEE set up refuses to take new sketches and just keeps pumping out serial com from the previously uploaded sketch.

The upload error shown in the IDE: avrdude: stk500_getsync(): not in sync: resp=0x00

I've tried everything from re-configuring the radios to sending +++@.  The FIO has been nothing but trouble from day 1.  Manual reset fails as well.

Did you mean 47k pullups?
« Last Edit: May 03, 2012, 06:52:19 pm by khansen3 » Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2883
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If in doubt, pull them up anyway, a 4K7 resistor only adds 1.0... mA to the load and on an Arduino digital pin that is not much additional current. For longer wires the pull-ups can go as low as 1K  at faster speed/longer wires between sensor and Arduino.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Offline Offline
Newbie
*
Karma: 0
Posts: 38
NerdArch
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Isn't a pullup supposed to reduce the amount of voltage going to the data pin?  My multi-meter is telling me that the data pin on the sensor is receiving 3.5V, and the SCK is is fluctuating between 15 and 25 mV.  

Edit: the SCK reading happened without me realizing that the 3.3V jumper had fallen out of the board.  Both were approximately the same (3.5V).  Is the pullup supposed to go to Vin?  I'm not an electrical engineer obviously, but it seems to make more sense to run it to ground.

The datasheet doesn't specify a pullup for both, only the DATA line.  However, I have one on both for the voltages mentioned above.

Obviously, I'm still getting the same println() results.
« Last Edit: May 05, 2012, 08:34:42 pm by khansen3 » Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2883
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you trying to interface a 3V3 device directly to the 5V Arduino? You must provide a level shifter from 3V3 to 5V and back. That you are measuring 3V5 on a 3V3 input/output pin is an indication of a defective measurement or it is an indication of an interface problem. Note that the 3V3 source cannot sink current... a 4K7 resistor from 5V to the 3V3 source will pull it up to about 4.8 volts... From my recent direct experience with a Bosch BMP085 Barometric Sensor and this would be the cause of no apparent data... There is none yet. the level shifter can be 2 2N7000 mosfets and 2 pull-ups to 3V3 as well as the 2 to 5V. Mine worked well.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Birmingham, AL
Offline Offline
Jr. Member
**
Karma: 2
Posts: 91
Arduino, disobey me.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This sensor will work with 3.3V or 5V as Vcc.  I'd had good results with both.  I've used both libraries, but I've had better results with the Sensirion library.  I'm mostly using version 22 of the Arduino IDE.

-transfinite
Logged

Pages: [1]   Go Up
Jump to: