Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Based Water Sensor with Wi-Fi Connectivity

View and Edit Project In Cirkit DesignerImage of ESP32-Based Water Sensor with Wi-Fi Connectivity

Circuit Documentation

Summary

This document provides a detailed description of a simple circuit involving an ESP32 microcontroller and a water sensor. The ESP32 is used to read the signal from the water sensor, which detects the presence of water. The circuit is powered by the 3.3V output from the ESP32.

Component List

ESP32

Water Sensor

Wiring Details

ESP32

Water Sensor

Code

There is no code provided for this circuit. However, a typical implementation would involve reading the signal from the water sensor using the ESP32 and processing it accordingly. Below is a sample code snippet that could be used:

// Sample code for reading water sensor signal using ESP32

const int waterSensorPin = 12; // D12 pin of ESP32

void setup() {
  Serial.begin(115200);
  pinMode(waterSensorPin, INPUT);
}

void loop() {
  int sensorValue = digitalRead(waterSensorPin);
  if (sensorValue == HIGH) {
    Serial.println("Water detected!");
  } else {
    Serial.println("No water detected.");
  }
  delay(1000); // Wait for 1 second before reading again
}

This code initializes the D12 pin as an input and continuously reads the signal from the water sensor. If water is detected, it prints "Water detected!" to the serial monitor; otherwise, it prints "No water detected."