Go Down

Topic: SHT15 ACK error (Read 1 time) previous topic - next topic

mathphreak

I'm trying to get the temperature from an SHT15 sensor using the sample code at http://wiring.org.co/learning/basics/humiditytemperaturesht15.html (at least I think that's where it came from; I'm collaborating with someone else on this project).  I know the SHT15 is wired correctly, but I'm getting Ack Error 2, which I think signifies that the acknowledgement from the SHT15 was never received.  The temperature that my Arduino is dumping to serial is 0xFFFFFFD8.  I calculated the raw value the SHT15 is returning as 0x8E38E3AF (thanks to Wolfram|Alpha).  I've tried extending the wait period in waitForResultSHT(), but that doesn't seem to help.  Can anybody help this noob?

I sense that full code would be helpful.  Here it is.
Anybody with a signature is a liar.

PaulS

I use this library. Works great for my application.
https://github.com/practicalarduino/SHT1x

burtlo

@PaulS I cloned that library and opened up the example but found that my readings were consistently failing, same as @mathphreak, but without it reporting ACK errors.

I posted an issue, but thought that I would reach out in additional places.

robtillaart

How long are the cables between Arduino and the SHT15?

A quick look at the code triggert the following question:
think some int's should be unsigned int or ..

Code: [Select]
int getData16SHT(int dataPin, int clockPin) {
  int val;

  // Get the most significant bits
  pinMode(dataPin, INPUT);
  pinMode(clockPin, OUTPUT);
  val = shiftIn(dataPin, clockPin, 8);
  val *= 256;   << if val = 0xFF there will be a signed overflow!
....


==>

Code: [Select]
unsigned int getData16SHT(int dataPin, int clockPin) {
unsigned int val = 0;

  // Get the most significant bits
  pinMode(dataPin, INPUT);
  pinMode(clockPin, OUTPUT);
  val = shiftIn(dataPin, clockPin, 8);
  val *= 256;
....
Rob Tillaart

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

Go Up