SHT20 Soil Moisture/Temp Sensor not writing to serial monitor

I’ve been running the test code for the SHT20 sensor on my UNO R3. The code I am running is the one included in the DFR_SHT20_master Library. When I upload the test code it writes the phrase “SHT20 example” as expected but then it does not output anything further, just stays blank after “SHT20 example”. So far I’ve tried checking my com port to see if it is correct, pressing the refresh button , and applying a 330 ohm pull-up resistor to the clock and connection mode. I am able to get a reading when I unplug the data and connection mode but it says that the temperature is 998 degrees c and humidity is 998%.

Does this mean that my sensor is broken and in need of replacement or is my implementation simply wrong?

Below is the test code and attachments are the schematic of how I attached the wires of the sensor, the odd serial monitor output, and the expected output of the serial monitor when thing are working as they are supposed to.

/*!
 * @file  DFRobot_SHT20_test.ino
 * @brief DFRobot's SHT20 Humidity And Temperature Sensor Module
 * @n     This example demonstrates how to read the user registers to display resolution and other settings.
 *        Uses the SHT20 library to display the current humidity and temperature.
 *        Open serial monitor at 9600 baud to see readings.
 *        Errors 998 if not sensor is detected. Error 999 if CRC is bad.
 * Hardware Connections:
 * -VCC = 3.3V
 * -GND = GND
 * -SDA = A4 (use inline 330 ohm resistor if your board is 5V)
 * -SCL = A5 (use inline 330 ohm resistor if your board is 5V)
 */
 

#include <Wire.h>

#include <DFRobot_SHT20.h>

DFRobot_SHT20    sht20;

void setup()
{
    Serial.begin(9600);
    Serial.println("SHT20 Example!");
    sht20.initSHT20();                                  // Init SHT20 Sensor
    delay(10000);
    sht20.checkSHT20();                                 // Check SHT20 Sensor
}

void loop()
{
    float humd = sht20.readHumidity();                  // Read Humidity
    float temp = sht20.readTemperature();               // Read Temperature
    Serial.print("Time:");
    Serial.print(millis());
    Serial.print(" Temperature:");
    Serial.print(temp, 1);
    Serial.print("C");
    Serial.print(" Humidity:");
    Serial.print(humd, 1);
    Serial.print("%");
    Serial.println();
    delay(1000);
}

SHT20_I2C_Temperature_&_Humidity_Sensor_Connection.jpg

SHT20 is a 3.3V device. It's not 5V tolerant as far as I know. So if you connected it as your fritzing output shows you might have destroyed it already.

If the supply voltage didn't kill it the 330Ω pull-up probably did. The maximum sink current of an I2C device is about 3mA, your circuit created more than 5 times that value.

I was following along with a tutorial and that was what it said to use as my pin inputs. What should I do in the future? the same connections just using the 3.3v instead?

https://wiki.dfrobot.com/SHT20_I2C_Temperature_&_Humidity_Sensor__Waterproof_Probe__SKU__SEN0227

The code says Vcc to 3V3 and the 330Ω resistor inline, so between the sensor and the corresponding Arduino pin. I guess that special product has the pull-ups internally. Keep in mind that you don't use the SHT-20 directly but some product with an internal PCB that contains additional circuitry.

My guess is that your sensor is fried. Try an I2C scanner. If it's still alive it will answer, otherwise you should get a replacement.

I checked it with the I2C scanner. It's definitely dead. Thanks for your help!