DIY Alkalinity Monitor

certain_code

Active Member
View Badges
Joined
Dec 1, 2014
Messages
412
Reaction score
135
Location
San Diego
Rating - 0%
0   0   0
Hey everyone!

There has been a lot of talk these days about the options of automated Alkalinity monitors. The benefits of these is easily seen but the price tag, other required controllers, and honestly the looks of some of the options out there have me reluctant to invest quite yet.

So I got to thinking, and since I already have some experience with Arduino/RaspberryPi and all sorts of components, could I make one myself? I have not taken the time to really try and figure out how the current market devices are doing their calculations but assume it's something similar to what I am trying for here considering it's a (seemingly) common scientific process. There was a R2R article actually by Randy from way back in 2015 in fact on how you can do this.

So it begins....

General project plan:
- The process is to essentially take a ph reading of regular tank water, add a standard acid until ph reaches a set level. Once the pH level is reached, perform a calculation to get an outcome of the tank dKH/ppm of Alkalinity.
- So, given the method above, here is how I envision this working.
  1. Peristaltic pump (1) pumps in sample tank water to a glass container. Amount pumped in is determined by a IR sensor that detects each drop and calculates volume based on drop numbers.
  2. pH probe is positioned to read the sample tank water as the container is filled. Likely waiting for a few minutes to take a level reading.
  3. Peristaltic pump (2) pumps in a basic acid while pH probe monitors the sample. Again, the amount pumped in is determined by a IR sensor that detects each drop and calculates volume based on drop numbers.
  4. Once the pH reaches the desired level, do the required math to determine dKH.
  5. Once dKH is determined, peristaltic pump 3 pumps out the water from the container and pumps in tank water as a 'flush' of the container.
  6. Once the container has been flushed, Peristaltic pump (1) fill the container to keep the pH probe wet. Depending on testing, this might happen from time t0 time to compensate for evaporation.

Still Unknown
  1. How much is the minimal amount of wasted water to avoid constantly emptying a waste container.
  2. How fast can I run the tests. This is going to depend on how fast I can pump water in while still counting individual drops accurately with the IR sensor. Most pumps also have a minimum speed before the stop pumping liquid so hopefully that will not also become a problem.
  3. How to properly drain the container, right now I am thinking a metal syringe tip position as close to the bottom as possible. As a backup, I might look at using a container with a bottom hole but my thinking is that might affect sample accuracy since liquid would be in the pump line. Perhaps this alternative way could eliminate the need for the 3rd pump.

Wiring Diagram

This is my initial wiring thinking. I am certainly no electrical engineer so will be looking for feedback on this and likely will find someone smarter than I to give final okay on this. Until final approval from someone more qualified than I happens, you assume all risk using this long term for the time being. Remember, water and electricity are dangerous in combination. If you want to help out in the earlier days of this project, great, just please be smart about it.

Seshat-Alk-Monitor.png


Licensing
I'm a huge fan of community development of products. So beyond hoping that some experts here will help with the project itself, I want others to learn and build on top of it as well. Because of this, I am starting under the Creative Commons BY-NC-SA 4.0 license.

Put simply, use and remix as you see fit but give those who helped make this happen credit. And you, nor I, can make money off the project directly.
 

peterj66

Community Member
View Badges
Joined
Mar 18, 2016
Messages
94
Reaction score
72
Location
Malmoe, Sweden
Rating - 0%
0   0   0
At point 3 : instead of detecting drops you could simply calibrate the peristaltic pump so you know the amount pumped per minute. The time needed to run the pump to reach the desired pH is then used to calculate the amount of acid added.
 

Caswal

Community Member
View Badges
Joined
Mar 11, 2018
Messages
43
Reaction score
64
Location
Wellington, New Zealand
Rating - 0%
0   0   0
I am not an electronics expert either, but wouldn't you want some flyback diodes on the transistors for the back emf of the peristaltic pumps?

I would also be tempted to maybe make it using something simpler as a microcontroller, e.g. Like an Arduino Micro, and tie it in with Ranjib's reef-pi. Communication to the Pi over i2c or UART. Have it handle all the logging and graphing.

