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.
Advertisement
Get started with Raspberry Pi – everything you need to know to start your journey!
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
Get started with Raspberry Pi in Raspberry Pi Official Magazine 161
There’s loads going on in this issue: first of all, how about using a capacitive touch board and Raspberry Pi 5 to turn a quilt into an input device? Nicola King shows you how. If you’re more into sawing and drilling than needlework, Jo Hinchliffe has built an underwater rover out of plastic piping and […]
Read more →
Win one of three DreamHAT+ radars!
That’s right, an actual working radar for your Raspberry Pi. We reviewed it a few months ago and have since been amazed at some of the projects that have used it, like last month’s motion sensor from the movie Aliens. Sound good? Well we have a few to give away, and you can enter below. […]
Read more →
RP2350 Pico W5 review
It’s Raspberry Pi Pico 2, but with a lot more memory
Read more →