Connect a water sensor

This water sensor is fairly easy to connect this to your Arduino, the requirements are simply VCC (5v), GND and then connect the SIG to one of the Analog pins. In our code example this will be Analog 0.

 

water sensor

Code
[c]
int analogPin = 0;
int led = 13;
int val = 0;

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

void loop()
{
val = analogRead(analogPin);
if (val > 600)
{
digitalWrite(led, HIGH);
}
else
{
digitalWrite(led, LOW);
}
Serial.println(val);
delay (100);
}
[/c]
Links

 

arduino water sensor at Amazon Uk

arduino water sensor at Amazon US

Related posts

Arduino Uno and PCT2075 temperature sensor

Arduino Uno and AHT20 Integrated temperature and humidity Sensor

Arduino Uno and LTR390 UV Light Sensor

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More