Crazy idea, maybe have the sample container connected to a spring solenoid, so you can give it a shake?
 
OP
OP
certain_code

certain_code

Active Member
View Badges
Joined
Dec 1, 2014
Messages
412
Reaction score
135
Location
San Diego
Rating - 0%
0   0   0
At point 3 : instead of detecting drops you could simply calibrate the peristaltic pump so you know the amount pumped per minute. The time needed to run the pump to reach the desired pH is then used to calculate the amount of acid added.

Yeah, but honestly I think the drop counting will be more accurate and prevent the need to have people buy more expensive pumps. With counting the drops my thought is that I will know that 50 drops will likely always equal the same (or really close to) water level. This would also mean that the only calibration needed would be the Ph probe, which would happen just like the one most folks already have on their tanks.

I am not an electronics expert either, but wouldn't you want some flyback diodes on the transistors for the back emf of the peristaltic pumps?

I would also be tempted to maybe make it using something simpler as a microcontroller, e.g. Like an Arduino Micro, and tie it in with Ranjib's reef-pi. Communication to the Pi over i2c or UART. Have it handle all the logging and graphing.

Crazy idea, maybe have the sample container connected to a spring solenoid, so you can give it a shake?

I will have to look into the diodes, not an EE and not super familiar with them. Thanks for the suggestion.

Plan for the controller is to use a Particle Photon for development. It allows for over the air updates, has enough connections to expand on, has built in WiFi, and is pretty small. I am building mine with a small OLED for now but also like the idea of using a BNC connection to you can just plug it into an extra pH probe port on any controller to get a reading. I think this is what GHL or Apex is doing with their Alk monitors? I honestly have not looked into it yet as controller integration is low on the priority list at the moment and can be added easily later.

I was thinking of how I can mix the solution, if needed. My first approach is going to be trying without any mixing and see how results are. If I need to mix the solutions then I will look into the magnet stirrers that use a little magnet "pill" and a a small motor to spin it. Trying to keep the part list down though so hoping that no mixing is needed.
 

MaddyP

'Til Reefdom Come...
View Badges
Joined
Jul 21, 2016
Messages
1,907
Reaction score
4,530
Location
Vancouver, WA
Rating - 0%
0   0   0
Great project! I'll be following along.

I have been considering a alkalinity monitor myself, though I think the PH probe method could be prone to many issues. You might find this document from the EPA interesting, though it details a different method to measuring alkalinity.
 

Attachments

  • Method 310.2 Alkalinity.pdf
    95.4 KB · Views: 790
OP
OP
certain_code

certain_code

Active Member
View Badges
Joined
Dec 1, 2014
Messages
412
Reaction score
135
Location
San Diego
Rating - 0%
0   0   0
Good point about calibration, I’ve never seen that solution, but after a quick Google on the matter it definitely seems doable on a budget.

Yeah, honestly, I hate calibrating my pumps so much so I made it a goal to avoid calibrating everything on this system. Still not sure if my idea will avoid calibration but if I end up just requiring pump calibration then I can certainly increase the test speed.
 
OP
OP
certain_code

certain_code

Active Member
View Badges
Joined
Dec 1, 2014
Messages
412
Reaction score
135
Location
San Diego
Rating - 0%
0   0   0
Great project! I'll be following along.

I have been considering a alkalinity monitor myself, though I think the PH probe method could be prone to many issues. You might find this document from the EPA interesting, though it details a different method to measuring alkalinity.

Pretty interesting document and idea and very impressive accuracy. Looking quickly, it seems like building an accurate color meter would be the biggest drawback here but I will look a bit more into it. I love that I essentially searched the internet using exactly that article title and never found it. Just shows how much internet there really is out there. haha
 

MaddyP

'Til Reefdom Come...
View Badges
Joined
Jul 21, 2016
Messages
1,907
Reaction score
4,530
Location
Vancouver, WA
Rating - 0%
0   0   0
Pretty interesting document and idea and very impressive accuracy. Looking quickly, it seems like building an accurate color meter would be the biggest drawback here but I will look a bit more into it. I love that I essentially searched the internet using exactly that article title and never found it. Just shows how much internet there really is out there. haha
I'm not sure the color meter would be all that difficult to build considering a working model has already been built for hobby purposes (Hanna Checkers). I believe this is the method Neptune is using for the Trident as well, although, their system uses a reaction chamber instead of a continuous flow tube.

