i am using SHT15, without the breakout board, the problem is that it gives a fixed output in every case and condition
I have attached my code here
#include <SHT1x.h>
// Specify data and clock connections and instantiate SHT1x object
#define dataPin 10
#define clockPin 11
SHT1x sht1x(dataPin, clockPin);
void setup()
{
Serial.begin(9600); // Open serial connection to report values to host
Serial.println("Starting up");
}
void loop()
{
float temp_c;
float temp_f;
float humidity;
// Read values from the sensor
temp_c = sht1x.readTemperatureC();
temp_f = sht1x.readTemperatureF();
humidity = sht1x.readHumidity();
// Print the values to the serial port
Serial.print("Temperature: ");
Serial.print(temp_c, DEC);
Serial.print("C / ");
Serial.print(temp_f, DEC);
Serial.print("F. Humidity: ");
Serial.print(humidity);
Serial.println("%");
delay(2000);
}
and the output that i get is
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%
Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.69%
Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.69%
The output has been constant ever since.
Help is appreciated
ReadSHT1xValues.ino (957 Bytes)
pylon
September 18, 2018, 3:52pm
2
This result is from a missing sensor. So either the wiring is wrong, the wiring is damaged or the chip is damaged. As we don't have a wiring diagram, we cannot help you further.
i am using SHT15, without the breakout board
You soldered the wires directly to the chip? Post a picture of that!
i checked the connections, one wire was broken. now it is working fine. Thanks for your help.
I am posting pics.
This is the output now.
Starting up
Temperature: 25.0899963378C / 77.2519912719F. Humidity: 61.28%
Starting up
Temperature: 25.0899963378C / 77.2519912719F. Humidity: 61.09%
Starting up
Temperature: 25.0999984741C / 77.2339935302F. Humidity: 61.06%
Starting up
Temperature: 25.0899963378C / 77.2159957885F. Humidity: 61.00%
Starting up
Temperature: 25.0800018310C / 77.2159957885F. Humidity: 60.88%
I am again posting the code i used for this
#include <Wire.h>
/**
* ReadSHT1xValues
*
* Read temperature and humidity values from an SHT1x-series (SHT10,
* SHT11, SHT15) sensor.
*
* Copyright 2009 Jonathan Oxer <jon@oxer.com.au>
* www.practicalarduino.com
*/
#include <SHT1x.h>
// Specify data and clock connections and instantiate SHT1x object
#define dataPin 10
#define clockPin 11
SHT1x sht1x(dataPin, clockPin);
void setup()
{
Serial.begin(9600); // Open serial connection to report values to host
Serial.println("Starting up");
}
void loop()
{
float temp_c;
float temp_f;
float humidity;
Serial.println("Starting up");
// Read values from the sensor
temp_c = sht1x.readTemperatureC();
//Serial.println(temp_c);
temp_f = sht1x.readTemperatureF();
//Serial.println(temp_f);
humidity = sht1x.readHumidity();
//Serial.println(humidity);
/*Serial.println();Serial.println();
Serial.println(digitalRead(dataPin));*/
/*Serial.println();Serial.println();
Serial.println(digitalRead(clockPin));
Serial.println();*/
// Print the values to the serial port
Serial.print("Temperature: ");
Serial.print(temp_c, DEC);
Serial.print("C / ");
Serial.print(temp_f, DEC);
Serial.print("F. Humidity: ");
Serial.print(humidity);
Serial.println("%");
delay(2000);
}