Soil Moisture Sensor - EARTH

The soil moisture sensor, EARTH UNIT for M5STACK.
It detect moisture level in soil.
It has both analog and digital outputs.

wired(obniz, { aout, dout, vcc, gnd })

connect EARTH UNIT to the obniz Device.

name type required default description
vcc number(obniz Board io) no   power supply
gnd number(obniz Board io) no   power supply
dout number(obniz Board io) no   digital out
aout number(obniz Board io) no   analog out
grove object no   grove property when device has a grove interface
// JavaScript Example
var obniz = new Obniz.M5StickC("OBNIZ_ID_HERE");
obniz.onconnect = async function() {
  var earth = obniz.wired("Grove_EARTH", { grove: obniz.grove0 });
  earth.onchange = (val) => {
    console.log(val)
  }
}

onchange = function(value)

callback function called when the value was changed.

the value indicate analog output voltage.
It will be reduced when getting water.

var obniz = new Obniz.M5StickC("OBNIZ_ID_HERE");
obniz.onconnect = async function() {
  var earth = obniz.wired("Grove_EARTH", { grove: obniz.grove0 });
  earth.onchange = (val) => {
    console.log(val)
  }
}

[await] getAnalogHumidityWait()

Measure and get current analog value once.

the value indicate analog output voltage.
It will be reduced when getting water.

// Javascript Example
var sensor = obnizStick.wired("Grove_EARTH", { grove: obnizStick.grove0 });
var value = await sensor.getAnalogHumidityWait();
console.log('Humidity Level:' + value);

[await] getDigitalHumidityWait()

Measure and get current digital value once.

// Javascript Example
var sensor = obnizStick.wired("Grove_EARTH", { grove: obnizStick.grove0 });
var value = await sensor.getDigitalHumidityWait();
if (value) {
    console.log('Humidity level is toohigh!');
}



You will Get in Few Days

Circuit for Starter “obniz Board” is available on Amazon and other online stores.
You can get it at below

Our products and resellers

Forum

Visit our developer’s forum to discuss and discover technologies.

Forum

Contact

Feel free to contact out support and technical team.

Contact us