AquaRust
An autonomous fish feeder that dispenses food on a programmed schedule, monitors aquarium water conditions in real time, and can be triggered remotely from your phone over Wi-Fi.
Author: Niță Iulia-Ștefania
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-nitaiulia1905-png
Description
This project focuses on building an automated fish feeding and environmental monitoring system using the Rust programming language for high reliability. The system uses an STM32 microcontroller for precise hardware control and an ESP8266 module for Wi-Fi connectivity. It is designed to dispense food at scheduled intervals using a servo motor while simultaneously monitoring water temperature and water level to ensure a safe environment for the fish. The device displays live sensor data on a small TFT screen and allows the user to trigger an instant feeding remotely from their phone, offering a simple and hands-free way to care for aquatic life.
Motivation
The motivation is my desire to create a more sustainable way to manage home ecosystems. Traditional fish care often involves low-quality electronics that eventually end up in a landfill, and inconsistent feeding habits that negatively affect water quality. By using a regulated battery power supply and high-durability components, I am building a device designed for longevity. Furthermore, by using a real-time clock to enforce precise feeding schedules and sensors to continuously monitor water temperature and level, I am reducing the risk of overfeeding and organic waste buildup in the water. This helps maintain a cleaner tank environment and reduces the frequency of water changes, ultimately saving water and resources. Beyond the environmental aspect, this project also represents a personal challenge to work with embedded systems and the Rust programming language.
Architecture
The microcontroller unit, built around the STM32 NUCLEO-U545RE-Q, serves as the central brain of the device. It runs all firmware logic using asynchronous embedded Rust via the Embassy framework, coordinating every peripheral and task concurrently without a traditional operating system. It processes sensor readings, updates the display, enforces feeding schedules, and handles incoming remote commands.
The sensing subsystem consists of the DS18B20 waterproof temperature sensor, the water level sensor, and the infrared obstacle sensor. These components continuously provide the microcontroller with real-time data about the aquarium environment and the state of the food hopper. The DS3231 RTC module complements this subsystem by maintaining precise time tracking, ensuring that scheduled feedings remain accurate even after a power cut or battery swap.
The communication module is built around the ESP8266 ESP-01 Wi-Fi module, which connects the device to the home network and enables remote control from the user's phone. Commands are received over the network and passed to the STM32 through a UART serial connection, allowing the user to trigger an immediate feeding from anywhere within Wi-Fi range.
The actuation system is centered on the SG90 micro servo motor, which physically controls the food hopper gate to dispense portions of fish food. The STM32 drives the servo using a PWM signal, while a dedicated power line with a 1000µF capacitor ensures the motor receives stable current without causing voltage drops that could affect the rest of the circuit.
The power management system supplies the entire device from a 4×AA battery pack, stepped down to a stable 3.3V through a voltage regulator for all logic components. Bypass capacitors on each major component filter noise on the power rail, and a CR2032 coin cell on the DS3231 module keeps the real-time clock running independently whenever the main power supply is disconnected.
Log
Week 8 - 13 April
Most of the components started to arrive, among the STM32 NUCLEO-U545RE-Q. Still waiting on other components.
Week 9 - 20 April
Waiting on the left components to arrive.
Hardware
The primary processing unit responsible for executing the hardware is built around the STM32 NUCLEO-U545RE-Q as the central processing unit, interfacing with all peripherals through its GPIO, SPI, I2C, UART, and PWM pins. The sensing subsystem includes the DS18B20 temperature sensor on a 1-Wire bus, the DS3231 RTC over I2C backed by a CR2032 coin cell, and the infrared and water level sensors on direct GPIO inputs. The ESP8266 ESP-01 module connects to the STM32 over UART for Wi-Fi communication, while the ST7735 TFT display is driven over SPI. The SG90 servo motor is controlled via PWM and powered directly from the battery rail, with a 1000µF capacitor stabilizing its power line during actuation. The entire system is supplied by a 4×AA battery pack stepped down to 3.3V through a voltage regulator, with bypass capacitors on each major component ensuring a clean and stable power rail.
Schematics
Place your KiCAD or similar schematics here in SVG format.
Bill of Materials
| Device | Usage | Price |
|---|---|---|
| STM32 NUCLEO-U545RE-Q | The microcontroller | ~107 RON |
| ESP8266 ESP-01 | Wi-Fi module | ~11 RON |
| Plusivo Adaptor Breadboard for ESP-01 | allows the ESP-01 to be safely seated on the breadboard | 3 RON |
| UART USB ESP-01 | used to flash and test the ESP8266 from a PC | 9 RON |
| DS18B20 Waterproof Temperature Sensor | monitors aquarium water temperature | ~17 RON |
| DS3231 RTC Module | keeps accurate time for scheduled feedings | ~24 RON |
| Infrared Digital Obstacle Sensor | detects if food is still present in the hopper | 20 RON |
| Water Level Sensor | monitors if the water drops below a safe level | 2 RON |
| ST7735 SPI TFT Display | shows live sensor data and system status | 15 RON |
| SG90 9G Micro Servo | physically dispenses food from the hopper | 22 RON |
| 4×AA Batteries & Battery Holder | main power supply for the entire system | 26 RON |
| 3.3V Voltage Regulator Module | steps battery voltage down to safe logic level | 4 RON |
| 10µF Ceramic Capacitors | ensures voltage regulator stability | 1 RON |
| 100nF Ceramic Capacitors | filters noise on power pins of each major component | 1 RON |
| 1000µF 16V Electrolytic Capacitor | stabilizes servo power rail during actuation | 11 RON |
| 4.7kΩ Resistor | mandatory pull-up resistor for the DS18B20 data line | 1 RON |
| CR2032 Coin Cell Battery | m keeps the DS3231 clock running during power cuts | 10 RON |
| Breadboard | main prototyping surface for connecting all components | 13 RON |
| Male-to-Male Jumper Wires | wires for connecting components | 6 RON |
| USB Data Cable | connects the STM32 to a PC for flashing firmware | 0 RON (BORROWED) |
Software
| Library | Description | Usage |
|---|---|---|
| embassy-executor | async task executor | Used to run all concurrent firmware tasks. |
| embassy-time | async timers and delays | Used for polling intervals and servo timing |
| embassy-stm32 | drivers for STM32 peripherals | Used to control GPIO, SPI, I2C, UART, PWM |
| embassy-sync | async synchronization primitives | Used to share state between tasks |
| embassy-futures | async future utilities | sed to combine multiple async operations |
| ds18b20 | DS18B20 temperature sensor driver | Used to read water temperature periodically |
| onewire | 1-Wire protocol implementation | Used to bit-bang DS18B20 communication |
| ds323x | DS3231 RTC driver | Used to read current time for feeding schedule |
| embedded-graphics | 2D embedded graphics library | Used for drawing |
| embedded-hal | standard hardware interface traits | Used by all peripheral drivers |
| embedded-hal-async | async hardware interface traits | Used for non-blocking peripherals |
| defmt | lightweight embedded logging | Used to print debug messages |
| defmt-rtt | RTT log transport | Used to view logs on PC |
| panic-probe | embedded panic handler | Used to report firmware crashes |