DIY ALK Monitor + Dosing

Justin Ranke

Active Member
Market
Messages
77
Reaction score
241
Location
Acworth
Hey Guys,

So first off I want to make it clear that I have no Idea what I am doing.

A few weeks ago I came across a post on another reefing Forum of a individual that created his own DIY Reef Monitor. After reading through the post, I thought the idea was extremely interesting and I wanted to give it a shot. I have a background in the ATM Industry and used to manage a small tech repair center, so I have a basic knowledge of electronic components and how they all function. I built a DIY PH Monitor and overall that seemed to work perfectly fine, so I figured why not give it a shot and put my limited knowledge to the test. Everything I know about electronic components is self-taught, and I have received 0 training.

My Goal: To create a Alkalinity Monitor that records ALK 4 Times a Day and sends me email notifications of the results collected. Once I get this device functional, I plan to incorporate a 2 part dosing unit that will dose 2 part based off the results it collects. I will be using AI to help design, code, and troubleshoot the entire process, and to showcase some of the capabilites of implementing AI for DIY Projects.

I am on no Timeframe to get this done, so there may be some weeks I have multiple updates, and there are going to be some weeks where I may not work on it all. My schedule is pretty busy, however I really wanted to document this process because I thought others may find it interesting!

For anybody that is thinking about trying this themselves my recommendation is wait until I finish before starting your own. I will be posting by trial and error, so im sure there will be mistakes in the process.

Lets see how this goes!
 
I wouldn't mind having a digital pH monitor I can drop in my freshwater tanks to take reading from. I have a little pen device, but the calibration routine is such a pain I don't usually bother with it, and just use test strips, since if I'm testing pH, I might as well get a read on everything else while I'm at it.

I'm fortunate to have an Apex, so I don't need an Alk monitor, but I'm still very interested to see how this plays out, and what else could be done with it. Presuming you're going to run it thru a Raspberry Pi?
 
I wouldn't mind having a digital pH monitor I can drop in my freshwater tanks to take reading from. I have a little pen device, but the calibration routine is such a pain I don't usually bother with it, and just use test strips, since if I'm testing pH, I might as well get a read on everything else while I'm at it.

I'm fortunate to have an Apex, so I don't need an Alk monitor, but I'm still very interested to see how this plays out, and what else could be done with it. Presuming you're going to run it thru a Raspberry Pi?

I actually have a Apex as well! I hated the constant troubleshooting I had to do, and once I upgraded it was a nightmare trying to get it set up again. It never read consistently for me. And I cant fork out another 600 for a Trident...

Not running it through Raspberry PI. All we be done through Arduino IDE.



 
Well, as I recently said in a post on another forum, based on my experience in the oil & gas industry, you should never rely absolutely on a single gauging system - having a secondary never hurts, to be sure.
 
Would love to contribute / collaborate. Are you planning on using a titration test or something else to measure ?

For sure!

titration seems like the way to go from what I have been reading. That method is very common so I have been able to find more documentation on how it operates.
 
Its basically calorimetry aka the reagent causes a color shade change in the media. This is read by a color sensor (software has the calibration hard-coded in a table).
I think the trident is doing exactly what the hanna test is doing (perhaps a different equation/reagents), but automated using dosing pumps etc.

