Digital_Temperature_and_Humidity_sensor__With_Stainless_Steel_Probe___SKU_SEN0148_-DFRobot

Introduction

This is an anti-rust, robust and precise SHT3x sensor, which can master both enterprise-class and industrial-level applications. It can be applied in various fields: telepoint base stations, electronic control cabinet, production sites, storehouses, machine rooms, greenhouses, animal farming, medicine stock and etc. Metallic package enables it to deal with the very dusty or other severe circumstance. the wall-hanging style makes it easy to install.

The metallic mesh covering the sensor adopts method of infiltering copper during sintering to enhance the temperature resistance, pressure resistance, and wearing resistance of it. The 2-wire serial interface and internal voltage regulation allows for easy and fast system integration. Moreover, it's Arduino compatible and we supply a simple to use library for it.

Specifition

Applications

Connecting diagram

warning_yellow.png NOTE: The line to the ground is blue instead of black.

Sample Code

Download the DFRobot Arduino SHT3x library

How to install Libraries in Arduino IDE

    /*!
     * @brief Construct the function
     * @param pWire I2C bus pointer object and construction device, can both pass or not pass parameters, Wire in default.
     * @param address Chip I2C address, two optional addresse.
    */
    /*!
     * @file singleMeasurement.ino
     * @brief Read ambient temperature (C/F) and relative humidity (%RH) in single-read mode.
     * @n Experimental phenomenon: the chip defaults in this mode, we need to send instructions to enable the chip collect data,
     * which means the repeatability of the read needs to be set (the difference between the data measured by the chip under the same measurement conditions)
     * then read the temperature and humidity data and print the data in the serial port.
     * @n Single measure mode: read data as needed, power consumption is relatively low, the chip idle state only costs 0.5mA.
     * @copyright  Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
     * @licence     The MIT License (MIT)
     * @author [fengli](li.feng@dfrobot.com)
     * @version  V1.0
     * @date  2019-08-21
     * @get from https://www.dfrobot.com
     * @url https://github.com/DFRobot/DFRobot_SHT3x
    */

    #include <DFRobot_SHT3x.h>

    /*!
     * @brief Construct the function
     * @param pWire I2C bus pointer object and construction device, both can pass or not pass parameters,
     * Wire in default.
     * @param address Chip I2C address, two optional addresses 0x44 and 0x45(0x45 in default).
     * @param RST RST Chip reset pin, 4 in default.
     * @n I2C address is determined by the pin addr on the chip.
     * @n When the ADR is connected to VDD, the chip I2C address is 0x45.
     * @n When the ADR is connected to GND, the chip I2C address is 0x44.
     */

    DFRobot_SHT3x sht3x(&Wire,/*address=*/0x44,/*RST=*/4);
    //DFRobot_SHT3x   sht3x;

    void setup() {
      Serial.begin(9600);
      //Initialize the chip
      while (sht3x.begin() != 0) {
        Serial.println("Failed to Initialize the chip, please confirm the wire connection");
        delay(1000);
      }
      /**
       * readSerialNumber Read the serial number of the chip.
       * @return Return 32-digit serial number.
       */
      Serial.print("Chip serial number");
      Serial.println(sht3x.readSerialNumber());

      /**
       * softReset Send command resets via I2C, enter the chip's default mode single-measure mode,
       * turn off the heater, and clear the alert of the ALERT pin.
       * @return Read the register status to determine whether the command was executed successfully,
       * and return true indicates success.
       */
       if(!sht3x.softReset()){
         Serial.println("Failed to Initialize the chip....");
       }

      /**
       * heaterEnable(): Turn on the heater inside the chip to enable the sensor get correct humidity value in wet environments.
       * @return Read the status of the register to determine whether the command was executed successfully,
       * and return true indicates success.
       * @note Heaters should be used in wet environments, and other cases of use will result in incorrect readings
       */

      //if(!sht3x.heaterEnable()){
      // Serial.println("Failed to turn on the heater....");
      //}
      Serial.println("------------------Read adta in single measurement mode-----------------------");
    }

    void loop() {
      Serial.print("Ambient Temperature(°C/F):");
      /**
       * getTemperatureC Get the meansured temperature(℃).
       * @return Return float temperature data.
       */
      Serial.print(sht3x.getTemperatureC());
      Serial.print(" C/");
      /**
       * getTemperatureF:Get the meansured temperature(℉).
       * @return Return float temperature data.
       */
      Serial.print(sht3x.getTemperatureF());
      Serial.print(" F ");
      Serial.print("Relative Humidity(%RH):");
      /**
       * getHumidityRH: Get the meansured humidity (%RH)
       * @return Return float humidity data
       */
      Serial.print(sht3x.getHumidityRH());
      Serial.println(" %RH");

      /**
       * @brief Get temperature and humidity data in single measurement mode.
       * @param repeatability Set repeatability to read temperature and humidity data with the type eRepeatability_t.
       * @note  Optional parameters:
                   eRepeatability_High /**In high repeatability mode, the humidity repeatability is 0.10%RH, the temperature repeatability is 0.06°C
                   eRepeatability_Medium,/**In medium repeatability mode, the humidity repeatability is 0.15%RH, the temperature repeatability is 0.12°C.
                   eRepeatability_Low, /**In low repeatability mode, the humidity repeatability is0.25%RH, the temperature repeatability is 0.24°C
       * @return Return a structure containing celsius temperature (°C), Fahrenheit temperature (°F), relative humidity(%RH), status code.
       * @n Return O indicates right data return.
      DFRobot_SHT3x::sRHAndTemp_t data = sht3x.readTemperatureAndHumidity(sht3x.eRepeatability_High);
      if(data.ERR == 0){
        Serial.print("Ambient Temperature(°C/F):");
        Serial.print(data.TemperatureC);
        Serial.print(" C/");
        Serial.print(data.TemperatureF);
        Serial.print(" F ");
        Serial.print("Relative Humidity(%RH):");
        Serial.print(data.Humidity);
        Serial.println(" %RH");
      }
      */
      delay(1000);
    }

More Documents

DFshopping_car1.png Get Temperature and Humidity sensor (With Stainless Steel Probe) from DFRobot Store or DFRobot Distributor.

Turn to the Top