Skip to content

Commit 1cf039e

Browse files
committed
0.4.2 SHT85
1 parent 90da998 commit 1cf039e

File tree

9 files changed

+173
-78
lines changed

9 files changed

+173
-78
lines changed

libraries/SHT85/CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.4.2] - 2023-09-05
10+
- fix #19 SHT85 cannot be address 0x45
11+
- rewrote begin()
12+
- removed example SHT85_duo
13+
- add example SHT85_multiplex
14+
- add section about multiple SHT85 to readme.md
15+
- redo badges in readme.md
16+
- minor edits
17+
18+
919
## [0.4.1] - 2022-05-09
1020
- add **uint32_t getSerialNumber()** for SHT85 (no CRC check).
1121
- improve error handling.
1222
- update readme.md
1323

14-
1524
## [0.4.0] - 2022-12-14
1625
- redo asynchronous interface
1726
- add **uint32_t getLastRequest()** timestamp.

libraries/SHT85/README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11

2-
[![Arduino CI](https://github.com/robtillaart/SHT85/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
2+
[![Arduino CI](https://github.com/RobTillaart/SHT85/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
33
[![Arduino-lint](https://github.com/RobTillaart/SHT85/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/SHT85/actions/workflows/arduino-lint.yml)
44
[![JSON check](https://github.com/RobTillaart/SHT85/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/SHT85/actions/workflows/jsoncheck.yml)
5+
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/SHT85.svg)](https://github.com/RobTillaart/SHT85/issues)
6+
57
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/SHT85/blob/master/LICENSE)
68
[![GitHub release](https://img.shields.io/github/release/RobTillaart/SHT85.svg?maxAge=3600)](https://github.com/RobTillaart/SHT85/releases)
9+
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/SHT85.svg)](https://registry.platformio.org/libraries/robtillaart/SHT85)
710

811

912
# SHT85
@@ -34,7 +37,7 @@ Always check datasheet before connecting!
3437
```
3538

3639

37-
The SHT85 sensors should work up to 1000 KHz.
40+
The SHT85 sensors should work (I2C) up to 1000 KHz.
3841
During tests with an Arduino UNO it stopped between 500 - 550 KHz.
3942
So to be safe I recommend not to use the sensor above 400 KHz.
4043
Also the differences in read time becomes quite small. (max 15% gain).
@@ -58,13 +61,13 @@ SPS (= samples per second) are added later.
5861
| 550 KHz | ---- | | fail
5962

6063

61-
At 10% load the SHT85 can be used to make about 10-15 SPS.
64+
At 10% load the SHT85 can be used to make about 10 - 15 SPS.
6265

6366

6467
#### Compatibility
6568

6669
The SHT85 is protocol compatible with the SHT3x series.
67-
Main difference is the accuracy.
70+
Main difference is the accuracy and the SHT85 only has address 0x44.
6871
Compare the data sheets to see all differences.
6972

7073
Accuracy table:
@@ -81,6 +84,16 @@ Note: The SHT40, SHT41 and SHT45 are not protocol compatible with SHT3x and SHT8
8184
The SHT4x series is slightly faster than the SHT3x series.
8285

8386

87+
#### Multiple SHT85
88+
89+
The SHT3x comes with two I2C address options, 0x44 and 0x45.
90+
The SHT85 only has 0x44 as I2C address, so it is not possible to have more than
91+
one on a single I2C bus.
92+
This means you need to use multiple I2C buses (if your board support this),
93+
a software I2C (below) or an I2C multiplexer e.g. https://github.com/RobTillaart/TCA9548
94+
95+
96+
8497
#### Related libraries
8598

8699
- https://github.com/RobTillaart/SHT2x
@@ -94,6 +107,9 @@ An elaborated library for the SHT31 sensor can be found here
94107
Dewpoint, heatindex, related functions and conversions.
95108
- https://github.com/RobTillaart/Temperature
96109

110+
I2C multiplexer
111+
- https://github.com/RobTillaart/TCA9548
112+
97113

98114
## Interface
99115

@@ -313,3 +329,12 @@ Will switch the heater off if maximum heating time has passed.
313329
- **getKelvin()** wrapper? (no => check temperature class)
314330
==> set Offset to 273.15 !
315331

332+
333+
## Support
334+
335+
If you appreciate my libraries, you can support the development and maintenance.
336+
Improve the quality of the libraries by providing issues and Pull Requests, or
337+
donate through PayPal or GitHub sponsors.
338+
339+
Thank you,
340+

libraries/SHT85/SHT85.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: SHT85.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.4.1
4+
// VERSION: 0.4.2
55
// DATE: 2021-02-10
66
// PURPOSE: Arduino library for the SHT85 temperature and humidity sensor
77
// https://nl.rs-online.com/web/p/temperature-humidity-sensor-ics/1826530
@@ -484,6 +484,21 @@ SHT85::SHT85()
484484
_type = 85;
485485
}
486486

487+
#if defined(ESP8266) || defined(ESP32)
488+
bool SHT85::begin(const uint8_t address, uint8_t dataPin, uint8_t clockPin)
489+
{
490+
if (address != 0x44) return false;
491+
return SHT::begin(SHT_DEFAULT_ADDRESS, dataPin, clockPin);
492+
}
493+
#endif
494+
495+
496+
bool SHT85::begin(const uint8_t address, TwoWire *wire)
497+
{
498+
if (address != 0x44) return false;
499+
return SHT::begin(address, wire);
500+
}
501+
487502

488503
uint32_t SHT85::GetSerialNumber()
489504
{

libraries/SHT85/SHT85.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: SHT85.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.4.1
5+
// VERSION: 0.4.2
66
// DATE: 2021-02-10
77
// PURPOSE: Arduino library for the SHT85 temperature and humidity sensor
88
// https://nl.rs-online.com/web/p/temperature-humidity-sensor-ics/1826530
@@ -25,7 +25,7 @@
2525
#include "Wire.h"
2626

2727

28-
#define SHT_LIB_VERSION (F("0.4.1"))
28+
#define SHT_LIB_VERSION (F("0.4.2"))
2929
#define SHT85_LIB_VERSION SHT_LIB_VERSION
3030

3131
#ifndef SHT_DEFAULT_ADDRESS
@@ -184,6 +184,13 @@ class SHT85 : public SHT
184184
{
185185
public:
186186
SHT85();
187+
188+
// catch incorrect calls with an address, only 0x44 allowed, see #19
189+
#if defined(ESP8266) || defined(ESP32)
190+
bool begin(const uint8_t address, uint8_t dataPin, uint8_t clockPin);
191+
#endif
192+
bool begin(const uint8_t address, TwoWire *wire = &Wire);
193+
187194
// EXPERIMENTAL for 0.4.1
188195
uint32_t GetSerialNumber();
189196
};

libraries/SHT85/examples/SHT85_duo/SHT85_duo.ino

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
platforms:
2+
rpipico:
3+
board: rp2040:rp2040:rpipico
4+
package: rp2040:rp2040
5+
gcc:
6+
features:
7+
defines:
8+
- ARDUINO_ARCH_RP2040
9+
warnings:
10+
flags:
11+
12+
packages:
13+
rp2040:rp2040:
14+
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
15+
16+
compile:
17+
# Choosing to run compilation tests on 2 different Arduino platforms
18+
platforms:
19+
- uno
20+
# - due
21+
# - zero
22+
# - leonardo
23+
- m4
24+
- esp32
25+
- esp8266
26+
# - mega2560
27+
- rpipico
28+
libraries:
29+
- TCA9548
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
//
2+
// FILE: SHT85_multiplex.ino
3+
// AUTHOR: Rob Tillaart
4+
// PURPOSE: demo
5+
// URL: https://github.com/RobTillaart/SHT85
6+
//
7+
// TOPVIEW SHT85 (check datasheet)
8+
// +-------+
9+
// +-----\ | SDA 4 -----
10+
// | +-+ ----+ GND 3 -----
11+
// | +-+ ----+ +5V 2 -----
12+
// +-----/ | SCL 1 -----
13+
// +-------+
14+
15+
// TODO: test with hardware
16+
17+
#include "SHT85.h"
18+
#include "TCA9548.h"
19+
20+
TCA9548 MP(0x70);
21+
#define SHT85_ADDRESS 0x44
22+
23+
SHT85 sht; // the object is reused in the multiplexing.
24+
25+
void setup()
26+
{
27+
Serial.begin(115200);
28+
Serial.println(__FILE__);
29+
Serial.print("TCA9548_LIB_VERSION: \t");
30+
Serial.println(TCA9548_LIB_VERSION);
31+
Serial.print("SHT_LIB_VERSION: \t");
32+
Serial.println(SHT_LIB_VERSION);
33+
34+
Wire.begin();
35+
Wire.setClock(100000);
36+
37+
if (MP.begin() == false)
38+
{
39+
Serial.println("Error: Could not connect to the multiplexer.");
40+
while (1);
41+
}
42+
43+
// initialize 4 SHT85's
44+
for (int channel = 0; channel < 4; channel++)
45+
{
46+
Serial.print(channel);
47+
MP.selectChannel(channel); // rotate over all SHT85's
48+
if (sht.begin(0x44) == false)
49+
{
50+
Serial.println("\tconnect error.");;
51+
}
52+
else
53+
{
54+
Serial.println("\tOK!.");;
55+
}
56+
delay(10);
57+
}
58+
59+
Serial.println();
60+
}
61+
62+
63+
void loop()
64+
{
65+
Serial.print(millis());
66+
Serial.print("\t");
67+
for (int channel = 0; channel < 4; channel++)
68+
{
69+
sht.read(); // default = true/fast slow = false
70+
Serial.print(sht.getTemperature(), 1);
71+
Serial.print("\t");
72+
Serial.print(sht.getHumidity(), 1);
73+
delay(100);
74+
}
75+
}
76+
77+
78+
// -- END OF FILE --

libraries/SHT85/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/SHT85"
1717
},
18-
"version": "0.4.1",
18+
"version": "0.4.2",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*",

libraries/SHT85/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SHT85
2-
version=0.4.1
2+
version=0.4.2
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino library for the SHT85, SHT30, SHT31, SHT35 Senserion temperature and humidity sensors and compatibles.

0 commit comments

Comments
 (0)