Best I understand what that would take :
- will need to research the chemical reaction (I don't know the exact equation or reagents used but, I am sure someone on the forum knows).
- will need the dosing pumps etc. to mix the sample & reagent - the plumbing
- color sensor (pi has one that should work)
- code/software that will run on the pi that controls the plumbing/electronics and does the calcs.

Have you scoped out aliexpress etc. to see if they have a 4 way micro dosing pump ? That will be a key component to source and likely the most expensive.

The above is vastly oversimplified. The devil is of course in the detail i.e. the software/integration or getting all the components to work together.
Eg. even with the Trident, I realized why the feed tube is an exact "fixed" length and cannot be cut.

I have a ton of Pi sensors/eletronics tinkering stuff that you are welcome to. My day job is software.
 
Last edited:
Its basically calorimetry aka the reagent causes a color shade change in the media. This is read by a color sensor (software has the calibration hard-coded in a table).
I think the trident is doing exactly what the hanna test is doing (perhaps a different equation/reagents), but automated using dosing pumps etc.

Best I understand what that would take :
- will need to research the chemical reaction (I don't know the exact equation or reagents used but, I am sure someone on the forum knows).
- will need the dosing pumps etc. to mix the sample & reagent - the plumbing
- color sensor (pi has one that should work)
- code/software that will run on the pi that controls the plumbing/electronics and does the calcs.

Have you scoped out aliexpress etc. to see if they have a 4 way micro dosing pump ? That will be a key component to source and likely the most expensive.

The above is vastly oversimplified. The devil is of course in the detail i.e. the software/integration or getting all the components to work together.
Eg. even with the Trident, I realized why the feed tube is an exact "fixed" length and cannot be cut.

I have a ton of Pi sensors/eletronics tinkering stuff that you are welcome to. My day job is software.

So I will be using a Titration Method, however, the actual process I am going to use is slightly differant than what you provided. I am going to be taking 100ml of sample water and using a PH probe to monitor the test sample PH. Then I am going to be adding a acid to the solution until I hit a defined endpoint, and the Alk will be determined by calculating the amount of Acid added to the solution. I figured this would be the easiest way to go about this. The only problems I think I will have it just ensuring the PH probe stays calibrated and reads properly.

As far as the pumps go, I am going to test a few differant options. I bought some cheap pumps, and I bought some pricer ones. I am going to test through a few and then make a decision on which I will use based off of their performance!
 
So I will be using a Titration Method, however, the actual process I am going to use is slightly differant than what you provided. I am going to be taking 100ml of sample water and using a PH probe to monitor the test sample PH. Then I am going to be adding a acid to the solution until I hit a defined endpoint, and the Alk will be determined by calculating the amount of Acid added to the solution. I figured this would be the easiest way to go about this. The only problems I think I will have it just ensuring the PH probe stays calibrated and reads properly.

As far as the pumps go, I am going to test a few differant options. I bought some cheap pumps, and I bought some pricer ones. I am going to test through a few and then make a decision on which I will use based off of their performance!


Justin, perhaps I am misunderstanding, but that is ph that you are describing. Alkalinity as talked about in the reefkeeping community is the buffer capacity (hardness as measured in dkh, relates to carbonate hardness) etc.
 
Last edited:
Its basically calorimetry aka the reagent causes a color shade change in the media. This is read by a color sensor (software has the calibration hard-coded in a table).
I think the trident is doing exactly what the hanna test is doing (perhaps a different equation/reagents), but automated using dosing pumps etc.

Best I understand what that would take :
- will need to research the chemical reaction (I don't know the exact equation or reagents used but, I am sure someone on the forum knows).
- will need the dosing pumps etc. to mix the sample & reagent - the plumbing
- color sensor (pi has one that should work)
- code/software that will run on the pi that controls the plumbing/electronics and does the calcs.

Have you scoped out aliexpress etc. to see if they have a 4 way micro dosing pump ? That will be a key component to source and likely the most expensive.

The above is vastly oversimplified. The devil is of course in the detail i.e. the software/integration or getting all the components to work together.
Eg. even with the Trident, I realized why the feed tube is an exact "fixed" length and cannot be cut.

I have a ton of Pi sensors/eletronics tinkering stuff that you are welcome to. My day job is software.
FWIW, based on what I've read and heard, I'd be hesitant to dose automatically based purely off of what another system is telling me, unless that system has backups to compare reading against.

Look at avionics design, it's never just a single sensor (or SHOULDN'T be) reporting data, if that data is to be actioned on by another automated system.

You'd need some tight coding around safeguards like how to deal with non-normal conditions and averaging readings over time, maximum dosing at any one time, alarm conditions, sensor agreement and re-testing out-of-range results, etc.

Also, never ever use negative boolean logic in systems/software that will be used for taking actions: "NOT" statements have a nasty habit in returning false-positive or false-negative results.

My day job is visibility, control and automation of enterprise IT networks at speed and scale.
 
Justin, perhaps I am misunderstanding, but that is ph that you are describing. Alkalinity as talked about in the reefkeeping community is the buffer capacity (hardness as measured in dkh, relates to carbonate hardness) etc.

Im not the best at writing, so hopefully ChatGPT can sum this up better than me.... This is how I will determine the DKH using PH Probe and Acid.

Step-by-Step Process

  1. Collect a Known Volume of Tank Water
    • Typically, 50 mL or 100 mL for accurate measurements.
  2. Slowly Add a Known Concentration of Acid
    • Reagent: Hydrochloric Acid (HCl) or Sulfuric Acid (H₂SO₄).
    • Concentration: 0.1N HCl (or 0.01N for better precision).
    • Dosing: Use a syringe or a peristaltic pump to add small, controlled amounts of acid to the sample.
  3. Monitor the pH Change Using a pH Probe
    • The goal is to find the volume of acid required to bring the pH down to 4.5, which is the titration endpoint.
  4. Calculate the Alkalinity (dKH)
    • The amount of acid added tells us how much buffering capacity (alkalinity) the water has.
    • Use the following formula:
    dKH=(Volume of Acid in mL)×(Acid Normality)×50Sample Volume in mLdKH=Sample Volume in mL(Volume of Acid in mL)×(Acid Normality)×50
    • For example, if you titrate 100 mL of tank water using 1.5 mL of 0.1N HCl, the calculation is:
    dKH=(1.5)×(0.1)×50100=0.75×50=7.5dKHdKH=100(1.5)×(0.1)×50=0.75×50=7.5dKH
 
FWIW, based on what I've read and heard, I'd be hesitant to dose automatically based purely off of what another system is telling me, unless that system has backups to compare reading against.

Look at avionics design, it's never just a single sensor (or SHOULDN'T be) reporting data, if that data is to be actioned on by another automated system.

You'd need some tight coding around safeguards like how to deal with non-normal conditions and averaging readings over time, maximum dosing at any one time, alarm conditions, sensor agreement and re-testing out-of-range results, etc.

Also, never ever use negative boolean logic in systems/software that will be used for taking actions: "NOT" statements have a nasty habit in returning false-positive or false-negative results.

My day job is visibility, control and automation of enterprise IT networks at speed and scale.

Yes, I plan to program it in a way that it will only dose if the results fall within a specific range. anything that deviates too much, the dosing unit will turn off and notify me to manually test the tank.i have a few ideas of some safeguards to implement to prevent the system for overdosing.

As far as the code goes, I do not know a single thing about writing code. Anytime I have needed to, I have just used AI to write it for me, and then I test and make revisions. Worked well for me so far, but who knows how it will go this project.
 
Last edited:
using a known acid and titrating to a specific PH level is the right way to do this.

The color based tests are doing this exact thing.

Your challenge is going to be PH probe calibration - when I was using acid and titrating to test ALK the PH probe accuracy and dependency was the weak point. Keeping everything clean enough to not alter results is another small challenge I was worried about. Using as large of a water sample as possible can help reduce some of those challenges I believe but you would need to balance waste as well. TBH - when I used the acid method manually I would just throw it back in to the tank - but that was a couple hundred MLs back in to about a 600 gallon total volume system and I wasn't doing it more than about 2x a week.

Have you considered looking at Atlas Scientifics kits, boards & probes? They have most of what you need off the shelf and will get you a good way done with code from their docs - including dosing pumps.

I would not consider using this to update dosing until you've run it for several months in testing or demo mode (where it's not making changes).
 
