This project aims to design and implement a smart water trough that automatically controls its water level, monitorizes use by animals and send alerts depending on environmental conditions.
The system uses an ESP32 microcontroller with an ultrasonic distance sensor to track the water level inside the trough’s reservoir, ensuring that animals always have access to a safe and reliable drinking point, and a motion detection PIR sensor, which will be used to detect animal activity. When the measured level drops below the minimum threshold, aa alarm notification is automatically sent to the system manager through MQTT. Additionally, animal presence will be monitorized and activity levels (none, low, medium, high) recorded.
To make the system more adaptive, temperature forecasts obtained from a web service help determine the recommended minimum level for the next day: if high temperatures are expected, the system requires a higher water reserve to compensate for increased consumption and evaporation.
All collected data will be recorded, allowing students to analyze how environmental factors influence water demand in wildlife habitats. From a sustainability perspective, the project promotes responsible resource use by identifying low-water conditions before they become critical, reducing unnecessary maintenance trips and preventing waste. This predictive and automated monitoring approach supports ecological management practices and reinforces the importance of protecting wildlife through efficient and sustainable technological solutions.
The Raspberry Pi acts as the main controller and MQTT broker. It reads the water level, obtains weather data, calculates thresholds, and sends IoT alerts. The ESP32 will be placed in the field as a remote node with the connected sensors.
The system working architecture is the following:
1. Measure the tank level.
2. Calculate the fill percentage.
3. Obtain the maximum temperature for tomorrow from an online application.
4. Adjust the minimum recommended threshold.
5. Publish data to the MQTT panel.
6. Send an alert if thresholds are exceeded.
7. Detect animals and record their activity.
