Code Monkey home page Code Monkey logo

sht3x's Introduction

SHT3x

Arduino library for Sensirion temperature and humidity sensors SHT30, SHT31 & SHT35.

The heavy version.
Check for /examples for examples of different use cases.

The datasheet I followed is:
https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/2_Humidity_Sensors/Sensirion_Humidity_Sensors_SHT3x_Datasheet_digital.pdf
For more simple version check the SimpleSHT3x library.

The constructor structure:
SHT3x( int Address = 0x44, //I2C device address, 0x44 or 0x45
ValueIfError Value = Zero, //What to return in case of errors. Zero or PrevValue
uint8_t HardResetPin = 255, //Number of pin RESET connected to (input from 100 to 255 if not used)
SHT3xSensor SensorType = SHT30, //Sensor type, SHT30, SHT31 or SHT35.
SHT3xMode Mode=Single_HighRep_ClockStretch //Operation mode , look for "enum SHT3xMode"
);

Do not forget about the UpdateData() method: this method polls sensors.

Supports:

Temperature data at Celsius, Kelvin and Fahrenheit scales.  
Relative humidity data.  
Absolute humidity data at Torr, mm Hg, Pa, bar, technical and standard atmosphere, psi scales.  
Data integrity (by CRC8 algorithm) (datasheet/section 4.12).  
Temperature, relative and absolute humidity tolerances (in dependence from measured values)  
Calibration (linear) of temperature and humidity data by factors or by reverse sensor values (2 points)  
Heater On/Off (integrated to SHT3x sensor) (datasheet/section 4.10)  
Different sensor actions modes (datasheet/section 4.3)  
Reset: soft (I2C) and hard (by corresponding pin) (datasheet/section 4.9)  

Do not supports:

Action in periodic mode (datasheet/section 4.5)  
Interrupts (datasheet/section 3.5)  

Note 1: by default, the data from sensor updates not faster, than 2 times a second. For faster update use SetUpdateInterval(uint32_t UpdateIntervalMillisec); but do not exceed the datasheet values (10 measurments per second (100 ms)) because of sensor self-heating (datasheet/section 4.5, at the end of Table 9)

Note 2: The sensor type affects the tolerance values only.

Created by Risele for everyone's use (profit and non-profit).

ALL THESE WOR_DS
ARE YOURS EXCEPT
RISELE
ATTEMPT NO
namechangING THERE
USE THEM TOGETHER
USE THEM IN PEACE

sht3x's People

Contributors

bfaliszek avatar risele avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sht3x's Issues

Calibration

Hello,

Thank you for your job.
Can you tell me how i can determine (calculate) factors and shift like your exemple:

SHT3x::CalibrationFactors TemperatureCalibration; TemperatureCalibration.Factor = -1.; TemperatureCalibration.Shift = -1000.; /*And than use Kelvin, muhaha! Ok, that was a joke. Here are real values from my expeirence (Celsius): my SHT30 and trusted instrument have shown (temperature conditions were similar, we tested it over humidity changes): SHT30: 23.6 ; 25.1; TrIns: 22.3 ; 23.7; So, the overcalibraion equation is: Trusted_Instrument = SHT30 * 0.9333 + 0.2733, so */ TemperatureCalibration.Factor = 0.9333; TemperatureCalibration.Shift = 0.2733; Sensor.SetTemperatureCalibrationFactors(TemperatureCalibration);

Thank you

typo in Data_Update_speed

There is a typo in Data_Update_speed line 27. Replace Sensor_H with Sensor_FAST.
Serial.print("F: "); Serial.print(Sensor_H.GetRelHumidity(),2);
should be
Serial.print("F: "); Serial.print(Sensor_FAST.GetRelHumidity(),2);

Noob question: How to use the constructor

Hi, I'm sorry to have to ask this noob question:

I am integrating your very nice library into an Arduino sure of mine. For sure I integrated the library via the Board manager and then include the header:

#include <SHT3x.h>

Then, I guess the next line would be:

SHT3x Sensor;

.. but how do I construct the object? My settings woud be these:

SHT3x ( 
  int Address = 0x44, 
  ValueIfError Value = Zero,
  uint8_t HardResetPin = 255,
  SHT3xSensor SensorType = SHT35,
  SHT3xMode Mode=Single_HighRep_ClockStretch
);

I've used C many years ago but I'm quite new to OOP or whaever is the case here...

Thank you
Andreas

I2c bus

Hello,

Im cannot able to make work your library with my project because i need to use brzo_i2c library!
can you add possibiliti to this library to work you your own sht library pls?

The SHT3x.master library no longer works at all (on Arduino Uno or mega)

Impossible for the moment to use the SHT3x-master library even with the examples provided, the compilation gives the following error:
C:\Users\PC desktop Gilles\Documents\Arduino\libraries\SHT3x-master\SHT3x.cpp: In member function 'void SHT3x::Begin(int, int)':
C:\Users\PC bureau Gilles\Documents\Arduino\libraries\SHT3x-master\SHT3x.cpp:16:7: error: 'Wire1' was not declared in this scope
else Wire1.begin(SDA, SCL);

^~~~~

I'm trying on an Arduino Uno!

I tried to insert #define Wire1 Wire in SHT3x.h, or SHT3x.cpp or in my sketch but instead of Wire is not defined I get the error:
C:\Users\PC desktop Gilles\Documents\Arduino\libraries\SHT3x-master\SHT3x.cpp: In member function 'void SHT3x::Begin(int, int)':
C:\Users\PC bureau Gilles\Documents\Arduino\libraries\SHT3x-master\SHT3x.cpp:16:27: error: no matching function for call to 'TwoWire::begin(int&, int&)'
else Wire1.begin(SDA, SCL);

By deleting in the file SHT3x.cpp all the program blocks calling on WIRE1 it works but it is not too clean if each time it is necessary to modify this library...
Is it due to an update of the wire library?
Which is no longer compatible with SHT3x.master?
Should a new version be needed?

Thanks

No need to wait after Wire.requestFrom()

After the Wire.requestFrom() there is no need to wait for something and the timeout with millis() is not needed.

When the Wire.requestFrom() returns, the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library.

After the Wire.requestFrom() you may call Wire.available() to test if the same number of bytes was received as was requested.

ALERT pin with programable temperature and humidity

Hi guys,I found there is a programable register for ALERT pin in IC datasheet,when temperature or humidity out of correct range.The ALERT pin will generate SET interrupt to MCU,my confusion is why there are no codes about this part implement.
Looking forward for your reply,Thank you very much.

The measurement accuracy of SHT30

The measurement accuracy of SHT30

The results from repeated tests of SHT30 are very different! It is the inventory problem! It's still the module! Can't know now!

Shutting Down The Sensor

Hello, can you please tell me the command to shut down the sensor. Usually it is Wire.end()

I see one for begin but not end.

Data_Update_speed: no values (only zeros)

The arduino only returns "zero" values for all sensors and all speeds. What is wrong? (sketch operations mode working...)

Output on serial monitor:

Temperature, �
F: 0.00 | S: 0.00
Relative Humidity, %
F: 0.00 | S: 0.00
Temperature, �
F: 0.00 | S: 0.00
Relative Humidity, %
F: 0.00 | S: 0.00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.