Project in progress
Water Detection

Water Detection © CC BY

If it detects water, the circuit gives an audible alarm.

  • 661 views
  • 0 comments
  • 3 respects

Components and supplies

Apps and online services

About this project

This is a very basic project that connects an digital moisture sensor to an Arduino/Genuino 101 board.

The pupils started a new project. This is one of his fragments.

Code

Water detectorC Header File
int digitaInput = 6;
int speaker =5;
// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  pinMode(digitaInput, INPUT);
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(speaker, OUTPUT);
  
}

// the loop routine runs over and over again forever:
void loop() {
  
  while(digitalRead(digitaInput)==HIGH)
   {
    digitalWrite(LED_BUILTIN, HIGH);
     
    Serial.println("Dry");
   }
   while(digitalRead(digitaInput)==LOW)
   {
    digitalWrite(LED_BUILTIN, LOW);
     digitalWrite(speaker, HIGH); 
     delay(1);
     digitalWrite(speaker, LOW); 
     delay(1);
    Serial.println("Wet");
    }
   
  delay(1000);
}

Schematics

connecting
It is used Soil Hygrometer Humidity Detection Module Moisture Sensor For Arduino
Connecting geoltfrfof

Comments

Similar projects you might like

How To Use DS18B20 Water Proof Temperature Sensor

Project showcase by Team IoTBoys

  • 47,678 views
  • 12 comments
  • 17 respects

Easy IOT Water Leakage Indicator

Project tutorial by Patel Darshil

  • 9,186 views
  • 2 comments
  • 13 respects

Smoke Detection using MQ-2 Gas Sensor

by Aritro Mukherjee

  • 240,780 views
  • 44 comments
  • 155 respects

Basic Water Sensor

Project showcase by Ömer Beden

  • 16,888 views
  • 1 comment
  • 6 respects

Simple Water Quality Analysis

Project showcase by Wen-Liang Lin

  • 11,993 views
  • 6 comments
  • 16 respects

Coolest Motion Detection Sensor Ever

by remnis

  • 8,992 views
  • 2 comments
  • 9 respects
Add projectSign up / Login