progammable kalk slurry doser

salty joe

Active member
If you have a power head lying around and a suitable container, a kalk box can be built for cheap. Here are the main components. You’ll need two 12V power supplies-one for the pump and the other for the Arduino and relays. I tried using one power supply, but every time the dosing pump turned on it kicked the Arduino to the start of the sketch. I went to the Arduino site and some very helpful people had me install a bunch of big capacitors which did nothing, then had me install a ‘flyback’ diode across the dosing pump. It helped a lot, but the sketch still got kicked to the beginning sometimes. One of the guys said, ‘This is why I always argue for a separate power supply for Arduino.’ I agree.
It’s not ridiculously loud but the dosing pump makes a bit of noise.

http://www.ebay.com/itm/Hot-DC-12V-...hash=item280d0be5aa:m:mo5T6x4GD-0pVUHBdY1ElCQ
http://www.ebay.com/itm/191100386018?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT
http://www.ebay.com/itm/221965679816?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT
http://www.ebay.com/itm/AC-100-240V...hash=item1eafb107fb:m:m5f_m7rMfY38yloXRRdVRbA

Here’s the sketch. I’m a beginner and not very skilled with computers so this took a little while, even though it’s a real simple sketch. It’s easy to change the timing and amount of dose and slurry concentration. If using kalk slurry is for you, make sure your magnesium is around 1300 first. A pH monitor is almost a must. Keep a close eye on alkalinity. If you have never touched an Arduino but are interested, I’d be glad to help you get this slurry box running. I can also help with basics like soldering.
I designed my tank to minimize power consumption, so very low evaporation was a must. Using kalkwasser for topoff only gained 0.05 points pH. Using slurry, I can easily take the current pH of 7.95 to 8.2. Mostly though, this is for the winter when pH has dropped as low as 7.67 from CO2 in the house.

The first picture is on its side, the bottom is on the right. Sorry about that. You can sorta see the powerhead that has PVC pipe glued to it as an extender.


unsigned long hoursInMs(int h)
{
return h*3600000UL; //values will be expressed in hours

}

long minutesInMs(int m){
return m*60000L; //values will be expressed in minutes

}

long secondsInMs(int s){
return s*1000L; //values will be expressed in seconds
}

void setup()
{
pinMode(3, OUTPUT); // pin 3 controls mixing pump
pinMode(4, OUTPUT); // pin 4 controls kalk slurry
}
void loop()
{

digitalWrite(4, LOW); // turn kalk slurry dosing pump off
digitalWrite(3, HIGH); // turn mixing pump on using a NO relay
delay(secondsInMs(20)); // let mixing pump run for 20 seconds, or long enough to create kalk slurry
digitalWrite(3, LOW); // turn mixing pump off
delay(minutesInMs(5)); // this delay determines slurry concentration

digitalWrite(4, HIGH); // turn kalk slurry dosing pump on using a second NO relay
delay(secondsInMs(3)); // let kalk slurry dosing pump run only briefly to prevent precipitation
digitalWrite(4, LOW); // turn kalk slurry dosing pump off
delay(secondsInMs(20)); // leave kalk slurry dosing pump off briefly to allow slurry to dissipate

digitalWrite(4, HIGH); // same as above, this just spreads out the kalk slurry.
delay(secondsInMs(3));
digitalWrite(4, LOW);
delay(secondsInMs(20));

digitalWrite(4, HIGH); // same as above.
delay(secondsInMs(3));
digitalWrite(4, LOW);
delay(secondsInMs(20));

digitalWrite(4, HIGH); // almost same as above.
delay(secondsInMs(3));
digitalWrite(4, LOW);
delay(minutesInMs(30)); // wait 30 minutes before starting at the top with a new dosing series.
}
 

Attachments

  • DSC_0057.jpg
    DSC_0057.jpg
    39.8 KB · Views: 0
  • DSC_0058.jpg
    DSC_0058.jpg
    40.2 KB · Views: 0
Last edited:
Since you have repeated code, consider consolidating it because its nicer. For example, like this:

Code:
most of the above

...

void run(int pumpPin, int secOn){
  digitalWrite(pumpPin, HIGH); // turn kalk slurry dosing pump on using a second NO relay
  delay(secondsInMs(secOn)); // let kalk slurry dosing pump run only briefly to prevent precipitation
  digitalWrite(pumpPin, LOW); // turn kalk slurry dosing pump off
} 

void loop(){
  digitalWrite(4, LOW); // turn kalk slurry dosing pump off
  run(3, 20); // let mixing pump run for 20 seconds, or long enough to create kalk slurry
  delay(minutesInMs(5)); // this delay determines slurry concentration

  for(int i = 0; i<4; ++i){
    run(4, 3); // let kalk slurry dosing pump run only briefly to prevent precipitation 
    delay(secondsInMs(20)); // leave kalk slurry dosing pump off briefly to allow slurry to dissipate
  }

  delay(minutesInMs(30)); // wait 30 minutes before starting at the top with a new dosing series.
}

You could incorporate the delay into the dose, but i think that is forcing the issue some and less clear.

I might also suggest replacing the 3 and 4 with these at the top of the code:

#define MIX_PUMP 3
#define DOSE_PUMP 4

So then you can change run(3, 20); to run(MIX_PUMP, 20); which is more clear to read than the magic number 3 or 4.
 
Back
Top