Skip to main content

Class Capacitive

Capacitive Soil Moisture Sensor

Assembly: Capacitive.dll
View Source
public class Capacitive : SamplingSensorBase<double>, IObservable<IChangeResult<double>>, IMoistureSensor, ISamplingSensor<double>, ISensor<double>, ISensor, ISamplingSensor, IDisposable

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<UNIT> -> Meadow.Foundation.SamplingSensorBase<UNIT>

Implements:
System.IObservable<Meadow.IChangeResult<System.Double>>, Meadow.Peripherals.Sensors.Moisture.IMoistureSensor, Meadow.Peripherals.Sensors.ISamplingSensor<System.Double>, Meadow.Peripherals.Sensors.ISensor<System.Double>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, System.IDisposable

Properties

AnalogInputPort

Returns the analog input port

View Source
protected IAnalogInputPort AnalogInputPort { get; }

Moisture

Last value read from the moisture sensor

View Source
public double? Moisture { get; protected set; }

MinimumVoltageCalibration

Voltage value of most dry soil - default is 0 volts

View Source
public Voltage MinimumVoltageCalibration { get; set; }

MaximumVoltageCalibration

Voltage value of most moist soil - default of 3.3V

View Source
public Voltage MaximumVoltageCalibration { get; set; }

IsDisposed

Is the object disposed

View Source
public bool IsDisposed { get; }

Methods

ReadSensor()

Reads data from the sensor

View Source
protected override Task<double> ReadSensor()
Returns

System.Threading.Tasks.Task<System.Double>: The latest sensor reading### StartUpdating(TimeSpan?) Starts continuously sampling the sensor

View Source
public override void StartUpdating(TimeSpan? updateInterval)
Parameters
TypeName
System.Nullable<System.TimeSpan>updateInterval

StopUpdating()

Stops sampling the sensor

View Source
public override void StopUpdating()

VoltageToMoisture(Voltage)

Converts voltage to moisture value, ranging from 0 (most dry) to 1 (most wet)

View Source
protected double VoltageToMoisture(Voltage voltage)
Returns

System.Double

Parameters
TypeName
Meadow.Units.Voltagevoltage

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
public void Dispose()

Dispose(bool)

Dispose of the object

View Source
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Implements

  • System.IObservable<Meadow.IChangeResult<System.Double>>
  • Meadow.Peripherals.Sensors.Moisture.IMoistureSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<System.Double>
  • Meadow.Peripherals.Sensors.ISensor<System.Double>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • System.IDisposable