Негізгі мазмұнға
Logo

Robotics on transpor ...

    • Қазақша ‎(kk)‎
    • Русский ‎(ru)‎
    • English ‎(en)‎
  • Log in
SYSTEMS.ENU Орау Expand
PLATONUS.ENU DIRECTUM.ENU MAIL.ENU MY.ENU MOODLE.ENU MOOC.ENU
SYSTEMS.ENU Орау Expand
PLATONUS.ENU DIRECTUM.ENU MAIL.ENU MY.ENU MOODLE.ENU MOOC.ENU
  1. Курстар
  2. Дистанционное обучение
  3. Факультеты
  4. Транспортно-энергетический факультет
  5. Кафедра Транспортная инженерия
  6. Robotics on transport (Балабекова К.Г.) 2025-2026 учебный год.
  7. Water Leak Detection System using Arduino
  8. The purpose of the lecture: Creating your own function. The purpose and role of the temperature sensor and piezoelectric element.
  • More

The purpose of the lecture: Creating your own function. The purpose and role of the temperature sensor and piezoelectric element.

Completion requirements

1. Introduction

A water leak sensor is a simple and inexpensive way to detect the presence of water. It’s commonly used in home automation, basements, bathrooms, or industrial systems to prevent flooding or equipment damage.

The module detects water through exposed traces that act as conductors — when water touches them, the resistance decreases, and the sensor outputs a digital HIGH or LOW signal to Arduino.


2. Components Required

  • 1 × Arduino Uno (or any compatible board)

  • 1 × Water leak sensor module (e.g., YL-38 or FC-37)

  • 1 × Buzzer or LED for indication

  • Jumper wires

  • USB cable for programming


3. Wiring Diagram

Sensor PinArduino PinDescription
VCC5 VPower supply
GNDGNDGround
D0 (Signal)D2Digital output

(If your sensor has an analog pin “A0”, you can connect it to Arduino A0 for analog readings.)

Optionally:

  • Connect an LED to pin 13 to indicate water leak.

  • Connect a buzzer to pin 8 for alarm sound.


4. Arduino Code (Digital Output)

// Water Leak Sensor Example Code const int leakPin = 2; // digital input pin for water sensor const int ledPin = 13; // built-in LED for indication const int buzzerPin = 8; // optional buzzer pin void setup() { pinMode(leakPin, INPUT); pinMode(ledPin, OUTPUT); pinMode(buzzerPin, OUTPUT); Serial.begin(9600); Serial.println("Water Leak Detector Initialized"); } void loop() { int sensorState = digitalRead(leakPin); if (sensorState == HIGH) { // leak detected digitalWrite(ledPin, HIGH); digitalWrite(buzzerPin, HIGH); Serial.println("⚠️ Leak detected!"); } else { // no leak digitalWrite(ledPin, LOW); digitalWrite(buzzerPin, LOW); Serial.println("No leak detected."); } delay(500); }

5. How It Works

  • The sensor has exposed copper traces that form an open circuit when dry.

  • When water touches them, it closes the circuit, lowering resistance and allowing current to flow.

  • The signal pin sends HIGH (or sometimes LOW, depending on the module) to the Arduino.

  • Arduino then triggers an LED or buzzer as an alert.


6. Optional: Analog Reading Example

If you want to measure how much water is present, use the analog output instead of the digital one:

const int waterSensorPin = A0; void setup() { Serial.begin(9600); } void loop() { int sensorValue = analogRead(waterSensorPin); Serial.print("Water Level Value: "); Serial.println(sensorValue); delay(500); }

Typical range:

  • 0–300 → dry

  • 300–700 → damp

  • 700–1023 → wet / leak

You can use these values to trigger different alerts.


7. Practical Applications

  • Detecting pipe leaks or tank overflow

  • Basement water detection systems

  • Smart home alarms (using buzzer or Wi-Fi modules)

  • Industrial safety monitoring (around pumps or coolers)


8. References and Tutorials

  • Arduino Water Leak Detector Tutorial

  • Blue Robotics – SOS Leak Sensor with Arduino

  • Arduino Project Hub – Water Leakage Detection System

  • Arduino Water Sensor Tutorial (with diagrams)


This lesson is not ready to be taken.
Data retention summary
Мобильдік қосымшаға өту
Яндекс.Метрика