DIY my Dose — Open source dosing controller built on ESP32 + Home Assistant

  • Thread starter Thread starter Takapa
  • Start date Start date
  • Tagged users Tagged users None

Takapa

New Member
View Badges
Joined
Apr 3, 2025
Messages
10
Reaction score
23
Location
France
What state or country do you live in
Other International
Rating - 0%
0   0   0
Hi everyone,


I'd like to share a project I've been working on for my reef tank: DIY my Dose, an open source 4-pump peristaltic dosing controller built on ESP32 + ESPHome + Home Assistant. The entire system runs on Home Assistant — locally, with no cloud dependency of any kind.

20260305_170854.jpg



Background


I've been reefkeeping for a while and always struggled to justify the cost of commercial dosing pumps — not just the price, but the dependency on manufacturer clouds and proprietary apps. When a company pivots or discontinues support, your hardware becomes a paperweight. I wanted something I fully own and control, forever.


The hardware wiring is based on an excellent build published on Joy-Reef.com — full credit to them for the electronics design. DIY my Dose is a complete software rewrite on top of that foundation, replacing the original Arduino + cloud setup with a fully local ESP32 + ESPHome + Home Assistant stack.


Background


I've been reefkeeping for a while and always struggled to justify the cost of commercial dosing pumps — not just the price, but the dependency on manufacturer clouds and proprietary apps. When a company pivots or discontinues support, your hardware becomes a paperweight. I wanted something I fully own and control, forever.


The hardware wiring is based on an excellent build published on Joy-Reef.com — full credit to them for the electronics design. DIY my Dose is a complete software rewrite on top of that foundation, replacing the original Arduino + cloud setup with a fully local ESP32 + ESPHome + Home Assistant stack.


What it does


  • 4 independent peristaltic pumps — each with its own name, color, schedule and calibration
  • Automatic dosing with configurable time windows (start/end) or full 24h clock-aligned mode
  • Real flow rate calibration per pump (ml/s) — duration calculated automatically
  • Chemical compatibility matrix — set minimum delays between any pump pair (e.g. Ca and Kh never dose simultaneously)
  • Tank level tracking per pump — remaining volume, %, days remaining, low level alerts
  • Statistics — daily / weekly / monthly / yearly volumes + missed dose tracking
  • Push notifications via Home Assistant mobile app (pump offline, low tank, missed dose)
  • Simulation mode — test your full dosing schedule without running the pumps
  • Hardware safety — ESP32-side auto-cutoff timeout per pump, HA watchdog (soft + hard level), dose lock watchdog
  • 100% local — works without internet, no cloud, no subscription

Currently running on my tank: KH, Ca, Mg and phyto — stable for months.
dashboard_control_en.png





Hardware


  • ESP32 + ULN2003 driver
  • 4x 12V peristaltic pumps
  • 12V PSU + LM2596 buck converter
  • 3D printed enclosure
20260305_171140.jpg



Software architecture5 modular YAML package files + ESPHome firmware + 4 dashboard files (desktop + mobile, French + English). Everything is configured from the dashboard — no YAML editing required after installation.


The project is open source and free:


What's coming next


  • Physical manual dose button on the enclosure
  • Local ESP32 dosing — keeps running even if Home Assistant is offline
  • Flow drift detection — the system alerts you when a pump starts aging
  • Gravimetric dosing verification — weigh each reservoir to confirm actual dose delivered
  • Master/slave support — chain multiple units for more than 4 pumps

DIY my Dose is the first piece of a larger DIY reef automation ecosystem I'm building — more to come.


👉 https://github.com/diymoica/DmDose


Currently on v0.9.9. A physical manual dose button and improved timing precision are coming in the next version.


I'd love to get feedback from fellow reefers — especially if you're already running Home Assistant. Happy to answer any questions about the build or the software.




​

 
Very nicely done....I will keep an eye out for your updates.
Doser.jpg

I built a less refined version using an email interface to change dosing. I am working on version 8 with monitoring and controlling via a app on my phone. The new version is part of a larger project tying together multiple ESP32 and ESP8266NodeMCU boards with other sensors such as water levesl, ph, temp, salinity plus tracking manual test results.

