A Monitoring and Control System for Aquariums
Keeping fishes and invertebrates in captivity is always a challenge because so many critical environmental factors need to be carefully controlled. Using ESP32s, CAN Bus, MQTT, and Ethernet, these four Camosun College students developed “Fish Sense,” a modular, expandable method of monitoring conditions in a home aquarium, automatically notifying the aquarium keeper when something goes awry, and even correcting some problems.
Keeping aquatic life alive in an aquarium is an exercise in frustration tolerance—there’s always something going wrong. The challenge is finding the problem in time, and balancing the ecosystem before things begin cascading in the wrong direction. Otherwise, before you know it, you’re stuck with whatever living creatures you’ve managed to save, living out of sight in the aquarium’s sump tank, while you attempt to figure out what to do with 85 gallons of dirty saltwater (Figure 1)—not to mention the hours draining and refilling the tank can take.

Kayleb’s saltwater fish tank after a collapse. He is just getting ready to drain it. Everything salvageable is below in the sump tank, but it’s a grim and heartbreaking scene. Without constant monitoring, it can be a gamble knowing what’s happening inside.
— ADVERTISMENT—
—Advertise Here—
Kayleb has been keeping fish and corals for most of his life, and is aware of the many struggles associated with aquariums, having had to reset his tank multiple times. Saltwater aquariums are far more complex than freshwater systems, especially for growing corals. They can require a secondary “sump” tank (Figure 2) to act as a refugium—somewhere that delicate algae and other organisms that serve as food can reproduce. As filter feeders, corals that are housed in the display tank need a constant current in the water to enable them to feed on the organisms from the sump tank. Also, to truly thrive, corals require lighting and a narrow range of water quality parameters—including temperature, salinity, dissolved oxygen, and pH.

A sump tank is a refugium, somewhere for nutrient providing organixms to thrive and feed the life in the display tank. This is Kayleb’s current sump tank, which also houses the various pumps and other equipment that keep the tank healthy.
Disaster is an opportunist, and water being pumped between tanks provides ample opportunity for it to strike. Although leak- and water-level sensing can alert you to an issue; keeping track of everything and controlling the pumps manually can be both challenging and time consuming. Being tech savvy, Kayleb has automated some of these tasks. But with only hobby-level knowledge, he had previously been able to implement only hobby-level solutions.
When the four of us began discussing ideas for our capstone project for our electronics technologist diploma at Camosun College, creating an aquarium monitoring and control system seemed like a natural choice. We were given a full semester for this project, starting in September 2024. But wanting it to be more than “good enough,” we got to work at the start of the year.
After researching the competition, we assembled a list of concerns with the existing aquarium-monitoring solutions on the market. Almost all were a single unit, rigid in what they did, and didn’t allow for easy expandability or partial systems; you really had to commit financially (usually to the tune of thousands of dollars).
So, to set our product apart from the rest, we focused on “modularity” and “expandability.”
Modularity allows for customization. Each ecosystem will have its own requirements, and each fish or invertebrate keeper has their own list of priorities. We needed our system to be user defined in terms of what devices and components keepers could add—not just a black box of “this is what it does,” but several black boxes that can be used together.
— ADVERTISMENT—
—Advertise Here—
Expandability allows for growth. Having gone through several tank expansions himself, Kayleb was all too familiar with how a simple fish tank can grow into something much bigger. (Remember that 85-gallon tank—that was after his wife insisted on cutting back!) We built our system to allow users to enlarge their tank without being held back by the technology.
With these two tenets to guide us forward, we decided to just build a system to monitor and control everything, simple to use, expandable, and completely modular. Easy, right?
Our first real task was making the decisions about what technology would make our project, which we named “Fish Sense,” a reality: ESP32s, CAN Bus, MQTT, Ethernet cords, and more. Many summer evenings were spent digging through and comparing datasheets.
Code for the various Fish Sense components is available on the GitHub ProjectFishWorks web pages [1].
SYSTEM DESIGN
To test Fish sense, we put together a basic saltwater aquarium that we called the demo tank (Figure 3). This setup consists of a 20-gallon main display tank, with a 25-gallon sump tank below. The sump tank houses a population of algae that allows us to filter the water that is being circulated between the display and the sump tanks.
— ADVERTISMENT—
—Advertise Here—

