How to you initialize a reset on a sht30 digital thermometer? I have a sht30 that will output correct temperature readings for about 5 min and then will drift off.
So I'm trying to hit the reset every few seconds to keep the readings accurate.
I am on a nano connecting d4 to the sht30 reset pin, but I don't appear to be resetting. My temp still drifts.
How do you correctly hit the reset on a sht30?
code:
#include &lt;Wire.h&gt;

// SHT31 I2C address is 0x44(68)
#define Addr 0x45

int reset_pin = 3; // reset pin is set to d4 on board.
int counter = 0; //reset counter

void setup()
{
  // Initialise I2C communication as MASTER
  Wire.begin();
  // Initialise serial communication, set baud rate = 9600
  Serial.begin(115200);
  delay(300);
}
 
void loop()
{
  unsigned int data[6];
 
  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Send 16-bit command byte
  Wire.write(0x2C);
  Wire.write(0x06);
  // Stop I2C transmission
  Wire.endTransmission();
  delay(300);
 
  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Stop I2C Transmission
  Wire.endTransmission();
 
  // Request 6 bytes of data
  Wire.requestFrom(Addr, 6);
 
  // Read 6 bytes of data
  // temp msb, temp lsb, temp crc, hum msb, hum lsb, hum crc
  if (Wire.available() == 6)
  {
    data[0] = Wire.read();
    data[1] = Wire.read();
    data[2] = Wire.read();
    data[3] = Wire.read();
    data[4] = Wire.read();
    data[5] = Wire.read();
  }
  // Convert the data
  int temp = (data[0] * 256) + data[1];
  float cTemp = -45.0 + (175.0 * temp / 65535.0);
  float fTemp = (cTemp * 1.8) + 32.0;
  float humidity = (100.0 * ((data[3] * 256.0) + data[4])) / 65535.0;
 
  // Output data to serial monitor
  Serial.print(&quot;Temperature in Celsius :&quot;);
  Serial.print(cTemp);
  Serial.println(&quot; C&quot;);
  Serial.print(&quot;Temperature in Fahrenheit :&quot;);
  Serial.print(fTemp);
  Serial.println(&quot; F&quot;);
  Serial.print(&quot;Relative Humidity :&quot;);
  Serial.print(humidity);
  Serial.println(&quot; %RH&quot;);
  delay(500);
  if(counter == 25){
    digitalWrite(reset_pin, HIGH); // sets the digital pin 13 on
    delay(1000);            // waits for a second
    digitalWrite(reset_pin, LOW);  // sets the digital pin 13 off
    delay(1000);
    counter  = 0;

  }
  counter++;
  Serial.println(counter);
}
You need to give a brief LOW pulse, not a long HIGH pulse:
In setup:
pinMode(reset_pin, OUTPUT);
digitalWrite(reset_pin, HIGH);

When you want to reset:
digitalWrite(pin_reset, LOW);
delay(1);
digitalWrite(pin_reset, HIGH);