Warning! Electricity & water: Take extra care when combining electricity and water in a project: the two should be kept well apart!
Pump it up
A pump pushes water from a reservoir (children’s paddling pool) through PVC piping attached to water solenoids connected to sprinkler tubing pointed up in the air. A Raspberry Pi controls the solenoids, creating the effect of water jetting out in sync with the music being played.
“A total of eight solenoids were connected back to a mechanical relay, which in turn was controlled by Raspberry Pi,” says Nick. Seven out of the eight solenoids were connected to brass reducers to fit into garden sprinkler tubing. The eighth solenoid was a pressure control (relief) valve, which was used to control back pressure in the system.
“When I wanted to ‘fire’ one of the seven solenoids to shoot water, Raspberry Pi would close the pressure solenoid,” explains Nick. This built up pressure in the PVC pipe, at which time Raspberry Pi would trigger a relay to open the desired solenoid so a jet of water would shoot out. “This was required to get any distance with very little water. I also didn’t want to burn out the pump, so the relief valve was open when no other solenoid was open.”
The music is synchronised to the solenoid firing by using FFT (fast Fourier transform) analysis performed on the audio in real-time. “I wrote a sequencer in Python to perform the analysis and determine which solenoids to turn on and off, based on a config file which maps high fidelity signals (bass, mid-range, etc.) to particular solenoids or solenoid groups,” says Nick. “In summary, you just put WAV files in a songs directory and start the Python code, which did all the heavy lifting in real-time.”
One technical challenge was solving the timing discrepancy between the solenoid firing water and the musical note being heard by the audience. “The water had to be shot out of the jets approximately 600 ms ahead of the audio for the water to appear to be in sync with the music.”
Another issue was safety, as mixing water and electricity can be hazardous. “The power for the system was a 12 V automotive battery,” reveals Nick, “so I used fuses to protect things, just as you would find in a family vehicle. I also tried to keep the dangerous gear out of reach of the general public.”
Everything went well on the day, albeit with a few bugs: “There were certain sequences of musical notes where the FFT analysis would produce changes too rapidly for the back pressure and corresponding solenoid firing to produce much of a water jetting effect.” The result was a variance in water height from song to song.
“I rode on the float during the parade, so the public reaction was the most rewarding part of the project for me,” he adds. “After people figured out what they were looking at, the responses ranged from laughter to astonishment. The public response made my day and all the efforts of the team worthwhile!”