Introduction: SmartAquarium

Allow me to introduce SmartAquarium, an innovative project developed using ESP32 technology. This project is designed to facilitate aquarium management by leveraging advanced technology.

This project was created by:

  • ALVIN (2502000413)
  • ADY WIJAYA (2501962946)
  • EFENDI (2502011392)

The primary feature of SmartAquarium is its ability to automatically feed fish using an integrated motor. With easy settings through the connected application, users can schedule feeding times and determine the quantity of food, ensuring the well-being of fish is maintained even during busy daily routines.

Furthermore, the project is equipped with customizable LED lights, providing the possibility to create different atmospheres within the aquarium. Users can manually adjust colors or opt for automatic options for dynamic variations.

Monitoring the aquatic environment has also become more accessible with the integrated display of water temperature and pH in the application. This information can be accessed instantly, offering users immediate insights into the aquarium's environmental conditions, allowing corrective actions to be taken as needed.


Evaluation of our product design:

  • Added more RGB light modes.
  • make the case more neatly
  • make the holes in the case for the LCD more precisely


Conclusion:

The main goal when developing smart aquariums is to improve aquarium management, provide more efficient care, and ensure fish health.

 The combination of technological innovation, strong connectivity and awareness of environmental sustainability makes SmartAquarium an attractive solution for fish enthusiasts while contributing to the protection of aquatic ecosystems.


Reference:

  • https://pub.dev/packages/flutter_colorpicker
  • https://www.youtube.com/watch?v=4fucdtPwTWI&t=2093s



Supplies

  1. DOIT ESP32 Devkit V1
  2. Jumper Male to Male
  3. Jumper Male to Female
  4. Male Header
  5. Female header
  6. Plain PCB
  7. Batang Shaft Stainless Steel (5mm)
  8. Flexible Shaft Kopling(5mm)
  9. Filter Aquarium (kita menggunakan Filter air yang sudah ada pumpnya)
  10. Kabel JST Connector
  11. module Sensor PH meter (PH-4502c)
  12. Sensor Ph meter
  13. Sensor Temp Air DS18B20
  14. LED Strip WS2812B 5V
  15. LCD SPI ILI9341 2.4 inch TFT module
  16. Sufficient Duct Tape
  17. Bolt (2CM)
  18. Wood Planks
  19. DC jack for power input

Software :

  • Visual Studio Code (Platform.io, C++, and Flutter/Dart extensions included)
  • MinGW C++ Compiler
  • Google Firebase RTDB
  • EasyEDA
  • Autodesk Fusion360

!!! Design PCB dan STL akan diberikan !!!

Step 1: Metodologi Dan Design Solution

Development Methodology:

for our SmartAquarium , we using development methodology becouse in a project provides a systematic framework and guidance throughout the project's lifecycle. A development methodology not only provides a framework but also facilitates effective project management and overall project governance


key elements that can be improved and optimized in terms of development methodology and design solutions

  • WiFi Connection Management:
  • Integrate WiFi connection management more robustly to handle situations such as failed connections or WiFi configuration.
  • Firebase Management:
  • Consider organizing a class or specific functions for Firebase management to enhance modularity and readability.
  • Use Clear Names:
  • Choose more descriptive variable and function names to facilitate understanding and maintenance of the code.



Design Solution

Hardware:

  • Temp sensors and PH meters are used to detect water temperature and pH in aquarium water.
  • ESP32 is used to collect data from sensors and upload data to the Firebase Realtime Database.

Software:

  • The mobile application uses the Flutter platform to display information and change the color of the LED Strip
  • Firebase Realtime Database is used to store Temperature and Ph Quality data

Step 2: Block Diagram

Explanation:

  1. The DOIT ESP32 Devkit V1 serves as the brain of the system, controlling all components.
  2. The pH Meter Sensor and Water Temperature Sensor measure water quality and temperature in the aquarium.
  3. The WS2812B LED Strip provides controllable lighting.
  4. The SPI ILI9341 2.4-inch TFT LCD module displays information such as temperature and pH.
  5. The Aquarium Filter with its pump maintains water cleanliness.


Step 3: Design the Electrical Circuit

We used ESP32 DEVKIT V1 as the main microcontroller, as for the power itself, we use DC jack for 5V 2A power source to make sure the components works fine. as for the connectors, we used female header for ESP32 and TFT display, as for the sensors we used JST connector to make sure it's connected properly and not loose.


