Here's a full **walkthrough for building a capacitive water sensor in hardware**, plus some **geometry options** for the sensing element.
---
## 🛠️ **1. Build the LC Resonant Circuit**
### 🧩 Components
| Component | Value / Description |
| -------------------------------- | --------------------------------------------- |
| Capacitor (C) | \~1 pF to \~100 pF (made using sensor plates) |
| Inductor (L) | 1 µH to 10 µH |
| Resistor (R) | 10kΩ (pull-up or damping) |
| Microcontroller | Arduino Uno, Nano, ESP32, etc. |
| Oscilloscope / Frequency Counter | Optional but helpful |
---
## 🧪 **2. Sensor Plate Design (Geometry Options)**
### A. **Parallel Plate Geometry**
* **2 metal plates** on opposite sides of a **non-conductive container** (e.g., glass or plastic tube).
* Water between plates acts as the dielectric.

*(Illustrative only – not a direct link to Falstad)*
### B. **Interdigitated Electrodes (IDE)**
* Two comb-like copper patterns printed on a PCB or etched on foil.
* Effective for detecting moisture or shallow water levels.
* High surface area, better for low water content.
### C. **Coaxial Tube Sensor**
* **Inner wire** inside a **metallic outer pipe or foil**, separated by plastic.
* Water enters the space between → dielectric increases → capacitance increases.
---
## 🧰 **3. Construction Tips**
* Use **copper tape** on the outside of a plastic tube (cheap and easy).
* Connect plates to the LC circuit as the **capacitor**.
* Seal or insulate connections to avoid corrosion.
---
## 🧪 4. **Frequency Detection with Arduino**
You can use a method similar to **pulse counting** or a **resonator detection** setup:
### Simple 555 Oscillator Circuit (to interface with Arduino)
Build a 555 timer oscillator with the water sensor as the timing capacitor. Arduino can count frequency.
```plaintext
555 Timer:
- R1 and R2: Fixed resistors
- C: Water sensor capacitor
- Output to Arduino digital pin
```
Then use this Arduino code:
```cpp
const int inputPin = 2; // From 555 timer
unsigned long freq;
void setup() {
Serial.begin(9600);
pinMode(inputPin, INPUT);
}
void loop() {
freq = pulseIn(inputPin, HIGH);
if (freq > 0) {
float f = 1e6 / (2 * freq);
Serial.print("Frequency: ");
Serial.print(f);
Serial.println(" Hz");
}
delay(500);
}
```
---
## 🧠 Calibration
1. Record resonance frequency **without water** (baseline).
2. Slowly add water and record frequency changes.
3. Create a **lookup table** or linear model in code to estimate water level from frequency.
---
## 📊 Optional Enhancements
* Add a **Bluetooth or WiFi module** (e.g., ESP32) to send readings wirelessly.
* Use a **low-pass filter** and ADC to detect amplitude peaks instead of frequency.
* Integrate a **data logger** (SD card or cloud storage).
---