Good day.
I am developing a pH controller that pumps pH Up or pH down nutrient according to the measured level of pH in a tank.
I have a pH sensor (SEN0161 DFROBOT) which is an analog input for my system that produces pH values upon placement in different liquids.
I would like my pumps to only go on after 10-15 readings from the pH sensor have been produced.
My current code is as follows:
if (pHValue <5)
{
digitalWrite(pHUp,LOW);
delay(30);
digitalWrite(pHUp,HIGH);
}
if(pHValue>8.5)
{
digitalWrite(pHDown,LOW);
delay(30);
digitalWrite(pHDown,HIGH);
}
if(pHValue>=5 || pHValue<=8.5)
{
digitalWrite(pHUp,HIGH);
digitalWrite(pHDown,HIGH);
}
How do I do this?
Regards,
Darshal