as for the I/O pins, the LED stripe connected to IO4, the Water Temperature Sensor DS18B20 connected to IO13, the Water PH Sensor PH-4502C Connected to IO14 with it's PO pin, as for the DC Stepper ULN2003 we use 4 inputs, input 1 is IO26, input 2 is IO25, input 3 is IO33, and input 4 is IO32.


the TFT is quite special, since it used 9 pins to work. the CS pin is connected to IO22 which is the SCL pin for ESP32, the Reset pin is connected to IO15, the D/C pin is connected to IO21, the SDI(MOSI) is connected to IO23 which is the SDA pin of ESP32, the SCK pin is connected to IO18, and lastly the SDO(MISO) is connected to IO19.

Step 4: FlowChart

this flowchart is showing how our project work. Starting from pluging the aquarium and logging into the application. And the aquarium will start sending data from database, and the application will get the data from the aquarium.

Step 5: Convert the Electrical Circuit Into PCB

After we make the schematic, we can convert it into PCB in EasyEDA, for the efficiency we make it as small as possible around 8x5cm. after that arrange the posisition of components where sensors are on the sides, and the microcontroller is in middle. Since we make it small, the track width is set into 1mm for the power, some are set into 0.5-0.75mm so it can goes around the pin. The data track width is set into 0.75mm, and all of those tracks are on bottomlayer. we uses the auto route from EasyEDA to help us with the routing, the more complex looking one are routed ourself to make sure nothing collide.

Step 6: Hardware Code

For the ESP32 code, we use platform.io in Visual Studio Code and the C++ language.

the SmartAquarium project utilizing the ESP32 platform. Here's a concise overview of how it works:

  • Component Initialization:
  • Stepper motor is set up for automated fish feeding.
  • Temperature and pH sensors are configured using OneWire and DallasTemperature.
  • LED Strip is controlled using FastLED.
  • Firebase and Wi-Fi configurations are established using Firebase_ESP_Client and WiFiManager.
  • Setup:
  • WiFi connection is set up using WiFiManager.
  • Components like the TFT display, temperature sensor, and stepper motor are initialized.
  • Firebase is configured for connection and authentication.
  • pH Function:
  • A function is included to calculate pH value based on voltage.
  • Main Loop:
  • Sensing and Firebase Update:Every 15 seconds, temperature is measured and sent to Firebase.
  • pH value is measured, calculated, and sent to Firebase.
  • LED Strip Control:LED Strip color is changed based on the color value received from Firebase.
  • Stepper Motor Control:If there's a command from Firebase, the stepper motor moves for 1 second.
  • TFT Display:
  • Information such as pH value and temperature is displayed on the TFT screen.

In this way, the SmartAquarium project leverages ESP32, temperature and pH sensors, LED strip, stepper motor, and Firebase to create an intelligent aquarium with automated functions and real-time monitoring capabilities.

Attachments

Step 7: Setup Google Firebase

Make sure to connect your email to Google Firebase,

  • Login to the Firebase console.
  • Create a new project .
  • Create a database
  • initialize data, and set rules to true.
  • Create storage
  • Create an images folder, and set rules to true.
  • Create the variabel dan struktur data Firebase, and set the key value to boolean.

Step 8: 3D Printing Case

For the 3D design, we make it using Fusion 360. We made the funnel for the pet food using Loft, and 10 x 10 x 10 for the Box.

Inside the funnel there's a 6mm hole for a 5mm steel shaft, the steel shaft is a mounting for the propeler. On the Propeller there's a hole with a flat corner,

which make the shaft stay in place. For the Propeller we used a circular pattern, which make it easier to make a propeller. We made the propeller curve so that it

would reduce the chance of getting jammed with the pet food.

As for the stepper mount, we 2cm thick wall to hold the food on top of it, the stepper itself has diameter 2.54cm, so the mount has diameter of 2.6cm and made into half circle section. The hole used for the shaft is 0.5mm hole, as for the tolerance we give it 0.7mm. We also used a bolt with diameter of 2cm to hold it in place, But 1cm diameter bolt also works.

Step 9: Create App

for the final step, we made an application using flutter(dart base lang). We integrate the application with firebase RTDB so that the application can

Get & Post data on the RTDB. Theres a login screen for unique user, home screen for the aquarium data & online feeding, and RGB page for changing the color of rgb

in the aquarium to decorate your room, we used flutter_colorpicker for the rgb library.


Here's our link code: https://github.com/Psickoo/SmartAquarium