Skip to main content
Version: FILS English

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.

info

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.

img

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

DeviceUsagePrice
STM32 NUCLEO-U545RE-QThe microcontroller~107 RON
ESP8266 ESP-01Wi-Fi module~11 RON
Plusivo Adaptor Breadboard for ESP-01allows the ESP-01 to be safely seated on the breadboard3 RON
UART USB ESP-01used to flash and test the ESP8266 from a PC9 RON
DS18B20 Waterproof Temperature Sensormonitors aquarium water temperature~17 RON
DS3231 RTC Module keeps accurate time for scheduled feedings~24 RON
Infrared Digital Obstacle Sensordetects if food is still present in the hopper20 RON
Water Level Sensormonitors if the water drops below a safe level2 RON
ST7735 SPI TFT Display shows live sensor data and system status15 RON
SG90 9G Micro Servo physically dispenses food from the hopper22 RON
4×AA Batteries & Battery Holdermain power supply for the entire system26 RON
3.3V Voltage Regulator Module steps battery voltage down to safe logic level4 RON
10µF Ceramic Capacitorsensures voltage regulator stability1 RON
100nF Ceramic Capacitorsfilters noise on power pins of each major component1 RON
1000µF 16V Electrolytic Capacitorstabilizes servo power rail during actuation11 RON
4.7kΩ Resistormandatory pull-up resistor for the DS18B20 data line1 RON
CR2032 Coin Cell Batterym keeps the DS3231 clock running during power cuts10 RON
Breadboardmain prototyping surface for connecting all components13 RON
Male-to-Male Jumper Wireswires for connecting components6 RON
USB Data Cableconnects the STM32 to a PC for flashing firmware0 RON (BORROWED)

Software

LibraryDescriptionUsage
embassy-executorasync task executorUsed to run all concurrent firmware tasks.
embassy-timeasync timers and delaysUsed for polling intervals and servo timing
embassy-stm32drivers for STM32 peripheralsUsed to control GPIO, SPI, I2C, UART, PWM
embassy-syncasync synchronization primitivesUsed to share state between tasks
embassy-futuresasync future utilitiessed to combine multiple async operations
ds18b20DS18B20 temperature sensor driverUsed to read water temperature periodically
onewire1-Wire protocol implementationUsed to bit-bang DS18B20 communication
ds323xDS3231 RTC driverUsed to read current time for feeding schedule
embedded-graphics2D embedded graphics libraryUsed for drawing
embedded-hal standard hardware interface traitsUsed by all peripheral drivers
embedded-hal-async async hardware interface traitsUsed for non-blocking peripherals
defmtlightweight embedded loggingUsed to print debug messages
defmt-rttRTT log transportUsed to view logs on PC
panic-probeembedded panic handlerUsed to report firmware crashes
  1. Reference Manual STSTM32U5
  2. Fish Feeder Machine Architecture Idea
  3. Embassy framework ...