ControlHub is an open-source aquarium automation system designed to control lighting and COβ equipment using time-based scheduling, without relying on Wi-Fi, cloud services, or physical button-based timer setups.
The system consists of:
- An ESP32 + DS3231 RTC that handles all automation logic
- A custom Android application with a modern Material 3 design used for setup, monitoring, and manual control via Bluetooth
The Android app allows users to:
- Connect to the ESP32 over Bluetooth
- Manually control Light and COβ relays
- Set ON/OFF schedules in Auto mode
- Sync the ESP32 RTC with the phone time
- Save schedules permanently to the ESP32
Once schedules are saved, the ESP32 operates fully independently using the RTC.
The app is not required to be running for automation to work.
Many ESP32 aquarium automation projects rely on Wi-Fi and cloud-based services, which introduces several limitations:
-
β Wi-Fi may not be available everywhere
-
β Some time Stop working when the internet is down
-
β Dependence on cloud services for control and scheduling
-
β Time synchronization often relies on internet-based NTP services
ControlHub solves these issues by using Bluetooth for setup and control, and a hardware RTC for accurate timekeeping, making it reliable, private, and fully offline-capable, without requiring routers, credentials, or internet access.
- Works anywhere
- No internet required
- Simple phone connection
- Stable local control
- RTC keeps time even without phone
π That is why Bluetooth + RTC was chosen.
The ControlHub Android app is designed for **local, offline control** and configuration.
-
Bluetooth connection to ESP32 (no internet required)
-
Manual ON / OFF relay control
-
Designed for Android 12+
-
Auto mode with ON & OFF time
-
RTC time synchronization
-
Works fully offline
-
Modern Material 3 (Material You) design
-
Dynamic color theming (adapts to user's wallpaper)
-
Dark and light mode support
-
Smooth animations and transitions
| Component | Description |
|---|---|
| ESP32 Dev Board | Main controller |
| DS3231 RTC | Accurate time keeping |
| 2-Channel Relay Module | Controls AC loads |
| 5V Power Supply | Old mobile charger (used by me) |
| Perf / Breadboard | Prototype setup |
| Wires & Enclosure | Switch socket box / jumper wires |
- This project switches AC mains voltage
- My setup is ONLY A PROTOTYPE
- Wiring is NOT professional
- No proper isolation for AC side
β DO NOT touch relay side when powered
β DO NOT blindly copy AC wiring
β USE proper enclosure for real use
β CONSULT a qualified electrician if unsure
Power Note:
I used an old 5V mobile charger to power the ESP32 and relay module.
For real installations, use a proper regulated 5V supply.
π This project is for learning only, not production use.
ESP32 β DS3231
- SDA β GPIO 21
- SCL β GPIO 22
- VCC β 3.3V
- GND β GND
ESP32 β Relay
- IN1 β GPIO 27 (Light)
- IN2 β GPIO 26 (COβ)
- VCC β 5V
- GND β GND
- Install Arduino IDE
- Install ESP32 Board Support
- Download firmware from GitHub Releases
- Unzip and open the
.inofile - Need to install RTClib by Adafruit Librar by going to Sketch β Include Library β Manage Libraries β Search "RTClib" β Install
- Select ESP32 Dev Module
- Upload code
- Open Serial Monitor (115200 baud) and confirm Bluetooth started
Option A: APK
- Download APK from GitHub Releases
- Enable Install unknown apps
- Install APK
Option B: Build from source
- Open android-app in Android Studio
- Let Gradle sync
- Run app on phone
- Power ON ESP32
- Enable Bluetooth on phone
- Open ControlHub app
- Tap Connect to Device
- Pair and connect to ESP32
- Press Sync RTC Time
- ESP32 saves phone time
- RTC keeps time even after power loss
-
Manual Mode β Instant ON / OFF
-
Auto Mode β Set ON & OFF time
-
Click Save Settings
-
ESP32 runs independently
More images you can find in images
This project was created mainly for learning, using AI-assisted coding and experimentation.
- Not a professional developer
- No coding background
- used AI for coding
- Made for learning and hobby
- Code may not be perfect, but it works
Feel free to improve or modify.
- Refactor firmware and Android app code for better structure and maintainability
- Improve and extend validation and safety checks for scheduling logic and user input
- Improve app UI/UX and add clearer device and schedule status feedback
- Add better user feedback for invalid inputs and failed operations and RTC status
- Add calendar-based scheduling (day-wise control) for dosing pumps
- Add cycling / interval mode for devices like misting systems
- Support configurable ON/OFF cycle durations within active time windows
- Add configurable devices with user-defined names
- Allow users to assign GPIO pins to devices from the app
- Allow users to add and manage multiple relays without modifying firmware
These plans may evolve as the project grows and learning continues.
MIT License β free to use, modify, and learn from.
If you are a beginner, this project is for you.
If you are experienced, please improve it and share back.
Feedback and contributions are welcome.
If you have ideas or improvements, feel free to open an issue.
β If this helped you, please star the repository.