We are extremely proud of our completed demonstration tank. Almost every aspect of it is controlled by Fish Sense, with even more controls planned for the future.
In addition to the circulating pump, we used a device called a wave-maker in the display tank to create some additional water movement. This is especially important for corals, as they use this water current to feed. The saltwater in both tanks was created by mixing reverse osmosis water with a specific amount of sea-salt mixture to recreate our own take on natural saltwater.
To satisfy the modularity and expandability requirements for the project, first, we decided that each device in the system would have its own microcontroller. (The devices we used are discussed later in this article.) This would allow each device to operate independently, giving users the ability to easily pick and choose what devices they want in their system. Second, we decided that a wired network would be preferable, since we didn’t want to deal with connecting so many devices to Wi-Fi or having to power them individually. Third, we wanted the system to be accessible from a mobile app or something similar, allowing users to monitor and control their system from anywhere.
With this system topology (Figure 4) decided upon, we started fleshing out the technologies that the system would comprise. We decided on two custom circuit boards for the system.

High-level block diagram of Fish Sense. Device-specific hardware interfaces directly with our node controllers, which use CAN Bus to communicate with the rest of the network. Our base station, at the heart of it all, uses MQTT to reach out to our web app.
Microprocessors: Our node controller would act as the general-purpose controller for each device. It needed enough GPIO to connect to various peripherals (sensors, controllers, and so on). It also needed some way to connect to our second board, the base station. The base station would act as the controller for the system; it would have a Wi-Fi connection, and would interface all the devices with the mobile app.
We settled on the ESP32 family of microprocessors for these two boards. The ESP32s are available in module form, with all the critical circuitry—such as flash and the RF circuits—packaged together, which simplified our PCB layouts.
CAN Bus: Next, we needed some way to connect the devices together and to the base station. I2C was briefly considered, but abandoned, due to its range restrictions and limiting controller target topology. After further research, we landed on a controller area network (CAN) Bus, developed by Bosh in the 1990s, which is a serial communication protocol that includes built-in addressing and collision detection/avoidance. CAN Bus also has a longer range than I2C (hundreds to thousands of meters). While this was a longer range than we needed in the short term, having the flexibility of creating larger and more distributed systems would leave our options open for future versions of this product.
Cables: Once we had a protocol picked out, we needed a physical layer to run the CAN Bus signal over. We wanted something reasonably durable and easy for the user to plug and unplug. Standard network cables, consisting of CAT 5 or 6 cable with RJ45 terminations, emerged as a clear choice for us (Figure 5). These cables are super easy to use and had a close enough characteristic impedance to the CAN Bus standard. They also have plenty of conductor pairs, one of which we used for the CAN Bus signal and the rest to supply power between connected devices.

Regular Ethernet cables proved to be the best choice for carrying our data signal and power. They have enough conductors to carry the CAN Bus signal and power throughout the device network.
Mobile App: The last piece of the puzzle was the mobile app. To limit our development complexity, we decided to create a web-based app that would run directly in a browser. Running in a browser would allow us to target both mobile and desktop environments from a single codebase. We settled on the Blazor framework from Microsoft. Blazor is a part of ASP.NET, and allows for the creation of interactive web UIs using C# alongside HTML and CSS. We all had experience programming in C# from our studies at college, so we felt that it was a good fit for our team.
MQTT Protocol: To facilitate the transfer of data between the base station and our web app, we chose the Message Queuing Telemetry Transport (MQTT) protocol. MQTT is a publish-subscribe network protocol usually used in bandwidth-limited situations, such IoT devices. The MQTT protocol involves an intermediate server called a broker. Clients—in our case, the base station and the web app—send messages to the broker on topics and can subscribe to topics to receive messages from other clients. We were able to use a free broker from HiveMQ.com. However, HiveMQ only has a 3-day message retention period, so we are exploring different solutions to allow for long-term use.
This brought us to September, when we started working on the project full time. With the major details decided on, we turned to designing our two custom circuit boards.
NODE CONTROLLER
The node controller (Figure 6) is a fairly simple board. The ESP32 C3 that we chose for the board has a dedicated CAN Bus peripheral (called the TWAI driver), but it still requires an external transceiver chip to create the differential CAN Bus signal. We used the Microchip MCP2551 IC for this purpose. (The MCP2551 is now discontinued, but similar devices, such as the MCP2561, exist). For GPIO, we simply broke out the 13 remaining pins not used for the CAN Bus transceiver to header pins. These pins allowed us to create protoboard “hats” to add any device-specific circuits to the node.