Last edited:
Justin, perhaps I am misunderstanding, but that is ph that you are describing. Alkalinity as talked about in the reefkeeping community is the buffer capacity (hardness as measured in dkh, relates to carbonate hardness) etc.
alk tests that change color are actually PH based - the reagent changes color based on PH levels and there is a formula that calculates ALK
 
using a known acid and titrating to a specific PH level is the right way to do this.

The color based tests are doing this exact thing.

Your challenge is going to be PH probe calibration - when I was using acid and titrating to test ALK the PH probe accuracy and dependency was the weak point. Keeping everything clean enough to not alter results is another small challenge I was worried about. Using as large of a water sample as possible can help reduce some of those challenges I believe but you would need to balance waste as well. TBH - when I used the acid method manually I would just throw it back in to the tank - but that was a couple hundred MLs back in to about a 600 gallon total volume system and I wasn't doing it more than about 2x a week.

Have you considered looking at Atlas Scientifics kits, boards & probes? They have most of what you need off the shelf and will get you a good way done with code from their docs.

I would not consider using this to update dosing until you've run it for several months in testing or demo mode (where it's not making changes).

Thank you for the info!

Yes the PH probes are always the biggest problems with these types of things. I found the best way to get accurate readings is when calibrating, always use Calibration fluids that are the same temp as the sample water. Temp Fluctuations will always throw off the readings. Keep Temp stable and swirl the probe around a little bit during calibration to free all the bubbles and that has been getting me pretty solid readings in previous project.
 
