{"id":18965522,"url":"https://github.com/celliesprojects/aquacontrol32","last_synced_at":"2025-04-08T03:19:29.492Z","repository":{"id":23564315,"uuid":"99338712","full_name":"CelliesProjects/aquacontrol32","owner":"CelliesProjects","description":"5 channel aquarium LED controller with web interface for ESP32 boards. Supports DS18B20, SSD1306, ILI9341, XPT2046 and SmartConfig. Arduino IDE. ","archived":false,"fork":false,"pushed_at":"2025-02-25T17:23:52.000Z","size":14956,"stargazers_count":63,"open_issues_count":6,"forks_count":21,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-29T08:04:44.879Z","etag":null,"topics":["aquarium-lights","arduino-ide","ds18b20","esp32","iot","iot-application","iot-device","led-controller","mh-et-d1-mini","moon-phase","oled-display-ssd1306","smartconfig","sntp","temperature-logger","temperature-sensor","tft-display","web-interface","xpt2046"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CelliesProjects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-04T11:59:40.000Z","updated_at":"2025-02-25T17:23:55.000Z","dependencies_parsed_at":"2023-02-18T08:45:18.312Z","dependency_job_id":null,"html_url":"https://github.com/CelliesProjects/aquacontrol32","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CelliesProjects%2Faquacontrol32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CelliesProjects%2Faquacontrol32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CelliesProjects%2Faquacontrol32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CelliesProjects%2Faquacontrol32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CelliesProjects","download_url":"https://codeload.github.com/CelliesProjects/aquacontrol32/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767239,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aquarium-lights","arduino-ide","ds18b20","esp32","iot","iot-application","iot-device","led-controller","mh-et-d1-mini","moon-phase","oled-display-ssd1306","smartconfig","sntp","temperature-logger","temperature-sensor","tft-display","web-interface","xpt2046"],"created_at":"2024-11-08T14:29:50.131Z","updated_at":"2025-04-08T03:19:29.474Z","avatar_url":"https://github.com/CelliesProjects.png","language":"C","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=MSP53ANQ3VV6J"],"categories":[],"sub_categories":[],"readme":"# This project is no longer maintained. An updated version using esp32 Arduino Core 3.x.x can be found [here](https://github.com/CelliesProjects/aquacontrol32-pio).\n\n### Aquacontrol32\n\nAquacontrol32 can control 5 led strips to create gradual sunrises and sunsets in your aquarium. It is developed for and tested on [MH-ET LIVE MiniKit ESP32](http://mh.nodebb.com/topic/8/new-mh-et-live-minikit-for-esp32) MCUs. Other than the led dimming hardware, no additional hardware is needed to control the device.\n\nThe minimum hardware would be a ESP32 board with at least 5 free output pins connected via 100R gate resistors to 5 NPN mosfets that drive the led lights. You will need logic level mosfets for example [IRLZ44N mosfets](http://www.irf.com/product-info/datasheets/data/irlz44n.pdf).\n\nWith some modifications and provided there are enough pins broken out, Aquacontrol32 should run on basically any ESP32 based board. The built-in web interface already gives access to most functions. The goal is v2.0 as a single binary with all functions accessible via the web interface.\n\nYou can connect a 128x64 I2C OLED and/or a ILI9341 SPI tft display to have some feedback on the display(s). The ILI9341 displays usually come with a XPT2046 touch controller which is supported (and assumed).\n\nAnother cool feature is support for 3 Dallas DS18B20 temperature sensors, with temperature logging to FATFS and a 30 day temperature history.\n\n### Index\n\n- [Video](#aquacontrol32-dimming-down-youtube-video)\n- [Features](#features)\n- [Requirements](#requirements)\n- [Libraries needed for compiling](#libraries)\n- [Quick start](#quick-start)\n- [Compile options](#compile-options)\n- [Compile notes](#compile-notes)\n- [Connecting a ILI9341](#connecting-a-ili9341)\n- [Lunar cycle night light](#lunar-cycle-night-light)\n- [SmartConfig and WiFi setup](#smartconfig-and-wifi-setup)\n- [DHCP or static IP](#DHCP-or-static-IP)\n- [Log files](#log-files)\n- [Known issues](#known-issues)\n- [Libraries in the web interface](#Libraries-used-in-web-interface)\n\n#### Aquacontrol32 dimming down YouTube video\n\n[![VIDEO](https://img.youtube.com/vi/o2aeSjKm6FA/0.jpg  \"Click to watch the video\")](https://www.youtube.com/watch?v=o2aeSjKm6FA)\n\n#### Features\n\n  - 5 channels led dimming (common anode) through 1.22kHz PWM at 16 bit (65535 steps) resolution. The dimming control task runs at 100Hz to ensure smooth dimming.\n  - Lunar cycle night light.\n  - 50 timers per channel with a 1 minute resolution.\n  - Password protected web interface to control the device. (default login is user:admin password:esp32)\u003cbr\u003eSee it in action at my [fish](https://vissen.wasietsmet.nl/) and my [salamander](https://salamanders.wasietsmet.nl/) tank. (update 2023 - Both might be on or offline because running a reverse proxy all day is quite expensive energywise)\n  - SNTP timekeeping with timezone support.\n  - 3x OneWire DS18B20 sensor support and FFat storage with a 30 day temperature history.\n  - SSD1306 128x64 OLED over I\u003csup\u003e2\u003c/sup\u003eC support.\n  - ILI9341 320x240 TFT with XPT2046 touchscreen over SPI support.\n  - All device settings are saved in NVS.\n  - Easily connect your controller to WiFi with the [Espressif EsptouchForAndroid app](https://github.com/EspressifApp/EsptouchForAndroid/releases/latest).\n  - Get a notification in the web interface if a new release is available.\n\n#### Requirements\n\n  - The latest [aquacontrol32 release](https://github.com/CelliesProjects/aquacontrol32/releases/latest).\n  - The [Arduino IDE](https://arduino.cc/) 1.8.12.\n  - The [ESP32 Arduino Core 1.0.4](https://github.com/espressif/arduino-esp32/releases/tag/1.0.4).\n\n#### Libraries\n\nMost libraries can be installed with the Arduino library Manager `Sketch \u003e Include Library \u003e Manage Libraries`.\n\nA few have to be downloaded from GitHub:\n\n  - [OneWire](https://github.com/stickbreaker/OneWire) 2.3.3 - Use this library instead of the standard Arduino OneWire library.\n  - [AsyncTCP](https://github.com/me-no-dev/AsyncTCP) 1.0.3\n  - [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) 1.2.3\n  - [MoonPhase](https://github.com/CelliesProjects/MoonPhase) 1.0.0\n  - [Task](https://github.com/CelliesProjects/Task) 1.0.0\n  - [FFatSensor](https://github.com/CelliesProjects/FFatSensor) 1.0.2\n\nInstall in the Arduino libraries or ESP32 libraries folder.\n\n#### Quick start\n\n  1. Download and unpack the latest release.\n  2. Check if all libraries are installed and the correct version. (in `aquacontrol32.ino`)\n  3. (Optional) Adjust the `wifi_password` and `wifi_network`. (in `aquacontrol32.ino`)\n  4. Check and adjust device specific setup in `deviceSetup.h` and `devicePinSetup.h`.\n  5. Flash your device. Remember to use a FFat partition!\n  6. On the first boot ( or after a flash erase ) the internal flash drive will be formatted so first boot will take a little longer. Updating aquacontrol to a new version will not format the drive.\n\nThe sensors and displays should be plug and play, except the ILI9341 when it has no MISO pin connected. For these displays you can enable `TFT_HAS_NO_MISO` (set it to `true`) in `deviceSetup.h`.\n\n#### Compile options\n\n  - Board: MH ET LIVE ESP32MiniKit (A lot of other boards work just fine without any code changes. Check/adjust the particular pin setup if not.)\n  - Partition scheme: Default with ffat\n\n#### Compile notes\n\n  - Check your device options in `deviceSetup.h` and `devicePinSetup.h`.\n  - Source are compiled for `mhetesp32minikit` which has support for ESP_LOGX macros.\n\u003cbr\u003eThis can be changed to a particular esp32 board by changing the `--board` option in the `compile.sh` and `flash.sh` scripts.\n\u003cbr\u003eLook in `~/Arduino/hardware/espressif/esp32/boards.txt` to find the relevant board desciption.\n\u003cbr\u003e`custom_DebugLevel` should be set to `esp32_none` in the `flash.sh` script for production use.\n\u003cbr\u003eWhen you are still testing your hardware and setup, debug level can be set to anything depending on your needs.\n\u003cbr\u003e(`esp32_info` is probably what you need, `esp32_verbose` gives the most info)\n\nToggle the `GIT_TAG` option in `deviceSetup.h` to enable or disable version information.\n\u003cbr\u003eSetting `GIT_TAG` to `true` makes that the Arduino IDE can no longer compile or flash your script.\n\u003cbr\u003eYou then have to use the script `compile.sh` to verify your sketch and `flash.sh` to verify/upload the sketch to the controller. You might have to adjust these scripts for your particular OS or setup.\n\u003cbr\u003eRead [this blog post](https://wasietsmet.nl/arduino/add-git-tag-and-version-number-to-an-arduino-sketch/) to see why I choose this method.\n\n#### Connecting a ILI9341\n\n  - Check the [Aquacontrol hardware GitHub repo](https://github.com/CelliesProjects/aquacontrol-hardware).\n  - Read the [file](tft_board_pins.md) on connecting a ILI9341 display. Pull-ups are not optional!\n  - The ILI9341 boards from AliExpress, DealExtreme or any other supplier are not all equal.\n\u003cbr\u003eAmong the tested boards I encountered some that have no MISO pin connected, so they can't respond to read commands.\n\u003cbr\u003eFor these boards you can enable `TFT_HAS_NO_MISO` (set it to `true`) in `deviceSetup.h`.\n  - Some ILI9341/XPT2046 boards have their touch coordinates inverted.\n\u003cbr\u003eFor these boards you can enable `TOUCH_IS_INVERTED` (set it to `true`) in `deviceSetup.h`.\n  - Don't forget to connect the tft LED to 3.3V. (default: GPIO PIN 2)\n\u003cbr\u003eTo be on the safe side, I use a BC547 transistor (and a 100R resistor) between the ESP32 pin and the LED connector on the tft board.\n\u003cbr\u003eIf you connect the LED directly to a ESP32 pin, connect it through a 100R resistor in series to prevent burning up your ESP32.\n\nTo override the device detection for ILI9341 displays you can use the `ILI9341 force` button in the `setup` page of the web interface. This will force a ILI9341 display until the device reboots.\n\n#### Lunar cycle night light\n\n  - Moon light settings can be adjusted in the `channels` area of the web-interface.\n  - The lunar images used in the web interface are rendered by Jay Tanner and licenced under the [Creative Commons Attribution-ShareAlike 3.0 license](docs/near_side_256x256x8/README.md).\n  - The [moon phase library](https://github.com/CelliesProjects/MoonPhase) is adapted from code kindly licensed by Hugh from [voidware.com](http://www.voidware.com/). Thanks Hugh!\n\n#### SmartConfig and WiFi setup\n\nSet your `wifi_network` and `wifi_password` in `aquacontrol32.ino` before you flash your device.\nDouble check because setting a wrong `wifi_network` or `wifi_password` will result in a boot loop!\n\nOr use SmartConfig and take note of the next couple of things.\n\n  - If your ESP32 has connected to your WiFi router before you flash Aquacontrol to your device, it will probably connect automagically .\n  - If you try to connect to an unknown WiFi network or changed your WiFi router settings, Aquacontrol will fail to connect and start SmartConfig.\n\u003cbr\u003eIf you have no oled or tft connected, the onboard led will blink at 1Hz to show you the device is in SmartConfig mode.\n\u003cbr\u003eYou can then use the Android [Espressif SmartConfig app](https://github.com/EspressifApp/EsptouchForAndroid/releases/latest) or the Android [ESP8266 SmartConfig Android app](https://play.google.com/store/apps/details?id=com.cmmakerclub.iot.esptouch\u0026hl=nl) or the IOS [EsptouchForIOS app](https://github.com/EspressifApp/EsptouchForIOS) to setup your WiFi connection.\n- If after 5 minutes SmartConfig has not connected your device will reboot. This is a failsafe for home power outs and slow booting modems/routers.\n\n##### Note: ESP32s can only connect to a 2.4Ghz WiFi network. Connect your phone to a 2.4Ghz network before starting the SmartConfig app.\n\n##### Note 2: Since Android 9 only the latest Espressif app seems to work. Android apps now requires location access to probe WiFi.\n\n#### DHCP or static IP\n\nBy default aquacontrol will get an ip address from the DHCP server.\n\nFollow these steps to  to set a static ip address:\n\n1. Enable `SET_STATIC_IP` (set it to `true`) in `aquacontrol32.ino`.\n2. Change `STATIC_IP`, `GATEWAY`, `SUBNET`, `PRIMARY_DNS` and `SECONDARY_DNS` to the desired values.\n\n#### Log files\n\nBy default log files are not generated.\n\u003cbr\u003eThis is because log files saved on FFat could reduce the lifetime of the flash memory.\n\u003cbr\u003eSensor logging can be enabled in the web interface.\n\n#### Known issues\n\n  - SmartConfig (actually the whole esp32) does not work on 5Ghz Wifi. Make sure you try to connect to 2.4Ghz Wifi.\n  - Boards without a 4.7K pull-up on the `ONEWIRE_PIN` will in some cases display ghost sensors.\n  - The `OneWire` library that comes with the Arduino IDE does not work with esp32 MCUs. Use the [stickbreaker OneWire library](https://github.com/stickbreaker/OneWire) for troublefree temperature sensors.\n  - Some ILI9341/XPT2046 boards have their touch coordinates inverted.\n\u003cbr\u003eFor these boards you can enable `TOUCH_IS_INVERTED` (set it to `true`) in `deviceSetup.h`.\n\nNot really an issue but if your controller has a problem after flashing (no Wifi or stuck/not properly booting) reflashing after a full flash erase will solve it almost always.\n\u003cbr\u003eAlways backup your `default.aqu` in the file manager before flashing and upload it back to the controller after you succesfully flashed your controller.\n\u003cbr\u003eUse this command to erase flash (FFat INCLUDED!) in Debian based Linux:\n\u003cbr\u003e`~/Arduino/hardware/espressif/esp32/tools/esptool.py --port /dev/ttyUSBx erase_flash`\n\n#### Libraries used in web interface\n\n- [jQuery 3.4.1](https://code.jquery.com/jquery-3.4.1.js) which is [available under MIT license](https://jquery.org/license/).\n- [jCanvas 21.0.1](https://cdnjs.cloudflare.com/ajax/libs/jcanvas/21.0.1/min/jcanvas.min.js) which is [available under MIT license](https://github.com/caleb531/jcanvas/blob/master/LICENSE.txt).\n- [Google Roboto font](https://fonts.google.com/specimen/Roboto) which is [available under Apache2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).\n\n#### The test hardware\n\n\u003ca href=\"https://user-images.githubusercontent.com/24290108/33763793-1df0fe98-dc12-11e7-82a5-853e5a1d07d1.JPG\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/24290108/33763798-2385a69c-dc12-11e7-81c4-2429f2fb88fd.JPG\" height=\"320\" width=\"512\" \u003e\u003c/a\u003e\n\n#### This program is beerware.\n\nI develop Aquacontrol32 in my spare time for fun.\nAlthough I like to code, my afk time is equally important.\nIf you like the project, you could buy me a beer for some moral support.\n\n[![paypal](https://www.paypalobjects.com/en_US/NL/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=MSP53ANQ3VV6J)\n\n````\nMIT License\n\nCopyright (c) 2017 Cellie\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n````\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelliesprojects%2Faquacontrol32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcelliesprojects%2Faquacontrol32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelliesprojects%2Faquacontrol32/lists"}