// Library: Soil Moisture FC-28
// By: Devan Cakra M.W
#include "ESP_FC28.h" // library declaration
#define FC28PIN 20 // fc-28 pin declaration
#define wetSoil 60 // define the minimum value that is considered as 'wet' soil
#define drySoil 40 // define the maximum value that is considered as 'dry' soil
#define cbrValue 7 // define the value of calibration
FC28Sensor fc28(FC28PIN); // create a new object with the name fc28 to hold the FC28Sensor class
void setup() {
Serial.begin(115200); // default baudrate for the ESP board
fc28.begin(); // initiate fc-28 sensor
}
void loop() {
fc28.calibration(cbrValue); // this is used to set the calibration of the FC-28 sensor
fc28.getSoilMoisture(); // calls soil moisture data through the getSoilMoisture method
fc28.limit(wetSoil,drySoil); // minimum limit for wet and maximum limit for dry
fc28.viewData(); // print to serial monitor: soil moisture value & status
delay(3000); // delay for 3 seconds
}
esp:0
esp:1
esp:2
esp:3
esp:4
esp:5
esp:6
esp:7
esp:8
esp:9
esp:10
esp:11
esp:12
esp:13
esp:14
esp:15
esp:16
esp:17
esp:18
esp:19
esp:20
esp:21
esp:35
esp:36
esp:37
esp:38
esp:39
esp:40
esp:41
esp:42
esp:45
esp:46
esp:47
esp:48
esp:3V3.1
esp:3V3.2
esp:RST
esp:5V
esp:GND.1
esp:GND.2
esp:TX
esp:RX
esp:GND.3
esp:GND.4
r1:1
r1:2
pot1:GND
pot1:SIG
pot1:VCC