Basic Wetness Sensor

So I’ve had the idea for a while to try and automate the growing of plants so I need to be able to tell if something’s wet or not. Here’s a video:

Basically the hookup process is that of a regular analog sensor with this in it’s place. There’s a 10k pullup resistor as the voltage divider.

Here’s the source for the Arduino.

int write1;
int writeval;

void setup(){
 Serial.begin(9600);
 pinMode(3, OUTPUT);
}

void loop(){
 Serial.println(analogRead(0));
 write1 = map(analogRead(0), 0, 1023, 0, 100);
 writeval = map(write1, 0, 100, 0, 1023);
 analogWrite(3, writeval);
 delay(100);
}

That’s pretty complex but I was trying to make the light changes more drastic so it would show up in the video better.

Here are some pictures of the build process:

Thanks for reading!

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.