Capacitive Jord Fugtighedsmåler

20,00 kr.

På lager

Varenummer (SKU): 2002001879164 Kategori:

Tekniske detaljer:

Operating Voltage: 3.3 ~ 5.5 VDC
Output Voltage: 0 ~ 3.0VDC
Interface: PH2.0-3P
Dimension: 98mm * 23mm (3.86in x 0.905in)

Kode:

const int dry = 595; // value for dry sensor
const int wet = 239; // value for wet sensor

void setup()
{ 
Serial.begin(9600);
}

void loop()
{
int sensorVal = analogRead(A0);

// Sensor has a range of 239 to 595
// We want to translate this to a scale or 0% to 100%
// More info: https://www.arduino.cc/reference/en/language/functions/math/map/
int percentageHumididy = map(sensorVal, wet, dry, 100, 0);

Serial.print(percentageHumididy);
Serial.println("%");

delay(100);
}

Yderligere information

Vægt 25 g