It took many hours of research to find this document, it was hidden in a really obscure place...
 

MaddyP

'Til Reefdom Come...
View Badges
Joined
Jul 21, 2016
Messages
1,907
Reaction score
4,530
Location
Vancouver, WA
Rating - 0%
0   0   0
Upon further research, there are several arduino/rasberry pi projects documenting DIY color meters. This might be an easier method than using a PH probe. It also appears it might be a little cheaper to build.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hey everyone!

There has been a lot of talk these days about the options of automated Alkalinity monitors. The benefits of these is easily seen but the price tag, other required controllers, and honestly the looks of some of the options out there have me reluctant to invest quite yet.

So I got to thinking, and since I already have some experience with Arduino/RaspberryPi and all sorts of components, could I make one myself? I have not taken the time to really try and figure out how the current market devices are doing their calculations but assume it's something similar to what I am trying for here considering it's a (seemingly) common scientific process. There was a R2R article actually by Randy from way back in 2015 in fact on how you can do this.

So it begins....

General project plan:
- The process is to essentially take a ph reading of regular tank water, add a standard acid until ph reaches a set level. Once the pH level is reached, perform a calculation to get an outcome of the tank dKH/ppm of Alkalinity.
- So, given the method above, here is how I envision this working.
  1. Peristaltic pump (1) pumps in sample tank water to a glass container. Amount pumped in is determined by a IR sensor that detects each drop and calculates volume based on drop numbers.
  2. pH probe is positioned to read the sample tank water as the container is filled. Likely waiting for a few minutes to take a level reading.
  3. Peristaltic pump (2) pumps in a basic acid while pH probe monitors the sample. Again, the amount pumped in is determined by a IR sensor that detects each drop and calculates volume based on drop numbers.
  4. Once the pH reaches the desired level, do the required math to determine dKH.
  5. Once dKH is determined, peristaltic pump 3 pumps out the water from the container and pumps in tank water as a 'flush' of the container.
  6. Once the container has been flushed, Peristaltic pump (1) fill the container to keep the pH probe wet. Depending on testing, this might happen from time t0 time to compensate for evaporation.

Still Unknown
  1. How much is the minimal amount of wasted water to avoid constantly emptying a waste container.
  2. How fast can I run the tests. This is going to depend on how fast I can pump water in while still counting individual drops accurately with the IR sensor. Most pumps also have a minimum speed before the stop pumping liquid so hopefully that will not also become a problem.
  3. How to properly drain the container, right now I am thinking a metal syringe tip position as close to the bottom as possible. As a backup, I might look at using a container with a bottom hole but my thinking is that might affect sample accuracy since liquid would be in the pump line. Perhaps this alternative way could eliminate the need for the 3rd pump.

Wiring Diagram

This is my initial wiring thinking. I am certainly no electrical engineer so will be looking for feedback on this and likely will find someone smarter than I to give final okay on this. Until final approval from someone more qualified than I happens, you assume all risk using this long term for the time being. Remember, water and electricity are dangerous in combination. If you want to help out in the earlier days of this project, great, just please be smart about it.

Seshat-Alk-Monitor.png


Licensing
I'm a huge fan of community development of products. So beyond hoping that some experts here will help with the project itself, I want others to learn and build on top of it as well. Because of this, I am starting under the Creative Commons BY-NC-SA 4.0 license.

Put simply, use and remix as you see fit but give those who helped make this happen credit. And you, nor I, can make money off the project directly.
Great stuff.
Looks overall good to me. My advice will be not to spend a lot of time in getting the perfect circuit done. Whatever you build, it will likely go through multiple iterations before things settle down. I suspect a lot of it will involve having different calibration and validations in place.
I would consider a dual h-bridge darlington driver like l293d to drive the stepper or dc motor based peristaltic pumps. I am not sure how accurate is drop count via IR sensors, give it a shot. Using the peristaltic pump to pour measured amount is a common use, and we know that route will work, in fact some of the vendors (like atlas scientific) provide I2C interface specificallt geared towards that, just something to note.

