DIY Alkalinity Monitor

Discussion in 'Do It Yourself (DIY)' started by cgaubuchon, Mar 11, 2018.

  1. cgaubuchon

    cgaubuchon Active Member

    Joined:
    Dec 1, 2014
    Messages:
    276
    Likes Received:
    52
    Location:
    Boston, MA
    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.
     

  2. hybridazn

    hybridazn Acro killer..... Staff Member Team R2R R2R Supporter 3RMAS Member R2R Excellence Award Photo of the Month Award Showcase Editor Build Thread Contributor Partner Member 2018

    Joined:
    Apr 29, 2010
    Messages:
    7,664
    Likes Received:
    8,843
    Location:
    Grapeville PA
    Interesting. Following along
     
    Ranjib likes this.
  3. peterj66

    peterj66 Member

    Joined:
    Mar 18, 2016
    Messages:
    60
    Likes Received:
    31
    Location:
    Malmoe, Sweden
    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.
     
    rstrann and Ranjib like this.
  4. Caswal

    Caswal Member Build Thread Contributor

    Joined:
    Mar 11, 2018
    Messages:
    43
    Likes Received:
    58
    Location:
    Wellington, New Zealand
    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?
     
    Ranjib likes this.
  5. cgaubuchon

    cgaubuchon Active Member

    Joined:
    Dec 1, 2014
    Messages:
    276
    Likes Received:
    52
    Location:
    Boston, MA
    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 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.
     
    Ranjib likes this.
  6. peterj66

    peterj66 Member

    Joined:
    Mar 18, 2016
    Messages:
    60
    Likes Received:
    31
    Location:
    Malmoe, Sweden
    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.
     
    Ranjib likes this.
  7. MaddyP

    MaddyP 'Til Reefdom Come... R2R Supporter R2R Excellence Award SCMAS Member Build Thread Contributor Partner Member 2018

    Joined:
    Jul 21, 2016
    Messages:
    1,348
    Likes Received:
    3,479
    Location:
    San Pedro, CA
    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.
     

    Attached Files:

    Ranjib likes this.
  8. cgaubuchon

    cgaubuchon Active Member

    Joined:
    Dec 1, 2014
    Messages:
    276
    Likes Received:
    52
    Location:
    Boston, MA
    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.
     
    Ranjib likes this.
  9. cgaubuchon

    cgaubuchon Active Member

    Joined:
    Dec 1, 2014
    Messages:
    276
    Likes Received:
    52
    Location:
    Boston, MA
    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
     
    Ranjib and MaddyP like this.
  10. MaddyP

    MaddyP 'Til Reefdom Come... R2R Supporter R2R Excellence Award SCMAS Member Build Thread Contributor Partner Member 2018

    Joined:
    Jul 21, 2016
    Messages:
    1,348
    Likes Received:
    3,479
    Location:
    San Pedro, CA
    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...
     
    Ranjib likes this.
  11. MaddyP

    MaddyP 'Til Reefdom Come... R2R Supporter R2R Excellence Award SCMAS Member Build Thread Contributor Partner Member 2018

    Joined:
    Jul 21, 2016
    Messages:
    1,348
    Likes Received:
    3,479
    Location:
    San Pedro, CA
    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 likes this.
  12. Caswal

    Caswal Member Build Thread Contributor

    Joined:
    Mar 11, 2018
    Messages:
    43
    Likes Received:
    58
    Location:
    Wellington, New Zealand
    Ranjib likes this.
  13. MaddyP

    MaddyP 'Til Reefdom Come... R2R Supporter R2R Excellence Award SCMAS Member Build Thread Contributor Partner Member 2018

    Joined:
    Jul 21, 2016
    Messages:
    1,348
    Likes Received:
    3,479
    Location:
    San Pedro, CA
    Very interesting!
     
    Ranjib likes this.
  14. Greenstreet.1

    Greenstreet.1 Valuable Member

    Joined:
    Oct 16, 2013
    Messages:
    5,180
    Likes Received:
    2,507
    Location:
    Li New York
    Following. Very interesting.
     
    Ranjib likes this.
  15. SteadyC

    SteadyC Active Member

    Joined:
    Jun 9, 2015
    Messages:
    235
    Likes Received:
    129
  16. Ranjib

    Ranjib Valuable Member R2R Supporter Reef Squad R2R Excellence Award Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    2,935
    Likes Received:
    4,148
    Location:
    Foster City, Bay Area
  17. Ranjib

    Ranjib Valuable Member R2R Supporter Reef Squad R2R Excellence Award Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    2,935
    Likes Received:
    4,148
    Location:
    Foster City, Bay Area
    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.
     
  18. SteadyC

    SteadyC Active Member

    Joined:
    Jun 9, 2015
    Messages:
    235
    Likes Received:
    129
    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. ;)
     
  19. MaddyP

    MaddyP 'Til Reefdom Come... R2R Supporter R2R Excellence Award SCMAS Member Build Thread Contributor Partner Member 2018

    Joined:
    Jul 21, 2016
    Messages:
    1,348
    Likes Received:
    3,479
    Location:
    San Pedro, CA
    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
     
    rstrann and Greenstreet.1 like this.
  20. SteadyC

    SteadyC Active Member

    Joined:
    Jun 9, 2015
    Messages:
    235
    Likes Received:
    129
    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: Mar 13, 2018
    MaddyP and monkiboy like this.
Draft saved Draft deleted

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
Loading...