mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Add Support for AHT30 Temperature and Humidity Sensor (#19922)
* Update xsns_63_aht1x.ino Support for AHT30 added. Fixed command for loading factory calibrated data and reset command, added needed delay after read command and increased measurement period to reduce heating of sensor. * Update xsns_63_aht1x.ino * Update xsns_63_aht1x.ino The reset command is aligned with the AHT10/20/30 datasheet. * Update ru_RU.h Translated Dew Point to russian Точка росы for sensors * Delete tasmota/language/ru_RU.h Will go to separate PR * Add files via upload * Update ru_RU.h Partial translation update * Add files via upload
This commit is contained in:
parent
852ce100db
commit
ecf7d444c6
@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef USE_I2C
|
#ifdef USE_I2C
|
||||||
#if defined(USE_AHT1x) || defined(USE_AHT2x)
|
#if defined(USE_AHT1x) || defined(USE_AHT2x) || defined(USE_AHT3x)
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* AHT10/15/20 - Temperature and Humidity
|
* AHT10/15/20 - Temperature and Humidity
|
||||||
@ -40,7 +40,10 @@
|
|||||||
* and allows other I2C Devices on the bus but have only one I2C Address (0x38)
|
* and allows other I2C Devices on the bus but have only one I2C Address (0x38)
|
||||||
* 14.09.2021 support AHT20 without enabling AHT1x
|
* 14.09.2021 support AHT20 without enabling AHT1x
|
||||||
*
|
*
|
||||||
|
* 26.10.2023 support for AHT30 added.
|
||||||
|
*
|
||||||
* AHT20 I2C Address: 0x38
|
* AHT20 I2C Address: 0x38
|
||||||
|
* AHT30 I2C Address: 0x38
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
|
||||||
#define XSNS_63 63
|
#define XSNS_63 63
|
||||||
@ -56,12 +59,15 @@
|
|||||||
#define AHT_TEMPERATURE_OFFSET 50
|
#define AHT_TEMPERATURE_OFFSET 50
|
||||||
#define KILOBYTE_CONST 1048576.0f
|
#define KILOBYTE_CONST 1048576.0f
|
||||||
|
|
||||||
#define AHT1X_CMD_DELAY 40
|
#define AHT1X_CMD_DELAY 20
|
||||||
#define AHT1X_RST_DELAY 30
|
#define AHT1X_RST_DELAY 10
|
||||||
#define AHT1X_MEAS_DELAY 80 // over 75ms in datasheet
|
#define AHT1X_MEAS_DELAY 80 // over 75ms in datasheet
|
||||||
|
|
||||||
#ifdef USE_AHT2x
|
#ifdef USE_AHT3x
|
||||||
#define AHTX_CMD 0xB1 // Cmd for AHT2x
|
#define AHTX_CMD 0xBE // Cmd for AHT3x
|
||||||
|
const char ahtTypes[] PROGMEM = "AHT3X|AHT3X";
|
||||||
|
#elif defined(USE_AHT2x)
|
||||||
|
#define AHTX_CMD 0xBE // Cmd for AHT2x
|
||||||
const char ahtTypes[] PROGMEM = "AHT2X|AHT2X";
|
const char ahtTypes[] PROGMEM = "AHT2X|AHT2X";
|
||||||
#else
|
#else
|
||||||
#define AHTX_CMD 0xE1 // Cmd for AHT1x
|
#define AHTX_CMD 0xE1 // Cmd for AHT1x
|
||||||
@ -92,6 +98,7 @@ bool AHT1XWrite(uint8_t aht1x_idx) {
|
|||||||
Wire.write(AHTMeasureCmd, 3);
|
Wire.write(AHTMeasureCmd, 3);
|
||||||
if (Wire.endTransmission() != 0)
|
if (Wire.endTransmission() != 0)
|
||||||
return false;
|
return false;
|
||||||
|
delay(AHT1X_MEAS_DELAY);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +205,7 @@ bool Xsns63(uint32_t function)
|
|||||||
}
|
}
|
||||||
else if (aht1x.count) {
|
else if (aht1x.count) {
|
||||||
switch (function) {
|
switch (function) {
|
||||||
case FUNC_EVERY_100_MSECOND:
|
case FUNC_EVERY_SECOND:
|
||||||
AHT1XPoll();
|
AHT1XPoll();
|
||||||
break;
|
break;
|
||||||
case FUNC_JSON_APPEND:
|
case FUNC_JSON_APPEND:
|
||||||
@ -215,4 +222,4 @@ bool Xsns63(uint32_t function)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_AHT1X
|
#endif // USE_AHT1X
|
||||||
#endif // USE_I2C
|
#endif // USE_I2C
|
||||||
|
Loading…
x
Reference in New Issue
Block a user