I am always looking to learn what others are doing and see what I could have done better.
 
Hello,

From an electronic standpoint, my dosing pump is really simple.

For now, I'm focusing much more on the software side.
I have a lot of new features coming up; the next step involves safety measures, including actions that prevent the pump from emptying the container in the event of a Wi-Fi outage.
I also want to make it controllable via Bluetooth if the Wi-Fi connection doesn’t come back.
I’ve also designed it so that it continues dispensing (with hardware protection) if it can no longer communicate with Home Assistant.

Next, there will be a better interface with more stats available and many new improvements to come, such as pairing with a second dosing pump to work either in tandem or autonomously.
I’ve already started working on a new electronic version of the pumps without the ULN2003. Adding buttons to trigger doses, revising time management without a connection, etc...

My DmDose project is part of a much larger project called DiyMoiCa (DmC) in French (which could be translated as “Make it for me”)
There will be LED control (DmLed), stirrer control (DmAgitateur), temperature control (DmTemp), pH control (DmPh), etc...

Each module can be used independently or integrated into the DmC ecosystem.
I’m aiming for a comprehensive management system for my aquarium that runs without the cloud and is 100% local, using just a HomeAssistant hub.

I hope this can help some people get started in the world of DIY.
 
Well done! I’m also tinkering with home assistant and ESP32 to do some automation (maybe continuous phyto culture and water testing?) not too familiar with YAML though, might hit you up with some questions!
 
Did you include the STL files for the pump housing?
Hello,


I never thought to include the STL files in the project.
Considering that I’m definitely not a designer and pretty bad at modeling.
But I’ll definitely give it some thought.
Maybe the community (eventually...) will one day be able to contribute more than I could.

Plus, the design is going to change soon since I’m going to add buttons, LEDs, a clock module, etc.
I’m going to redo all the electronics soon to add quite a few things because the pump isn’t doing exactly what I want right now.

But yes, I’ll share the STL files I have for now, even if they aren’t optimized for 3D printing and aren’t very pretty.
 
Hi everyone,


I'd like to share a project I've been working on for my reef tank: DIY my Dose, an open source 4-pump peristaltic dosing controller built on ESP32 + ESPHome + Home Assistant. The entire system runs on Home Assistant — locally, with no cloud dependency of any kind.

20260305_170854.jpg



Background


I've been reefkeeping for a while and always struggled to justify the cost of commercial dosing pumps — not just the price, but the dependency on manufacturer clouds and proprietary apps. When a company pivots or discontinues support, your hardware becomes a paperweight. I wanted something I fully own and control, forever.


The hardware wiring is based on an excellent build published on Joy-Reef.com — full credit to them for the electronics design. DIY my Dose is a complete software rewrite on top of that foundation, replacing the original Arduino + cloud setup with a fully local ESP32 + ESPHome + Home Assistant stack.


Background


I've been reefkeeping for a while and always struggled to justify the cost of commercial dosing pumps — not just the price, but the dependency on manufacturer clouds and proprietary apps. When a company pivots or discontinues support, your hardware becomes a paperweight. I wanted something I fully own and control, forever.


The hardware wiring is based on an excellent build published on Joy-Reef.com — full credit to them for the electronics design. DIY my Dose is a complete software rewrite on top of that foundation, replacing the original Arduino + cloud setup with a fully local ESP32 + ESPHome + Home Assistant stack.


What it does


  • 4 independent peristaltic pumps — each with its own name, color, schedule and calibration
  • Automatic dosing with configurable time windows (start/end) or full 24h clock-aligned mode
  • Real flow rate calibration per pump (ml/s) — duration calculated automatically
  • Chemical compatibility matrix — set minimum delays between any pump pair (e.g. Ca and Kh never dose simultaneously)
  • Tank level tracking per pump — remaining volume, %, days remaining, low level alerts
  • Statistics — daily / weekly / monthly / yearly volumes + missed dose tracking
  • Push notifications via Home Assistant mobile app (pump offline, low tank, missed dose)
  • Simulation mode — test your full dosing schedule without running the pumps
  • Hardware safety — ESP32-side auto-cutoff timeout per pump, HA watchdog (soft + hard level), dose lock watchdog
  • 100% local — works without internet, no cloud, no subscription

