GithubHelp home page GithubHelp logo

adafruit_si7021's Introduction

Adafruit Si7021 Temperature & Humidity Sensor Breakout Board Build StatusDocumentation

This is the library for Adafruit Si7021 humidity / temp sensor breakout.

Tested and works great with the Adafruit Si7021 breakout.

This chip uses I2C to communicate, 2 pins are required to interface.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Limor Fried/Ladyada (Adafruit Industries). BSD license, check license.txt for more information All text above must be included in any redistribution

To install, use the Arduino Library Manager and search for "Adafruit Si7021 Library" and install the library.

adafruit_si7021's People

Contributors

caternuson avatar chuckvanzant avatar dastels avatar evaherrada avatar helmut64 avatar hoffmannjan avatar johnduhart avatar ladyada avatar mikaelprag avatar siddacious avatar stickbreaker avatar tyeth 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

Watchers

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

adafruit_si7021's Issues

python library?

Is there a python library for this, if now how would i make one?

RAM leak in library 1.5.1

[[email protected]] / [[email protected]]

all other libraries are in the zip file.

Polling the sensor(humidity or temperature) eats 8 bytes of RAM each poll that doesn't get released each loop.
This will cause the program to crash in a few minutes (out of RAM)

Using Adafruit version (of the Si7021) 1.4.0 fixes the RAM leak problem, the problem exist with version 1.5.0 and 1.5.1.

code also in zip, as it is unreadable as text here ( brackets don't seem to work very well with my code?)

How to change the i2C pin?

I am using ESP-12S and struggling with this library, as its not getting detected.
I want to change the i2c pins as the default pins for the esp-12s board have different pins assigned.

Humidity value is getting reported above 100%

Im just using latest library as it is with ESP8266. What i observed is humidity is crossing 100 value and is being reported as 101 and above.

Its currently raining outside but I guess RH value is never beyond 100.
Please help.

unify with bme280 (no issue, Feature reguest)

I would like to unify this with bme280
like so
/*!
* @brief Sets up the HW by reseting It, reading serial number and reading
* revision.
* @return Returns true if set up is successful.
*/
bool Adafruit_Si7021::begin(uint8_t addr, TwoWire *theWire) {
delete i2c_dev;
i2c_dev = new Adafruit_I2CDevice(addr, theWire);
if (!i2c_dev->begin())
return false;
return init();
}
`/*!` `* @brief Initialise sensor with given parameters / settings` `* @returns true on success, false otherwise` `*/` `bool Adafruit_Si7021::init() {`
if (_readRegister8(SI7021_READRHT_REG_CMD) != 0x3A)
_writeRegister8(SI7021_WRITERHT_REG_CMD, 0x3A);
if (_readRegister8(SI7021_READRHT_REG_CMD) != 0x3A) return false;
readSerialNumber();
_readRevision();
``
return true;
`}`

and this check
if (_readRegister8(SI7021_READRHT_REG_CMD) != 0x3A)
why?
Copyright?

Unused variable in the library

...\Arduino\libraries\Adafruit_Si7021_Library\Adafruit_Si7021.cpp: In member function 'float Adafruit_Si7021::readHumidity()':
...\Arduino\libraries\Adafruit_Si7021_Library\Adafruit_Si7021.cpp:88:15: warning: unused variable 'chxsum' [-Wunused-variable]
uint8_t chxsum = _wire->read();
^
...\Arduino\libraries\Adafruit_Si7021_Library\Adafruit_Si7021.cpp: In member function 'float Adafruit_Si7021::readTemperature()':
...\Arduino\libraries\Adafruit_Si7021_Library\Adafruit_Si7021.cpp:121:15: warning: unused variable 'chxsum' [-Wunused-variable]
uint8_t chxsum = _wire->read();

using with I2C multi sensors board CCS811 + SI7021 + BMP280

I use multi I2C sensors board (CCS811 + SI7021 + BMP280)
(like this https://arduino.ua/prod3768-modyl-datchikov-kachestva-vozdyha-ccs811--si7021--bmp280)

First I'm try using Marcus Sorensen [email protected] library, but it is not work stable for my sensors board.

Secondary I try to using this Adafruit_Si7021 it is work properly for I2C address 0x40, only after I re-code begin() method like this

`
bool Adafruit_Si7021::begin() {
_wire->begin();

_wire->beginTransmission(_i2caddr);
_wire->endTransmission();

reset();

_readRegister8(SI7021_READRHT_REG_CMD);

readSerialNumber();
_readRevision();

return true;
}
`
I know it is all wrong way! But like temporary solution it is possible to use and I hope it is helps to developers.

Additional:
After some loops counts the sensor is lost bus... so if temperature or humidity values is NAN, just call begin() method.

like this
float temperature = sensor.readTemperature(); if (temperature == NAN) { Serial.println("Si7120 reset"); sensor.begin(); float temperature = sensor.readTemperature(); } Serial.print("Humidity: "); Serial.print(sensor.readHumidity(), 2); Serial.print("\tTemperature: "); Serial.println(temperature, 2);

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.