Our two custom PCBs. (a) Node controller with an ESP32 C3. (b) The more powerful base station, with the ESP32 S3, SD card slot, and barrel jack to connect to power.
For power, we ended up with a three-rail setup. We receive 24V DC from the base station via the RJ45 plug. This voltage is then reduced to 5V using an integrated switching regulator to power the CAN Bus transceiver. Next, a linear regulator drops that 5V to the 3.3V required to power the ESP32 and most peripherals. (Some sensors and other devices use 5V, though, so it’s nice to have as well.) We used the ESP32-C3-WROOM-02 module with an included PCB antenna. Although we didn’t end up using Wi-Fi or Bluetooth in our final version of the project, the cost was the same as the module without the antenna, and we wanted to leave our options open for the future.
Firmware on the node controllers is also not overly complex. Sebastien, our programming wizard, decided that using C++ and the Arduino framework would enable us to use the existing Arduino libraries for various hardware interfacing, saving us a lot of firmware development time. We created a custom library to handle all the shared CAN Bus functionality. This library contained a function to send data to the CAN Bus network and a callback function that would be called every time the base station or another device on the network transmits data. Using this library, the node controller can send data to the base station, which then sends it to the web app. The node can also receive data, either from another device, or from the web app via the base station. Code for the node controller and other devices is available on the GitHub ProjectFishWorks web pages [1]
BASE STATION
The base station (Figure 7) is the main interface for our devices to connect to the web app. With the base station acting as a hub for the system, we also decided to add some extra functionality to it. First, we wanted to notify the user if there was an issue with the system (see message in the display, Figure 7) if, for example, a leak was detected, or the water temperature was too high. We added RGB LEDs and a buzzer to alert users nearby, and also gave the base station the ability to send emails to users if they were away from home. We also added two buttons and a small OLED screen to provide a basic user interface for configuring options, such as the Wi-Fi connection. The final function that we tasked the base station with was to log data from the devices to an SD card, so historical data could be accessed from the web app.

Loud and bright, we ensured that our base station would grab the user’s attention if there was something wrong with the tank. It can also send an email alert if the users are away from home.
As one would imagine, these extra features required a more complex PCB design, and a more powerful processor. We chose the larger and more powerful ESP32-S3-WROOM-2 module. This module gave us more GPIO to work with, as well as a dual-core processor that would allow us to split the slower Wi-Fi and SD card operations from the more real-time CAN Bus operations.
The power supply for the base station is mostly the same as the one for the node controller, except that the 24V power is provided by an external AC-DC adapter and barrel jack. We also put the 24V power through a high side power switch (ITS428L2), to give us better control of the network boot-up timing and a current/power monitoring IC (INA219) to monitor device network power usage.
Having not finished our user interface decisions when designing the board, we opted to just break out all the GPIO, with some paired with their own ground and 5V pins to power the LEDs or other potential peripherals.
Finally, during some late nights and with the help of our instructors, we finished the board designs using Altium Designer, and had them manufactured by JLC PCB. We assembled the boards with a solder-paste stencil, our school’s manual pick-and-place machine, and a vapor phase reflow oven. While there were a few minor issues with our boards (and a few bodges required), we made it through without needing any revisions. There are many things we would like to improve with these boards, with plans already in the works for subsequent revisions.
Data Flow Between CAN Bus and Web App: With hardware completed, we needed to map out how the base station’s firmware would handle data flow between the CAN Bus network and our web app. The easiest way to break it down is to follow the example of the path for a temperature reading.
Starting in the device’s node controller firmware, we receive a floating-point number from the temperature sensor. CAN Bus messages are broken up into two main fields, giving us 8 bytes for our payload and 29 bits for an identifier. We use the identifier field to transmit the node’s unique 8-bit ID, as well as a 16-bit message ID that indicates what data is being sent. The temperature value goes in the payload field, and this message is then transmitted over the CAN Bus network to be received by the base station.
Once the base station receives the message, an MQTT topic is created with the node and message IDs and a unique ID for the base station. The temperature data from the CAN Bus message, along with the time the message was received, is added to the MQTT message payload and sent to the broker. The web app can now subscribe to this topic on the broker and receive up-to-date temperature readings.
This whole process is repeated in reverse when we want to move data from the app to the devices, such as when we want to modify a temperature alarm setpoint.
DEVICES
By October, we finally had what you could call the “brains” of the system in the base station, and a network of nodes to act as a “nervous system;” therefore, it was time to start incorporating the “extremities,” our devices (Figure 8).

Here are the devices we chose for the first version of Fish Sense. Starting
from the bottom right, going clockwise: pH Sensing, the Base Station, Leak Detection, AC Control, Lighting, and Temperature Sensing.
The first device that we started working on was our aquarium lighting control system. To ensure the comfort of our corals, we used two strings of high-intensity LEDs—one white and one blue. Both strings contain eight series LEDs driven by MEAN WELL constant current LED drivers. We dim the LED drivers using a 0 to 10V PWM signal from a node controller, allowing us to create a customizable day-to-night routine and manually set brightness in the web app.
While there is an almost endless number of parameters that could be monitored in an aquarium, we decided that leak detection, water level, water temperature and pH, along with air temperature and humidity, would be a good starting point. All these parameters can be monitored on the web app. Further, users can configure high and low alarm setpoints, so that an alarm can be set off if any of the parameters are out of range (Figure 9).

