{"id":20989831,"url":"https://github.com/robtillaart/sht85","last_synced_at":"2026-01-12T14:50:20.936Z","repository":{"id":44933150,"uuid":"347394790","full_name":"RobTillaart/SHT85","owner":"RobTillaart","description":"Arduino library for the SHT85 temperature and humidity sensor","archived":false,"fork":false,"pushed_at":"2026-01-10T11:28:48.000Z","size":66,"stargazers_count":17,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-11T03:37:23.051Z","etag":null,"topics":["arduino","humidity","temperature"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobTillaart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"RobTillaart","custom":"https://www.paypal.me/robtillaart"}},"created_at":"2021-03-13T14:37:34.000Z","updated_at":"2026-01-10T11:28:27.000Z","dependencies_parsed_at":"2023-12-09T20:24:56.962Z","dependency_job_id":"4852258d-373f-4177-a10d-15c90cb2c57a","html_url":"https://github.com/RobTillaart/SHT85","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/RobTillaart/SHT85","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FSHT85","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FSHT85/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FSHT85/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FSHT85/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobTillaart","download_url":"https://codeload.github.com/RobTillaart/SHT85/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FSHT85/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","humidity","temperature"],"created_at":"2024-11-19T06:26:21.850Z","updated_at":"2026-01-12T14:50:20.917Z","avatar_url":"https://github.com/RobTillaart.png","language":"C++","funding_links":["https://github.com/sponsors/RobTillaart","https://www.paypal.me/robtillaart"],"categories":[],"sub_categories":[],"readme":"\n[![Arduino CI](https://github.com/RobTillaart/SHT85/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)\n[![Arduino-lint](https://github.com/RobTillaart/SHT85/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/SHT85/actions/workflows/arduino-lint.yml)\n[![JSON check](https://github.com/RobTillaart/SHT85/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/SHT85/actions/workflows/jsoncheck.yml)\n[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/SHT85.svg)](https://github.com/RobTillaart/SHT85/issues)\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/SHT85/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/RobTillaart/SHT85.svg?maxAge=3600)](https://github.com/RobTillaart/SHT85/releases)\n[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/SHT85.svg)](https://registry.platformio.org/libraries/robtillaart/SHT85)\n\n\n# SHT85\n\nArduino library for the SHT85 temperature and humidity sensor.\n\n\n## Description\n\nBased upon the SHT31 library - https://github.com/RobTillaart/SHT31\nhowever this library will be leading in the future as it implements derived classes \nfor the following sensors: **SHT30, SHT31, SHT35 and SHT85**.\n\n\n**WARNING** to keep self-heating below 0.1�C, the SHT85 sensor should \nnot be used for more than 10% of the time.\n\nFeedback as always is welcome.\n\n\n### Hardware \n\nAlways check datasheet before connecting! \n\n```\n    //  TOPVIEW      SHT85\n    //             +-------+\n    //  +-----\\    | SDA 4 -----\n    //  | /-+  ----+ GND 3 -----\n    //  | +-+  ----+ +5V 2 -----\n    //  +-----/    | SCL 1 -----\n    //             +-------+\n```\n\n\n### 0.6.0 Breaking change\n\nVersion 0.6.0 introduced a breaking change.\nYou cannot set the pins in **begin()** any more.\nThis reduces the dependency of processor dependent Wire implementations.\nThe user has to call **Wire.begin()** and can optionally set the Wire pins \nbefore calling **begin()**.\n\n\n### Compatibility\n\nThe SHT85 is protocol compatible with the SHT3x series.\nMain difference is the accuracy and the SHT85 only has one address 0x44.\nCompare the data sheets to see all differences.\n\nAccuracy table\n\n|  Sensor  |  Temperature  |  Humidity  |  Verified  }\n|:--------:|:-------------:|:----------:|:----------:|\n|   SHT30  |      ~0.3�    |     2.0%   |     N      |\n|   SHT31  |      ~0.3�    |     1.5%   |     Y      |\n|   SHT35  |      ~0.2�    |     1.5%   |     N      |\n|   SHT85  |      ~0.1�    |     1.5%   |     Y      |\n\n\nNote: The SHT40, SHT41 and SHT45 are not protocol compatible with SHT3x and SHT85.\nThe SHT4x series is slightly faster than the SHT3x series.\n\n\n### I2C performance\n\nThe SHT85 sensors should work (I2C) up to 1000 KHz. \nDuring tests with an Arduino UNO R3 it stopped between 500 - 550 KHz.\nSo to be safe I recommend not to use the sensor above 400 KHz.\nAlso the differences in read time becomes quite small. (max 15% gain).\n\nSee indicative output example sketch. \nSPS (= samples per second) are added later.\n\n\n|  I2C speed  |  read ms  |  SPS  |  notes  |\n|:-----------:|:---------:|:-----:|:--------|\n|    50 KHz   |    6.60   |  123  |\n|   100 KHz   |    5.11   |  140  |  default\n|   150 KHz   |    4.79   |       |\n|   200 KHz   |    4.64   |  140  |\n|   250 KHz   |    4.56   |       |\n|   300 KHz   |    4.50   |  164  |\n|   350 KHz   |    4.47   |       |\n|   400 KHz   |    4.45   |  164  |  max advised\n|   450 KHz   |    4.43   |       |\n|   500 KHz   |    4.42   |  163  |\n|   550 KHz   |    ----   |       |  fail \n\n\nAt 10% load the SHT85 can be used to make about 10 - 15 SPS.\n\n\n### Multiple SHT85\n\nThe SHT3x comes with two I2C address options, 0x44 and 0x45.\nThe SHT85 only has 0x44 as I2C address, so it is not possible to have more than\none on a single I2C bus. \nThis means you need to use multiple I2C buses (if your board support this), \na software I2C (below) or an I2C multiplexer e.g. https://github.com/RobTillaart/TCA9548\n\n\n### I2C multiplexing\n\nSometimes you need to control more devices than possible with the default\naddress range the device provides.\nThis is possible with an I2C multiplexer e.g. TCA9548 which creates up\nto eight channels (think of it as I2C subnets) which can use the complete\naddress range of the device.\n\nDrawback of using a multiplexer is that it takes more administration in\nyour code e.g. which device is on which channel.\nThis will slow down the access, which must be taken into account when\ndeciding which devices are on which channel.\nAlso note that switching between channels will slow down other devices\ntoo if they are behind the multiplexer.\n\n- https://github.com/RobTillaart/TCA9548\n\n\n### Related\n\nSHT series temperature sensors\n\n- https://github.com/RobTillaart/SHT2x\n- https://github.com/RobTillaart/SHT31 Sensirion humidity / temperature sensor\n- https://github.com/RobTillaart/SHT31_SW  = softWire based I2C.\n- https://github.com/RobTillaart/SHT31_SWW = softWire based I2C.\n- https://github.com/RobTillaart/SHT85 Sensirion humidity / temperature sensor\n- https://github.com/RobTillaart/tinySHT2x\n\nOther temperature sensors\n\n- https://github.com/RobTillaart/DHTNew DHT11/22 etc\n- https://github.com/RobTillaart/DHTStable DHT11/22 etc\n- https://github.com/RobTillaart/DHT_Simulator\n- https://github.com/RobTillaart/DS18B20_INT OneWire temperature sensor\n- https://github.com/RobTillaart/DS18B20_RT OneWire temperature sensor\n\nAn elaborated library for the SHT31 sensor can be found here\n- https://github.com/hawesg/SHT31D_Particle_Photon_ClosedCube\n\nOther, including Dewpoint, heatindex, related functions and conversions.\n\n- https://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.html (interesting)\n- https://github.com/RobTillaart/Temperature (conversions, dewPoint, heat index etc.)\n\n\n## Interface\n\n```cpp\n#include \"SHT85.h\"\n```\n\n### Constructor\n\n- **SHT(uint8_t address, TwoWire \\*wire = \u0026Wire)** constructor of the base class. \nNote that **getType()** will return 0.\n- **SHT30(uint8_t address, TwoWire \\*wire = \u0026Wire)** constructor.\nOptional select the address and the I2C bus (Wire, Wire1 etc).\n- **SHT31(uint8_t address, TwoWire \\*wire = \u0026Wire)** constructor. \nOptional select the address and the I2C bus (Wire, Wire1 etc).\n- **SHT35(uint8_t address, TwoWire \\*wire = \u0026Wire)** constructor. \nOptional select the address and the I2C bus (Wire, Wire1 etc).\n- **SHT85(uint8_t address, TwoWire \\*wire = \u0026Wire)** constructor. \nOptional select the address and the I2C bus (Wire, Wire1 etc).\n- **uint8_t getType()** returns numeric part of sensor type.\nReturns 0 for the base class.\n- **bool begin()** Returns false if device address is incorrect or device cannot be reset.\n- **uint8_t getAddress()** returns address set in the constructor.\n\n\n### Status\n\n- **bool isConnected()** checks if address of the sensor is reachable over I2C. Returns false if not connected.\n- **uint16_t readStatus()** returns bit mask, details see **Status fields** below (and datasheet).\n- **bool clearStatus()** clear status register, see **Status fields** below.\n- **uint32_t lastRead()** in milliSeconds since start of program.\n- **bool reset(bool hard = false)** resets the sensor, soft reset by default. Returns false if call fails.\n\n\n### Synchronous read\n\n- **bool read(bool fast = true)** blocks 4 (fast) or 15 (slow) milliseconds + actual read + math.\nReads both the temperature and humidity from the device.\n\nNote: the medium level is not supported (yet).\n\n\n### Asynchronous read\n\nSee async example for usage.\n\n- **bool requestData(bool fast = true)** requests a new measurement. \nReturns false if the request fails.\nRecords the timestamp of the request if successful.\n- **bool dataReady(bool fast = true)** Checks if appropriate time (4 / 15 ms) \nhas past since request to read the data.\nThe parameter **fast** should be the same as in requestData().\n- **bool readData(bool fast = true)** fast = true skips the CRC check. \nReturns false if reading the data fails or if CRC check failed.\n- **uint32_t getLastRequest()** returns timestamp of last successful call to requestData.\nThis function is used to check if the request is too long ago.\n\n\n### Temperature and humidity\n\nNote that the temperature and humidity values are recalculated on every call to **getHumidity()** and **getTemperature()**. \nIf you're worried about the extra cycles, you should make sure to cache these values or only request them after \nyou've performed a new **read()**.\n\n- **float getHumidity()** computes the relative humidity in % based on the latest raw reading. This includes the optional offset.\n- **float getTemperature()** computes the temperature in �C based on the latest raw reading. This includes the optional offset.\n- **float getFahrenheit()** computes the temperature in �F based on the latest raw reading, and returns it.\nNote that the optional offset is set in �Celsius.\n\n\nThe **getRawHumidity()** and **getRawTemperature()** can be used to minimize storage or communication as the data type is 50% smaller.\nAnother application is faster comparison with a previous value or threshold.\nHowever comparisons are quite fast.\n\n- **uint16_t getRawHumidity()** returns the raw two-byte representation of humidity directly from the sensor.\n- **uint16_t getRawTemperature()** returns the raw two-byte representation of temperature directly from the sensor.\n\nThe library has no **CelsiusToRaw()** function although this is relative easy.\n\n```cpp\nrawTemperatureC = (tempC + 45) * (65535 / 175.0); \nrawTemperatureF = (tempF + 49) * (65535 / 315.0); \nrawHumidity     = humidity * 655.35;\n```\n\n\n### Temperature and humidity offset\n\nDefault the offset is zero for both temperature and humidity.\nThese functions allows one to adjust them a little.  \nNote: there is no limit to the offset so one can use huge values. \nThis allows to use an offset of 273.15 effectively creating degrees **Kelvin** instead of **Celsius**.\n\nNote: the offset is defined in degrees Celsius.\nTo set an offset in degrees Fahrenheit, multiply the Fahrenheit offset with 0.55555556 to get Celsius steps (divide by 1.8 is slower).\nSo an offset of 4 �F becomes 2.2222 �C.\n\nNote: the offset for humidity may cause boundary issues (below 0 and above 100)\n\n- **void setTemperatureOffset(float offset = 0)** set the offset in �C, default is zero removing the offset. \nThe library converts this internally\n- **float getTemperatureOffset()** returns the set offset in �C.\n- **void setHumidityOffset(float offset = 0)** set the offset, default is zero removing the offset.\n- **float getHumidityOffset()** returns the set offset.\n\n\n### Error interface\n\n- **int getError()** returns last set error flag and clear it. \nBe sure to clear the error flag by calling **getError()** before calling \nany command as the error flag could be from a previous command.\n\n|  Error  |  Symbolic                   |  Description                   |\n|:-------:|:----------------------------|:-------------------------------|\n|  0x00   |  SHT_OK                     |  no error                      |\n|  0x81   |  SHT_ERR_WRITECMD           |  I2C write failed              |\n|  0x82   |  SHT_ERR_READBYTES          |  I2C read failed               |\n|  0x83   |  SHT_ERR_HEATER_OFF         |  Could not switch off heater   |\n|  0x84   |  SHT_ERR_NOT_CONNECT        |  Could not connect             |\n|  0x85   |  SHT_ERR_CRC_TEMP           |  CRC error in temperature      |\n|  0x86   |  SHT_ERR_CRC_HUM            |  CRC error in humidity         |\n|  0x87   |  SHT_ERR_CRC_STATUS         |  CRC error in status field     |\n|  0x88   |  SHT_ERR_HEATER_COOLDOWN    |  Heater need to cool down      |\n|  0x89   |  SHT_ERR_HEATER_ON          |  Could not switch on heater    |\n|  0x8A   |  SHT_ERR_SERIAL_NUMBER_CRC  |  Could not read serial number  |\n\n\n### Heater interface\n\n**WARNING:** Do not use heater for long periods. \n\nUse the heater for max **180** seconds, and let it cool down **180** seconds = 3 minutes. \nVersion 0.3.3 and up guards the cool down time by preventing switching the heater on \nwithin **180** seconds of the last switch off. Note: this guarding is not reboot persistent. \n\n**WARNING:** The user is responsible to switch the heater off manually!\n\nThe class does **NOT** do this automatically.\nSwitch off the heater by explicitly calling **heatOff()** or indirectly by calling **isHeaterOn()**.\n\n- **void setHeatTimeout(uint8_t seconds)** Set the time out of the heat cycle.\nThis value is truncated to max 180 seconds. \n- **uint8_t getHeatTimeout()** returns the value set.\n- **bool heatOn()** switches the heat cycle on if not already on.\nReturns false if the call fails, setting error to **SHT_ERR_HEATER_COOLDOWN** \nor to **SHT_ERR_HEATER_ON**. \n- **bool heatOff()** switches the heat cycle off. \nReturns false if fails, setting error to **SHT_ERR_HEATER_OFF**.\n- **bool isHeaterOn()** is the sensor still in a heating cycle? Replaces **heatUp()**.\nWill switch the heater off if maximum heating time has passed.\n\n\n## Status fields\n\n|  BIT  |  Description                 |  value  |  notes  |\n|:------|:-----------------------------|:--------|:--------|\n|  15   |  Alert pending status        |  0      | no pending alerts\n|       |                              |  1      | at least one pending alert - default\n|  14   |  Reserved                    |  0      |\n|  13   |  Heater status               |  0      | Heater OFF - default\n|       |                              |  1      | Heater ON \n|  12   |  Reserved                    |  0      |\n|  11   |  Humidity tracking alert     |  0      | no alert - default\n|       |                              |  1      | alert\n|  10   |  Temperature tracking alert  |  0      | no alert - default\n|       |                              |  1      | alert\n|  9-5  |  Reserved                    |  00000  | reserved\n|   4   |  System reset detected       |  0      | no reset since last �clear status register� command\n|       |                              |  1      | reset detected (hard or soft reset command or supply fail) - default\n|  3-2  |  Reserved                    |  00     |\n|   1   |  Command status              |  0      | last command executed successfully\n|       |                              |  1      | last command not processed. Invalid or failed checksum\n|   0   |  Write data checksum status  |  0      | checksum of last write correct\n|       |                              |  1      | checksum of last write transfer failed\n\n**bool clearStatus()** clears 15, 11, 10 and 4.\n\n\n### GetSerialNumber\n\n- **bool getSerialNumber(uint32_t \u0026serial, bool fast = true)** fast == true, =\u003e no CRC check\nfast == false, =\u003e do CRC check. \nThis command seems to be timing sensitive, it uses a delay of 500us\nwhich may need \"tuning\". So function is bit experimental.\n\n## Test\n\nLibrary tested with UNO R3, ESP32 and UNO R4 (#32).\n\n(elaborate)\n\n## Future\n\n#### Must\n\n- improve documentation.\n- reorder interface\n\n#### Should\n\n- more testing (including heater)\n- verify working with ESP32\n- support for medium level read.\n  - 3 levels instead of 2.\n\n#### Could\n\n- remember the fast parameter of **requestData()** so it\n  can become obsolete for **radaReady()**.\n- investigate command ART (auto sampling at 4 Hz)\n- investigate command BREAK (stop auto sampling)\n- test SHT30/35\n- remove SHT85_LIB_VERSION (0.7.0)\n\n\n#### Won't\n\n- rename the library? to SHT ? or sensirion.h ?\n  - not on short term\n- create a SHT85 simulator \n  - I2C slave sketch with e.g. a DHT22 sensor/\n  - not within this library.\n- software I2C experiments \n  - see https://github.com/RobTillaart/SHT31_SW\n- merge with other SHT sensors if possible?\n  - derived classes fixes this enough.\n- **getKelvin()** wrapper? (no =\u003e check temperature class)\n  ==\u003e set Offset to 273.15 !\n\n\n## Support\n\nIf you appreciate my libraries, you can support the development and maintenance.\nImprove the quality of the libraries by providing issues and Pull Requests, or\ndonate through PayPal or GitHub sponsors.\n\nThank you,\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobtillaart%2Fsht85","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobtillaart%2Fsht85","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobtillaart%2Fsht85/lists"}