Comments on: Water level sensor https://osoyoo.com/2016/06/15/water-sensor/ Project Tutorial for Arduino compatible products Wed, 09 Mar 2022 06:22:48 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: TOSEI https://osoyoo.com/2016/06/15/water-sensor/comment-page-1/#comment-1447 Wed, 06 May 2020 14:44:53 +0000 https://osoyoo.com/?p=1205#comment-1447 TEST OK.

>>HARDWARE :
Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
Breadboard x 1
Water level Sensor x 1
M/M jumpers
USB Cable x 1
PC x 1

>>Pin Definitions :
+ : 3.3V-5V ⇔ UNO 5V
- : The Ground ⇔ UNO GND
S : I/O Interface of Sensor ⇔ UNO PIN A0

>>Mixly source :
volatile int val;

void setup()

{

Serial.begin(9600);

val = 0;

pinMode(13, OUTPUT);

}

void loop()

{

val = analogRead(A0);

if (val > 200) {

digitalWrite(13,HIGH);

} else {

digitalWrite(13,LOW);

}

Serial.print(“Current value is : “);

Serial.print(val);

Serial.println(” “);

delay(100);

}

]]>