Currently running on my tank: KH, Ca, Mg and phyto — stable for months.
dashboard_control_en.png





Hardware


  • ESP32 + ULN2003 driver
  • 4x 12V peristaltic pumps
  • 12V PSU + LM2596 buck converter
  • 3D printed enclosure
20260305_171140.jpg



Software architecture5 modular YAML package files + ESPHome firmware + 4 dashboard files (desktop + mobile, French + English). Everything is configured from the dashboard — no YAML editing required after installation.


The project is open source and free:


What's coming next


  • Physical manual dose button on the enclosure
  • Local ESP32 dosing — keeps running even if Home Assistant is offline
  • Flow drift detection — the system alerts you when a pump starts aging
  • Gravimetric dosing verification — weigh each reservoir to confirm actual dose delivered
  • Master/slave support — chain multiple units for more than 4 pumps

DIY my Dose is the first piece of a larger DIY reef automation ecosystem I'm building — more to come.


👉 https://github.com/diymoica/DmDose


Currently on v0.9.9. A physical manual dose button and improved timing precision are coming in the next version.


I'd love to get feedback from fellow reefers — especially if you're already running Home Assistant. Happy to answer any questions about the build or the software.




​

A few weeks ago, I was thinking of doing a project very similar to this for the diy crowd because the commercial stuff is so expensive now. I was going to look into using as many of the cheaper, off-the-shelf components as possible to try to make a DIY ecosystem of reef equipment that people could customize however they want, with directions on how to build the items. I have more experience with the wiring and circuitry side of things than I do with the programming and whatnot, so I was going to use it to help teach me some coding.
 
A few weeks ago, I was thinking of doing a project very similar to this for the diy crowd because the commercial stuff is so expensive now. I was going to look into using as many of the cheaper, off-the-shelf components as possible to try to make a DIY ecosystem of reef equipment that people could customize however they want, with directions on how to build the items. I have more experience with the wiring and circuitry side of things than I do with the programming and whatnot, so I was going to use it to help teach me some coding.
hello,
I'm also in the process of building a complete ecosystem.

My pump is evolving by the hour.
I've recently implemented security features and am starting to fix the few bugs and issues I'm finding before moving on to a different electronic version.

Commercial hardware is indeed excessively expensive for certain components. Some brands sell overpriced smart plugs when it’s really just an on/off switch on a plug.

There are a lot of things coming soon to my “DMC” ecosystem, but first I have to rewrite libraries and other functions that don’t exist—or at least not in the way I’d like them to—natively on the Home Assistant system.
So I’m making progress bit by bit, but the best is coming soon.

I hope to finish my new interface in a few days to streamline it and make it easier to use.
I’ll present it to you as soon as possible.
 
Looks great. Here's mine - https://www.reef2reef.com/threads/diy-dosing-unit-home-assistant.1080788/#post-13137077

1775456653878.png


All my yaml, including the calibration automations are in the thread, so if there's anything useful, feel free to add it to your project. I'm using a Tuya relay but intend to move to ESP32+ESPHome as soon as I have time due to recent changes made to the Tuya ecosystem which have effected the integration.


Great, I really like your STL case design.
I'm not much of a designer, so I really appreciate it!


As for your code, I'll definitely take a look, and thanks for sharing.
We use the same pumps but different hardware. All in all, we must be using the same technology—there aren’t 36 ways to control a peristaltic pump 😁


My version 1.2 is coming soon with a new ecosystem, an interface module, and of course even more new features to come.
I’m still having a lot of trouble with my STLs; that’s what’s taking me the most time.

The design is what’s slowing me down the most. If by any chance there’s a kind soul out there who could help me with the 3D design, I’d be all for it.

I hope to share the new version with you soon; it should take the metering pump and my ecosystem to a whole new level.
 
Great, I really like your STL case design.
I'm not much of a designer, so I really appreciate it!


As for your code, I'll definitely take a look, and thanks for sharing.
We use the same pumps but different hardware. All in all, we must be using the same technology—there aren’t 36 ways to control a peristaltic pump 😁


