Sensors
Water level monitoring.
Water level monitoring is critical for hydroponic systems. When the nutrient solution gets too low, plants can't absorb nutrients properly. hydroMazing can automatically trigger a pump to refill your reservoir.
Types of Sensors
- Float Switches: Simple mechanical switches that close when submerged
- Ultrasonic Sensors: HC-SR04 measures distance to liquid surface
- Analog Submersible Probes: Continuous level measurement
Float Switch Wiring
| Red Wire | 5V Power |
| Black Wire | GND |
| Yellow/White Wire | Digital Input (D2-D13) |
Use INPUT_PULLUP mode to avoid floating inputs. The switch closes to GND when the float rises.
Flow Rate
Flow rate monitoring.
// Flow sensor connected to interrupt pin
#define FLOW_PIN 2
volatile unsigned long pulseCount = 0;
// Interrupt service routine
ISR(INT0_vect) {
pulseCount++;
}
// Calculate flow rate (L/min)
float getFlowRate() {
return (pulseCount / 7.5); // 7.5 pulses per liter
}
Flow rate sensors measure the volume of liquid passing through your system per minute. This helps you detect clogs, monitor pump performance, and ensure proper circulation in your hydroponic setup.
Common Sensors
- YF-S201: Universal flow meter (5V, 1.5-10L/min)
- GL-502: Higher flow capacity (0-60L/min)
Calibration
Calibrating your sensors.
Proper calibration ensures accurate readings. Here's how to calibrate your sensors:
Water Level Calibration
- Set the float switch at your "low" threshold
- Record the digital reading in Arduino Serial Monitor
- Set at "high" threshold and record
- Update your threshold values in the code
Flow Rate Calibration
- Collect known volume (e.g., 1 liter) in a container
- Count pulses during collection
- Calculate: pulses per liter = pulseCount / volume
- Update the divisor in
getFlowRate()
Ready to integrate water monitoring?
Full Arduino code, wiring diagrams, and Raspberry Pi integration guides are available in the hydroMazing repository.
View on GitHub →