Skip to content

Commit

Permalink
change to SHT30 with 4 wires from AM2320 for a/wiolog_display_to_mmw
Browse files Browse the repository at this point in the history
  • Loading branch information
neilh20 authored and neilh20 committed Oct 14, 2023
1 parent f374f5e commit 340f07a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
3 changes: 3 additions & 0 deletions a/wio_log_display_mmw/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ lib_samd_deps =
;https://github.com/adafruit/Adafruit-GFX-Library
;https://github.com/adafruit/Adafruit_EPD
;FUT https://github.com/adafruit/Adafruit_NeoPixel
; Can be used on any board except Mayfly1.1 as has similar SHT4x
https://github.com/adafruit/Adafruit_SHT31

lib_featherExpress_deps =
https://github.com/adafruit/Adafruit_NeoPixel
Expand Down Expand Up @@ -178,6 +180,7 @@ cmn_build_flags =
;-DMS_PROCESSORADC_DEBUG
;-DMS_MAXIMDS18_DEBUG
;-DMS_TIINA219M_DEBUG
;-DMS_SENSIRION_SHT3X_DEBUG
;-DMS_AOSONGAM2315_DEBUG
;-DMS_EXTERNALVOLTAGE_DEBUG
;-DMS_EXTERNALVOLTAGE_DEBUG_DEEP
Expand Down
28 changes: 27 additions & 1 deletion a/wio_log_display_mmw/src/log_display_to_MMW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,23 @@ AOSongAM2315 am23xx(I2CPower);
/** End [ao_song_am2315] */
#endif // ASONG_AM23XX_UUID

#if defined(SENSIRION_SHT3X_UUID)
// ==========================================================================
// Sensirion SHT3X Digital Humidity and Temperature Sensor
// Seperate Sensor - incompatible with Mayfly1.1 SHT4X as uses same I2C address
// ==========================================================================
/** Start [sensirion_sht4x] */
#include <sensors/SensirionSHT3x.h>

// NOTE: Use -1 for any pins that don't apply or aren't being used.
const int8_t SHT3xPower = sensorPowerPin; // Power pin
const bool SHT3xUseHeater = false;

// Create an Sensirion SHT4X sensor object
SensirionSHT3x sht3x(SHT3xPower, SHT3xUseHeater);
/** End [sensirion_sht4x] */
#endif // SENSIRION_SHT4X_UUID

#if defined(BAT_VOLTAGE_UUID )
// ==========================================================================
// Wio Terminal Chassis Battery Sensor
Expand Down Expand Up @@ -333,13 +350,21 @@ Variable* variableList[] = {
new AOSongAM2315_Humidity(&am23xx, ASONG_AM23_Air_Humidity_UUID),
new AOSongAM2315_Temp(&am23xx, ASONG_AM23_Air_Temperature_UUID),
// ASONG_AM23_Air_TemperatureF_UUID
#endif // ASONG_AM23XX_UUID

#if defined SENSIRION_SHT3X_UUID
new SensirionSHT3x_Humidity(&sht3x, SENSIRION_SHT3X_Air_Humidity_UUID),
new SensirionSHT3x_Temp(&sht3x, SENSIRION_SHT3X_Air_Temperature_UUID),
// ASONG_AM23_Air_TemperatureF_UUID
#endif // SENSIRION_SHT3X_UUID

#if defined TEMPERATURE_ALL_DS18
new MaximDS18_Temp(&ds18phy_a, TEMPERATURE_A_UUID,"Ds18Ta"),
new MaximDS18_Temp(&ds18phy_b, TEMPERATURE_B_UUID,"Ds18Tb"),
new MaximDS18_Temp(&ds18phy_c, TEMPERATURE_C_UUID,"Ds18Tc"),
new MaximDS18_Temp(&ds18phy_d, TEMPERATURE_D_UUID,"Ds18Td"),
#endif //TEMPERATURE_ALL_DS18
#endif // ASONG_AM23XX_UUID


#if defined(BAT_VOLTAGE_UUID)
chassisBattery_V_variable,
Expand Down Expand Up @@ -549,6 +574,7 @@ void setup() {
enableInterrupt(neoSSerial1Rx, neoSSerial1ISR, CHANGE);
#endif



#if defined USE_DISPLAY
ui_display.begin();
Expand Down
5 changes: 4 additions & 1 deletion a/wio_log_display_mmw/src/ms_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.

//Only define 1 below . SENSIRION_SHT4X is on Mayfly 1.x
//#define SENSIRION_SHT4X_UUID
#define ASONG_AM23XX_UUID 1
// This is seperate and can be used on WIO-TERMINAL - otherwise similar to SHT4X
#define SENSIRION_SHT3X_UUID 1
//#define ASONG_AM23XX_UUID 1


//Two heavy sensors with power useage
#define BM_PWR_SENSOR_CONFIG_BUILD_SPECIFIC BM_PWR_LOW_REQ
Expand Down
4 changes: 4 additions & 0 deletions a/wio_log_display_mmw/src/ms_cfg_uuids.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#define ASONG_AM23_Air_Temperature_UUID "Air_Temperature_UUID"
#define ASONG_AM23_Air_Humidity_UUID "Air_Humidity_UUID"
#endif //ASONG_AM23XX_UUID
#if defined SENSIRION_SHT3X_UUID
#define SENSIRION_SHT3X_Air_Temperature_UUID "Air_Temperature_UUID"
#define SENSIRION_SHT3X_Air_Humidity_UUID "Air_Humidity_UUID"
#endif //

#define TEMPERATURE_ALL_DS18 1
#define TEMPERATURE_A_UUID "DS18A_UUID"
Expand Down

0 comments on commit 340f07a

Please sign in to comment.