fine tune moisture readings

This commit is contained in:
Marcus 2024-04-07 02:10:45 +02:00
parent 33d313c68e
commit af0f7715bf

View file

@ -167,6 +167,13 @@ float getHumidity() {
}
int getSoilmoisture(bool moistureSensor) {
/*
* moistureSensor
* ==============
* 0/false : analog capacitive moisture sensor
* 1/true : chirp I2C moisture sensor
*/
// value to return
int soilmoisture;
// value for wet
@ -176,7 +183,7 @@ int getSoilmoisture(bool moistureSensor) {
if(moistureSensor == false ) {
// read analog value from analog moisture sensor
wet = 185;
wet = 180;
dry= 590;
digitalWrite(PINsoilmoisture, HIGH);
@ -188,8 +195,9 @@ int getSoilmoisture(bool moistureSensor) {
digitalWrite(PINsoilmoisture, LOW);
} else {
// read soil moisture from chrip I2C
wet = 580;
wet = 560;
dry= 250;
// get raw value from I2C chirp sensor
soilmoisture = readI2CRegister16bit(0x20, 0);
}
@ -288,7 +296,8 @@ void loop() {
Serial.println(getWaterlevel());
display.print("ASM: ");
display.println(getSoilmoisture(0));
display.print(getSoilmoisture(0));
display.println(", ");
Serial.print("ASM: ");
Serial.println(getSoilmoisture(0));
@ -297,7 +306,7 @@ void loop() {
display.display();
Serial.println("Test");
//delay(1000);
delay(1000);
}