Skip to content

Soil Moisture

Josh Perriman edited this page Aug 22, 2018 · 1 revision

Overview

Used to take a reading from the soil moisture sensor. On the By default the Drive pin is on D10 and the sense pin is on A4. For an example of how to use all the functions in this library see the example included with the library.

init_AC

void init_AC(uint8_t outPin);

Setup the timers and comparators used in the soil moisture reading

Args
  • outPin = The pin that is used as the drive pin for the moisture sensor (Pin 10 on the micronode)

takeSoilReading

uint32_t takeSoilReading(uint16_t counts);

Used to actually take a sensor reading. Will return the average time to charge or discharge the capacitor.

Args
  • counts = The amount of charges/discharges to take to generate an average time per charge.

disableAC

void disableAC();

Used to disable the timers and analog comparator used for this sensor. This will save power. To take another reading init_AC will need to be called first.

Clone this wiki locally