My version 1.2 is coming soon with a new ecosystem, an interface module, and of course even more new features to come.
I’m still having a lot of trouble with my STLs; that’s what’s taking me the most time.

The design is what’s slowing me down the most. If by any chance there’s a kind soul out there who could help me with the 3D design, I’d be all for it.

I hope to share the new version with you soon; it should take the metering pump and my ecosystem to a whole new level.
I have just uploaded the stl files here
 
Hi there! Thanks for posting this. I am building a 4 doser head system right now based off the original JoyReef articles, but I got an ESP32 instead of the older ESP8266 board. What pins on the ESP32 board did you use from the ULN2003? Thanks!
 
Hi there! Thanks for posting this. I am building a 4 doser head system right now based off the original JoyReef articles, but I got an ESP32 instead of the older ESP8266 board. What pins on the ESP32 board did you use from the ULN2003? Thanks!
GPIO1 and 3 are UART
GPIO0, 2, 5, 12, 15 are strapping pins
GPIO34, 35, 36, 39 (these might not all be exposed depending on the board) are input only, so fine for sensors but not outputs
GPIO6-11 are SPI flash

Some of these can be used as outputs under certain circumstances but depending how full the board is, best to avoid them where possible.

Any other GPIO can be safely used as outputs for things like relays, transistors/mosfets, displays, etc
 
ESP32 + ULN2003 driver
Hi Takapa,
I'm struggling at the moment with a DRV8825 driver/stepper pump and ESP32. I am also not sure if I have enough outputs left of the ESP to operate 4 stepper pumps. I connected already a temperature sensor, e-paper display, sd-card to log the temperature and some dates like birthdays for the display.

Would you mind to show us your wiring? As I can see in your picture you use one wire from the ESP for each pump only, right? That would make it much easier for me, even it is a drawback going from a stepper to a DC motor, but I'm going to use the pumps for a fertilizer dosing system in a freshwater tank, my current volumes are between 3 to 7 mL daily.

Which pumps are you using? I guess I found your URL driver, but it is always shown as a stepper driver. I am not an electrician but the URL chip it self looks like a darlinton transistor.

Thanks
 
I have just uploaded the stl files here
I like your design a lot but I don't know how to relocate the bottom side rails in order to fit in a Sonoff 4CH R3 Pro inside. I am just a beginner with Fusion 360. Do I need the "source file" in order to be able to do that? Thank you.
 
The design is what’s slowing me down the most. If by any chance there’s a kind soul out there who could help me with the 3D design, I’d be all for it.
I would say I can help with 3D design/Fusion360 if still needed. What do you want?
 
great idea, i have the joyreef 4 head doser built and was running on there older cloud software but now on the newer version, it works well but could be better.. your project sounds like what I could be missing.. I use home assitant for most if not all of my reef tank controls and automations and home stuff.. anything i can do to help or have you made a youtube videos showing the project..
 
Nice!

I was looking at the repo and would like to contribute. Before getting my hands into the the dmd_* files, would you be interested in a PR with Spanish translations?
 
great idea, i have the joyreef 4 head doser built and was running on there older cloud software but now on the newer version, it works well but could be better.. your project sounds like what I could be missing.. I use home assitant for most if not all of my reef tank controls and automations and home stuff.. anything i can do to help or have you made a youtube videos showing the project..
I was debating moving to the new software next week. You're not a fan?
 

TOP 10 Trending Threads

HOW WOULD YOU FEEL ABOUT RECEIVING A FISH OR CORAL AS A HOLIDAY GIFT?

  • I’d love one, as long as it’s a species I chose

    Votes: 31 24.0%
  • I’d trust someone who knows my tank to choose

    Votes: 11 8.5%
  • I’d rather get a gift card and pick it myself

    Votes: 47 36.4%
  • I’d prefer gear or supplies instead

    Votes: 6 4.7%
  • Please don’t surprise me with livestock

    Votes: 34 26.4%
  • Other (Post in the comments)

    Votes: 0 0.0%
Back
Top
Home
Post thread…
Market
What's new