Skip to main content

Class Capacitive

Capacitive Soil Moisture Sensor

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

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<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​
Declaration
protected IAnalogInputPort AnalogInputPort { get; }

Moisture​

Last value read from the moisture sensor

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

MinimumVoltageCalibration​

Voltage value of most dry soil - default is 0 volts

View Source​
Declaration
public Voltage MinimumVoltageCalibration { get; set; }

MaximumVoltageCalibration​

Voltage value of most moist soil - default of 3.3V

View Source​
Declaration
public Voltage MaximumVoltageCalibration { get; set; }

IsDisposed​

Is the object disposed

View Source​
Declaration
public bool IsDisposed { get; }

Methods​

ReadSensor()​

Reads data from the sensor

View Source​
Declaration
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​
Declaration
public override void StartUpdating(TimeSpan? updateInterval)
Parameters​
TypeName
System.Nullable<System.TimeSpan>updateInterval

StopUpdating()​

Stops sampling the sensor

View Source​
Declaration
public override void StopUpdating()

VoltageToMoisture(Voltage)​

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

View Source​
Declaration
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​
Declaration
public void Dispose()

Dispose(bool)​

Dispose of the object

View Source​
Declaration
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