A mesmerizing fusion of WLED, addressable LEDs, and water pumps to create a dynamic, pattern-driven fountain.
Software apps and online services
- WLED
Story
This project bridges the gap between artistry and technology, transforming a wooden fountain into an animated masterpiece driven by LED patterns. Using an ESP32 running WLED firmware with a custom Usermod, the fountain synchronizes 24 mini water pumps with dynamic LED animations, turning flowing water into a living light show.
At its core is a clever hardware-software integration. Patterns designed for addressable LED strips are processed by the custom firmware, where the brightness of each virtual LED pixel (green channel) is mapped to corresponding PWM signals. These signals control the pumps via a PCA9685 module, seamlessly translating light animations into synchronized water effects.
The centerpiece of the fountain is a walnut harp, featuring “strings” made of water streams illuminated by addressable LEDs. This adds a unique artistic element to the project, blending natural wood aesthetics with modern electronics.
Key features:
• Dynamic Water Effects: LED patterns control the flow of water, creating endlessly unique animations.
• Smart Connectivity: WiFi-enabled, with control through a mobile app, browser, or integration into smart home systems.
• Custom Firmware: A Usermod for WLED that enables mapping virtual LEDs to hardware like water pumps.
How to make, instruction.
Electronics.
The final version of the electronics took me about two weeks to complete, primarily due to electromagnetic interference (EMI) caused by the mini pumps. Here are some details…
At the start, I built a small proof of concept, connecting a few mini pumps through a TA6586 motor driver directly to the ESP32 controller, and everything worked smoothly.
However, when I assembled the full setup with the PCA9685, it became very unstable (freezing every 5-30 seconds). High-speed diodes and filter capacitors for pump power helped somewhat but didn’t resolve the issue.
Next, I separated the logic power supply from the pump power supply using PC817 optocouplers. This improved stability but wasn’t perfect, as occasional freezes still occurred.
In a forum, I found that the I2C bus is highly sensitive to interference. So, I tried using shielded, grounded cables with very short lengths for power and data transmission over I2C. And just like magic, this worked! For added security, I included a ferrite core and looped the cable through it.
This setup requires two separate power sources: 5V for the logic and addressable LED strip, and 12V for the harp pump, which also powers the mini pumps through a 5V DC step-down converter.
A larger version of the circuit diagram is available on GitHub.
Instead of ordering a custom PCB, I assembled the components on a 90x150 mm prototype PCB board.
Some components are optional:
• The PCF8591 ADC/DAC module can be used to connect multiple potentiometers if you want to adjust fountain parameters with them.
• The INMP441 microphone can be used to create sound-responsive light and water effects, so the fountain could react to sounds like birdsong.
• The DFPlayer mini MP3 module is an option if you want to add sound effects to the fountain’s animations.
These options are also available in the firmware.
I tested the microphone with the light and water effects, and the result was very interesting—I highly recommend trying it!
Later I added 2 x 40 pin connectors on the fountain side and electronic side for ease of assembly/disassembly.
Firmware.
For the firmware, I built upon my existing work from a previous project: Wooden Reactor Simulator Nightlight Desk Lamp Sound & Light Effects.
I made minor adjustments to account for the signal inversion caused by the optocouplers in the circuit, which I compensated for in the software.
The core of the firmware is based on WLED with a custom-developed Usermod specifically for the fountain.
This offers a variety of features and functionalities:
• Numerous built-in effects
• Control via WiFi, mobile app, and web browser
• Smart home integration
• Scheduled alarms
• And much more.
Just imagine the possibilities! You can set the fountain to turn on and off according to a schedule, change effects based on external conditions, control it from your phone, and much more.
Unfortunately, WLED doesn’t natively support some components used in this project: the PCA9685 PWM controller, PCF8591 ADC module, and DFPlayer MP3 module. Therefore, I added support for these through my usermod.
The principle for controlling the mini pumps through WLED is straightforward. I created a reflection function that maps brightness from a “virtual” addressable LED strip to PWM, routed through the PCA9685 PWM modules. In the code, I only account for the brightness of the green color channel for each pixel in the “virtual” LED strip. So, if you want to use WLED’s default effects, select green or white colors in the palette.
The necessary WLED settings are shown in the image.
If you don’t want to configure them manually, you can download the cfg.json file and upload it in the editor:
http://your_reactor_ip/edit
For effect presets, use preset.json.
The first 24 LEDs in the virtual strip control the 24 mini pumps inside the fountain.
The 25th controls the harp’s water flute pump.
I won’t go into detail on compiling/loading the firmware here, as this is well-documented on the original WLED project site.
If you wish to compile it yourself, the source code is available in my GitHub repository.
I also uploaded a precompiled binary file to the repository.
This project demonstrates how a mix of creativity and engineering can turn a concept into a functional, visually stunning piece. Detailed build instructions, source code, and schematics are available for open-source enthusiasts ready to replicate or expand on the design.
Custom parts and enclosures
Schematics
• electrical_diagram_LVQJSh0ygm.jpg
Code
• Fountain WLED Usermod sourcecode, WLED presets and config
This article was first published on Hackster on November 18, 2024
cr: https://www.hackster.io/timberrough/esp32-driven-water-animation-fountain-25434c
Author: Timber Rough