Skip to content

desiFish/Smart-Aquarium-V4.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

44 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Project_Mina ๐Ÿ 

M I N A

In Sanskrit, "Mina" (เคฎเฅ€เคจ) represents the fish, symbolizing freedom, fluidity, and the eternal flow of life. As the twelfth and final sign of the zodiac (known as "Pisces" in Western astrology), Mina embodies adaptability and spiritual wisdom. Just as fish navigate the depths with graceful purpose, this project aims to create harmony between technology and aquatic life. The name embodies our philosophy of maintaining balance in the artificial ecosystems we create, guided by ancient wisdom yet powered by modern innovation.

Inspired from this project, ESP8266 versions have been developed and running successfully. These are actively being developed and are simpler versions without complex sensors. Check them out:

GitHub stars GitHub forks GitHub issues GitHub license GitHub last commit Development Status Development Status: Paused ESP32 Web UI

ยฉ 2025 desiFish. This project is protected by copyright law. All rights reserved unless explicitly stated under the GPL v3 license terms.

๐Ÿ“ฑ Preview

New Control Interface
New Interface
Circuit Schematic
Tentative Circuit Schematic V4.0

โš ๏ธ SAFETY WARNING โšก

DANGER: This project involves HIGH VOLTAGE (240V AC) which can be LETHAL!

This project interfaces with mains electricity which poses serious risks including:

  • โšก Electric shock
  • ๐Ÿ”ฅ Fire hazard
  • ๐Ÿ’ง Water + electricity dangers

Required Safety Measures:

  1. Circuit Protection:

    • Install appropriate MCB (Miniature Circuit Breaker)
    • Use RCCB (Residual Current Circuit Breaker) rated 30mA
    • Proper fusing for each circuit (max 6A)
  2. Grounding:

    • All metal parts must be properly grounded
    • Use ground fault protection
    • Double-check ground connections
  3. Installation:

    • Must be installed by qualified electrician
    • Follow local electrical codes
    • Use proper junction boxes
    • Keep high voltage components away from water
  4. Operation:

    • Never operate with wet hands
    • Keep electronics sealed from moisture
    • Regular safety inspections
    • Disconnect power before maintenance

DISCLAIMER: Author (desiFish) is not responsible for any damage or injury. Proceed at your own risk.

๐ŸŒŠ Coming Soon!

Project under development ๐Ÿ› ๏ธ

โš ๏ธ IMPORTANT: This project is in active development and has not been thoroughly tested. Use at your own risk.

A cutting-edge aquarium control system that will revolutionize your underwater world! ๐ŸŽฎ Advanced control for aquariums using ESP32, Preference Lib. and LittleFS.

Upcoming Features:

  • ๐Ÿ“Ÿ 20x4 LCD Display for on-device status - Real-time relay status - Current time and schedules - Basic system information - No WiFi required for essential monitoring

Note: Since this version is using webserver, I am putting away the LCD option, since all controls are available in web server. Rather I will use 4 WS2812B RGB LEDs for simple status purpose. The LCD version along with buttons will feature in Smart Aquarium V4.1

  • ๐Ÿ’ก 4x WS2812B RGB LEDs for status indication
    • Visual relay status indication
    • Network connection status
    • System status alerts
    • Error condition warnings

Current Features:

  • ๐Ÿคœ Better Web UI
  • ๐Ÿ“ฑ Mobile-friendly interface
  • ๐Ÿ“Š Automatic Controls
  • โšก Dual-core ESP32 support only (ESP32, ESP32-WROOM, etc.)

Technical Details:

  • ๐Ÿ’พ Uses LittleFS for storing web interface files
  • ๐Ÿ’ฝ Preferences library for persistent settings storage
  • ๐Ÿ•’ Real-time scheduling with DS3231 RTC
  • ๐ŸŒ NTP time synchronization
  • ๐Ÿ”Œ Controls up to 4 independent relays (easily scalable)
  • ๐ŸŽ›๏ธ Three operating modes per relay
  • ๐Ÿ’ก State persistence across power cycles
  • ๐Ÿ“ฑ Mobile-first responsive interface
  • โšก Runs on both CPU cores for reliability
  • ๐Ÿ”„ Automatic status updates every second
  • ๐ŸŒ Async web server for better performance
  • ๐Ÿ“Š JSON-based API endpoints

Scalability Note:

  • โœจ Backend code is fully scalable - just modify NUM_RELAYS and RELAY_PINS array
  • ๐Ÿ”ง Web UI JavaScript is scalable - all functions work with any relay ID
  • โš ๏ธ HTML components need manual duplication with correct ID numbers for additional relays
  • ๐Ÿ“ Default pin configuration: GPIO 26, 27, 14, 12
  • ๐Ÿ”ง Max relay count limited only by available GPIO pins

๐Ÿ“ฑ Operating Modes

Project_Mina offers three versatile operating modes for each relay:

๐Ÿ”„ Manual Mode

Default operating mode for all relays.

  1. Toggle relay ON/OFF directly through the web interface
  2. State persists until manually changed
  3. Ideal for direct control of equipment
  4. Settings are saved and restored after power cycles

โฑ๏ธ Timer Mode

Temporary timed operation for specific durations.

  1. Set desired duration in seconds
  2. Relay automatically toggles after duration expires
  3. Returns to manual mode after completion
  4. Perfect for temporary operations (feeding, maintenance)
  5. Timer state persists through power cycles