I would also suggest using Pi over arduino. This will significantly reduce your development/iteration cycle time. Its cheaper (zero w is only 10$), and unless you need an analog input, you will have everything that you need (including two hardware backed pwm pins). Even for bare minimal testing, you 'll need to chart/analyze multiple readings, Pi and the entire linux ecosystem (python for example) will come very handy.

It will be very helpful if you keep the software under apache 2 or MIT and the hardware under openhardware licensing, that gives us (reef-pi and similar projects) an easy way to integrate with your project as well as vendor can consider this for their products without worrying for royalty. Its not a must, just a nice to have.

I have pondered about integrating a general titration module using ph/color sensors along side peristaltic pumps for reef-pi. But our current priorities are around 2.0 milestones, I hope we'll get back to this early next year or after x-mas. I hope we'll be able to use your learnings/project.

Godspeed & keep us posted. Any help I can offer around electronics/software/Pi let me know.
 

SteadyC

Active Member
View Badges
Joined
Jun 9, 2015
Messages
312
Reaction score
245
Rating - 0%
0   0   0
I am not sure if alkatronic is Raspberry Pi based. Its certainly not cheap or opensource.
On page 37, he states rasberrypi is what would be seen on the home WiFi router for connectivity, so it is. I’m just saying, there’s loads to think about, and all these things are listed in that blog, things they have thought through. Things like OS updating, high quality PH probe, pumps and accuracy of the pumps, Bluetooth, WiFi connectivity, cloud based data and access, Apex integration, automating actions to CrX reactors or dosing pumps, the reagents, and on and on. When I think about all the things that it would take to do it right, to make what I would ultimately want, all the testing and accuracy, it’s all there and done already, and buying seems like the best option. ;)
 

MaddyP

'Til Reefdom Come...
View Badges
Joined
Jul 21, 2016
Messages
1,907
Reaction score
4,530
Location
Vancouver, WA
Rating - 0%
0   0   0
On page 37, he states rasberrypi is what would be seen on the home WiFi router for connectivity, so it is. I’m just saying, there’s loads to think about, and all these things are listed in that blog, things they have thought through. Things like OS updating, high quality PH probe, pumps and accuracy of the pumps, Bluetooth, WiFi connectivity, cloud based data and access, Apex integration, automating actions to CrX reactors or dosing pumps, the reagents, and on and on. When I think about all the things that it would take to do it right, to make what I would ultimately want, all the testing and accuracy, it’s all there and done already, and buying seems like the best option. ;)
I realize you are excited about the alktronic, but this is the DIY forum. We are more interested in how to build an alkalinity monitor than buying one outright. :D
 

SteadyC

Active Member
View Badges
Joined
Jun 9, 2015
Messages
312
Reaction score
245
Rating - 0%
0   0   0
I realize you are excited about the alktronic, but this is the DIY forum. We are more interested in how to build an alkalinity monitor than buying one outright. :D
Im really making two,points here. How to build... my point is, you can learn a lot from his blog, all the things to think about... OS upgrades, Bluetooth, WiFi, PH prope, reagents, pumps, historical data, cloud connectivity, etc. all the things you will want to consider and think about in your DIY project, all the feedback and ideas that others are giving him. Great ideas and things to consider yourself. and yes, I made a second point of, when you consider all the things to think about, all the things you may want to include, it might be easier to buy.
 
Last edited:

More than just hot air: Is there a Pufferfish in your aquarium?

  • There is currently a pufferfish in my aquarium.

    Votes: 30 18.0%
  • There is not currently a pufferfish in my aquarium, but I have kept one in the past.

    Votes: 27 16.2%
  • There has never been a pufferfish in my aquarium, but I plan to keep one in the future.

    Votes: 32 19.2%
  • I have no plans to keep a pufferfish in my aquarium.

    Votes: 70 41.9%
  • Other.

    Votes: 8 4.8%
Back
Top