The Fish Sense Web App, showing the details page of our pH Sensor. We
have built-in user controllable alarms for highs and lows, and up to three days of history with a scalable graph view.
Smart Power Bar: Because an alarm going off doesn’t do much to mitigate the potential danger, Eric, our team’s Red Seal Electrician, designed and constructed an AC outlet control device. Our “smart power bar” would allow the system to take action in response to these alarms automatically toggling outlets as required. For example, it would turn off the pump if the water level was too high, or turn on a heater if the temperature was low.
We placed all the components for the device (outlets, control relays, and the node controller) in a divided five-gang electrical box. The divider meant that we could provide some physical isolation between the AC outlets and relays, and the lower-voltage node controller. We also chose a dual-channel relay module with a built-in AC to DC power supply for the relay coils. Using opto-isolators for the relay control signals meant we could fully electrically isolate the node controller from the relays and outlets. Finally, a GFCI cord end was used, since the device would be near water.
We designed and 3D printed a bracket to hold the node controller in one blank cover plate, and some RGB LEDs—to act as status indicators—in a second one. We chose a form factor that allowed everything to fit into any 3.5”-deep electrical box, leaving our options open for in-wall mounting in the future.
Eric constructed the AC outlet device with three pairs of outlets: one always on, one connected to a normally open relay, and one connected to a normally closed relay. This assortment of outlet choice allows the user to decide whether a given outlet is on or off in the event of a control system failure. We also added a current clamp, so that the power usage of all the connected AC devices could be monitored in the web app.
Because the AC outlet is arguably our most complex device, it is still in the early stages of development. Although we were able to complete the current version (Figure 10), in the future, we would like to add more outlet configurations, per-outlet power monitoring, and more complex alert triggering and scheduling options in the web app.

(a) The finished AC Control Device provides controllable outlets for our tank. (b) The web app device page allows users to configure how alarms affect each outlet and view the power consumption of the system.
Code and other information about the various Fish Sense components is available on the GitHub ProjectFishWorks web pages [1].
CONCLUSION
From the very beginning, Kayleb’s dream of a completely modular solution for his aquariums promised to be not only an exciting and fun project, but also something that could truly help make the joy of aquarium keeping accessible to a larger audience. In 12 months, we put our all into Fish Sense, and we believe we made something truly novel. We set out to simplify the aquarium experience, making it as easy to grow your monitoring system as it is to grow your aquarium. With the ease of set up and the modular, expandable design we achieved, we believe we accomplished this goal.
That said, we would like to continue to improve our product, Fish Sense, and have many plans for the future, in addition to those mentioned earlier. We would like to implement more devices, such as the Atlas Scientific line of environmental sensors, a variable-speed pump controller, and an automatic feeder. Furthermore, we aim to make improvements to our existing technology, including a full redesign of the lighting system and new versions of the node controller and base station PCBs.
We also envision many other use cases for Fish Sense beyond home aquariums, as its versatility and modular design open up a wide range of possibilities. From hydroponics in agriculture, where precise environmental monitoring can enhance crop yields, to fish and shellfish farms that require reliable water quality management, our system is adaptable to meet diverse needs.
Until then, we know that the fishes and corals in our demo tank (Figure 3) will live the easy life in their tank managed by Fish Sense.
SOURCE
https://ProjectFishWorks.ca
REFERENCE
[1] Code is available at https://github.com/ProjectFishWorks

Kayleb Stetsko is the visionary with a lifelong love for fishkeeping. Above all he is a loving father, who would do anything for his children. Beyond that, he treats anything alive like his own, including the fish of the world. His love for technology and engineering got him to where he is today. His beard is legendary. Email: kayleb_s@hotmail.com
Eric Samer is a Red Seal Electrician focused on safe and effective power solutions. Eric worked as a Red Seal Electrician until an accident forced him off his feet and he has since decided to follow his love of technology. He has a huge passion for space and science (and his cats). His beard is also legendary. Email: eric.samer@gmail.com
Sebastien Robitaille is our programming expert, skilled in integrating complex systems. He is the youngest of the group, but probably the smartest and his drive to learn and get things done is probably going to change the world. In his spare time, he helps track the bird populations and plays with computers. His beard, by the way, is legendary. Email: sebastien@robitaille.info
Braden Trigg is the organizer and writer, translating technical details into clear communication. After spending 16 years in hospitality working as a Chef he has since moved into IT. Braden is a passionate video gamer and is looking forward to furthering his passion in electronics, computers, and science in general. He can’t grow a beard but is still legendary. Email: triggbraden@yahoo.ca