๐Ÿ•’ Auto Mode

Scheduled operation based on time of day.

  1. Set ON time and OFF time (24-hour format, e.g., "14:30")
  2. Supports both same-day schedules (ON: 09:00, OFF: 17:00)
  3. Handles overnight schedules (ON: 22:00, OFF: 06:00)
  4. Checks schedule every second
  5. Schedule persists through power cycles

๐Ÿ’ก Tip: For equipment that needs to run overnight, set the ON time after the OFF time (e.g., ON: 22:00, OFF: 06:00)

๐Ÿค Sharing & Contributing

๐ŸŒŸ Show Your Support

If you find this project useful, consider:

  • โญ Giving it a star on GitHub
  • ๐Ÿ”„ Forking it for your own projects
  • ๐Ÿ“ข Sharing it with fellow aquarium enthusiasts

๐ŸŽฏ How to Fork & Use

  1. ๐Ÿ”ฑ Click the "Fork" button at the top right
  2. ๐Ÿ“‹ Clone your fork: git clone https://github.com/desiFish/Project_Mina.git
  3. ๐Ÿ”จ Make your changes
  4. ๐Ÿ’ Share your improvements through Pull Requests

๐Ÿ™ Giving Credit

When using this project, please:

  • ๐Ÿ”— Link back to the original repository
  • ๐Ÿ“ Keep the GPL-3.0 license intact
  • ๐ŸŒˆ Mention in your README: "Based on Project_Mina by desiFish"

๐Ÿ’ซ Spread the Word

  • ๐Ÿฆ Share on Twitter/X
  • ๐Ÿ“ฑ Post on aquarium forums
  • ๐Ÿ‘ฅ Tell your fish-keeping friends

๐Ÿ“ฆ Installation

Prerequisites

  1. Install Arduino IDE 2.3.6 or newer
  2. Install ESP32 board package:
    • Add https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json to Additional Board URLs
    • Install "ESP32 by Espressif Systems" from Boards Manager

โš ๏ธ Hardware Compatibility: Currently tested only on ESP32 DevKit V1 (30-pin version). Other ESP32 boards may work but are untested.

Required Libraries

Install these from Arduino Library Manager:

  • ESPAsyncWebServer - Async HTTP and WebSocket server
  • AsyncTCP - Required by ESPAsyncWebServer
  • RTClib - RTC support by Adafruit
  • ArduinoJson
  • NTPClient
  • Preferences (built-in)
  • WiFi (built-in)

Board Configuration

  1. Select Board: ESP32 Dev Module
  2. Upload Speed: 921600
  3. CPU Frequency: 240MHz
  4. Flash Frequency: 80MHz
  5. Flash Mode: QIO
  6. Flash Size: 4MB (32Mb)
  7. Partition Scheme: Default 4MB with spiffs

LittleFS Setup

See Resources section for LittleFS installation guide.

Project Setup

  1. Clone repository:

    git clone https://github.com/desiFish/Project_Mina.git
  2. Open Project_Mina.ino in Arduino IDE

  3. Edit WiFi credentials in code:

    const char* ssid = "YOUR_WIFI_SSID";
    const char* password = "YOUR_WIFI_PASSWORD";
  4. Connect ESP32 via USB

  5. Select correct COM port in Tools menu

  6. Upload sketch (โ–ถ๏ธ button)

  7. Upload web interface:

    • Press Ctrl + Shift + P
    • Type "littlefs" and select "Upload LittleFS image to Pico/ESP8266/ESP32"
    • Wait for "LittleFS image uploaded" message

    If you encounter any errors:

    • Close Serial Monitor
    • Restart Arduino IDE
    • See Resources section for detailed troubleshooting

Hardware Setup

โš ๏ธ Remember safety warnings - work with mains voltage is dangerous!

  1. Connect DS3231 RTC:
    • SDA โ†’ GPIO 21
    • SCL โ†’ GPIO 22
    • VCC โ†’ 3.3V
    • GND โ†’ GND
  2. Connect relays to specified pins:
    • Relay 1 โ†’ GPIO 26
    • Relay 2 โ†’ GPIO 27
    • Relay 3 โ†’ GPIO 14
    • Relay 4 โ†’ GPIO 12

First Run

  1. Power up the device
  2. Connect to your WiFi network
  3. Find ESP32's IP address in Serial Monitor
  4. Access web interface: http://<ESP32-IP-ADDRESS>
  5. Update RTC time using the Settings page

๐Ÿ“š Resources

๐Ÿ“œ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0):

What you can do:

  • โœ… Commercial use
  • โœ… Modify and distribute
  • โœ… Patent use
  • โœ… Private use

What you must do:

  • ๐Ÿ“ข Disclose source
  • ๐Ÿ“ License and copyright notice
  • ๐Ÿ“‹ State changes
  • ๐Ÿ”„ Same license

What you cannot do:

  • โŒ Hold liable
  • โŒ Sublicense
  • โŒ Remove copyleft

See LICENSE for the full license text.


Made with โค๏ธ in India

I love Open Source! This project is my way of giving back to the amazing developer community that taught me everything I know. Happy coding! ๐Ÿ‡ฎ๐Ÿ‡ณ