I was on this path for a little bit. DIY a decent monitoring/dosing system is well within reality these days. I actually had much better dashboards in home assistant than what apex could provide.


 
Sorry the last few months have been pretty hectic, so it delayed me getting started on this. I finally got around to starting it this week. So first official update;

So my plan of attack on getting this built is as follows
- ESP32 Controller for PH Reading
- ESP32 Controller for TEMP Reading (Only reason I am implementing this is to get stable readings on PH Probe. I find if sample water temp remains stable, the PH Probe will read consistently)
- Arduino Controller for LCD, Touch, and Motor Control (May switch to a ESP32 not sure 100% on this one yet.)

Going to Code everything in Arduino IDE,

Step 1: PH Probe Controller.

This step is going to be pretty simple. The only goal here is to get a consistent PH Reading. The rest of the coding will be done later when the Menu is all set up. I just want the reading to remain consistent since it's going to be the backbone on how the ALK Monitor Functions. If the reading is fluctuating too much I will get incorrect readings on ALK.

To build this I am using the following supplies.

- ESP32 Dev Module (Seems to be 2 versions of this a 3.3V and a 5V, I am using the 5v)
- Protoboard (Going to solder some connectors for the pH Probe and Button)
- DH Robot PH Board 5v
- Cheap Amazon PH Probe
- Push Button

I am using the Following Pinout for Soldering the Circuit board

PH Board - 5v, Gnd, P34
Button - P4, GND

The only function of this PCB is to get an accurate reading and send results to the Main PCB. Added the button because I figured it would be an easy way to maybe make a "Pairing Button" or some sort of feature to calibrate the Probe. Not sure 100% yet, but figured it would be nice to have once I figure everything out. Pics incoming of the PCB, but attached below are the screenshots of the testing. As far as I know, the readings look to be accurate enough. I will know down the road once I calibrate and can test if its holding calibration over time. Seems as Voltage is remaining consistent, and so is the Reading. Will actually code the remainder once I figure out how I am going to configure the rest of the Monitor. But I think for now this is a good start

Screenshot of the results of the PH Probe Readings. Seems to be functioning as expected. Will upload code once I have everything more defined.
 

Attachments

  • Screenshot 2025-09-08 at 6.18.52 PM.png
    Screenshot 2025-09-08 at 6.18.52 PM.png
    656.7 KB · Views: 2
Here is the Photo of the PH Module. I will eventually design an Enclosure for it in AutoCad and 3D Print it, but most likely going to wait until I figure out the rest if the components that I will be using before trying to draft anything together.
 

Attachments

  • unnamed.jpg
    unnamed.jpg
    289.4 KB · Views: 2
Next I am trying to figure out the best way to go about putting together the main controller module. I figured the easiest way to get this all functioning together properly is configuring a Main Menu and its options, and then coding together every command for each menu item (Calibration Options Etc)

I am going to use the following supplies;

- 20x04 LCD with I2c Board
- Adafruit Rotary Encoder
- Push Button (Menu Select)
- Arduino r3 or R4 Controller or Possibly another ESP32 Not sure yet.

Im going to get everything together and will update with pics and the Menu Code in the next few days most likely.
 
Back
Top