Aquarium dosing pump
By David Crookes. Posted
Keeping corals healthy is a tricky task. As well as requiring the right temperature and proper aquarium lighting, corals need a balanced healthy diet and extremely precise water chemistry. Joe Stiff, who keeps corals and macroalgae in 7.5-litre and 41-litre salt water tanks is fully aware of this. “Dosing various ions such as calcium and magnesium, as well as other chemicals, is necessary when taking care of corals,” he says.
Rather than pay anywhere between £80 and £500 on a commercial dosing pump, however, he decided to make one himself. By using a Raspberry Pi Pico microcontroller, along with good-quality relays and pumps, he has been able to create a driver for a fraction of the cost – just £14 in total. He has also done so without compromising. “Price wasn’t a limiting factor at all because these parts are relatively cheap,” he explains.
Nothing fishy
Although he was always keen to keep costs under £30, the main requirement was to create a device that could dose a configurable amount of chemicals accurate to within 0.5 millilitres or less. He also needed each pump to separately operate a configurable number of times each day so that different liquids could be used at different quantities.

“The doser needed to be low voltage because of its proximity to water, and I wanted it to be small and neat so that it could go near a beautiful reef tank and not look out of place,” Joe continues. “I also needed it to be repairable and easy to take apart if necessary to replace the parts. This is why I chose particular peristaltic pumps. You can take out the tubing and replace it with new tubing very easily from the front.”
Peristaltic pumps are low-maintenance and easy to sterilise. They use rollers or shoes to effectively massage a fixed amount of chemical through the tube while preventing back-flow. Sourcing the pumps and the relay took Joe a few hours. He was then able to design a case using 3D modelling software, map the wiring and electronics on paper, solder a prototype, and write the software.
Good dose
“When you buy a commercial doser, you’re stuck with the company’s proprietary software which is usually awful and painful to use, or simply doesn’t work half the time,” Joe says. “This project fit my ultimate aim which is to build everything for the aquarium myself, from the LED fixtures to the doser and temperature/pH monitoring system.”

Joe wrote the program in MicroPython and, after calibrating each of the doser’s two pumps to run at the same speed, he set it to run every 15 minutes. This allowed a small amount of calcium hydroxide to flow 96 times a day from one pump, ensuring 200 ml of the chemical would be dosed on a daily basis. The other pump was set to dose other chemicals, such as amino acids and food, when needed.
It’s certainly effective. Joe says that the Pico controls the relay, turning the pumps on and off with simple code sent via one of the GPIO pins. A few functions calculate the dosage/timing and the code just loops, sleeping in-between dosing. “My next step will be to upgrade to Raspberry Pi Pico W,” he says. “I will then write some wireless LAN code to control it via my mobile phone.”
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
Make your RAM go further – Raspberry Pi OS memory optimisation tips
In issue 164 of Raspberry Pi Official Magazine we have been playing around with the new Raspberry Pi 5 1GB RAM. While the RAM shortage caused by the demands of AI infrastructure is annoying beyond belief, this has been a great chance for us to really get to grips with RAM. Generating images in Stable […]
Read more →
Mighty Projects – 1GB Computer in Raspberry Pi Official Magazine 164
It’s normal for computers to get faster and more pwerful, but the new-ish Raspberry Pi 5 1GB is a step in the other direction: it has all the processing power and the same GPIO pins of its more costly siblings, but with only 1GB of RAM it’s at a price that’s friendlier on the wallet […]
Read more →
Win one of five 256GB Raspberry Pi Flash Drives
If you’ve been around long enough, you know that every Raspberry Pi accessory is top quality, and the latest Flash Drive is no different. Fancy a big one? We have five up for grabs, and you can enter below… Win 1 of 5 256GB Raspberry Pi Flash Drives
Read more →