sistema de control para ahorro de agua (arduino-sensor efecto hall)

hola amigos soy nuevo en el foro, llegue hasta aquí porque creo que me pueden ayudar a resolver un problema que tengo con mi proyecto, de antemano agradecería muuuchiisimo su ayuda.
bueno explico; resulta que desde hace tiempo he querido hacer un sistema para el ahorro de agua en una casa, no había avanzado mucho ya que no soy un programador, solo intento aprender a través de estos medios y por medio de los mismos me encontré con un código que estudie y modifique un poco y luego probé y funciono. bueno la cuestión es que este código mide el caudal que pasa a través de la tubería y el total de litros consumidos; lo que yo quiero hacer es comparar el valor total de los litros consumidos con un valor que yo previamente haya guardado en una variable y si por ejemplo son iguales que se mueva un servomotor para cerrar la llave.
espero haber sido claro y ps si alguien tiene una idea o mejor aun una fracción de código de como hacerlo uuuufsss se lo agradecería.
si tienen alguna duda o no fui muy claro por favor díganme. gracias

adjunto el codigo.

#include <LiquidCrystal.h>
#include <Wire.h>

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int lcd_opcion  = 0;
int adc_chequear = 0;
int  POT = A0;
int led  = 6;
#define btnRIGHT  0
#define TotalBotonReset 1 // UP button
#define DiarioBotonReset 2 // Down Button
#define btnNINGUNO   5
#define btnLEFT   3
#define btnSELECT 4



int leer_opciones_comando()
{
adc_chequear = analogRead(POT);
// ADC_chequear = map(ADC_chequear,0,255,0,150);

if (adc_chequear > 1000) return btnNINGUNO;
if (adc_chequear < 250)  return TotalBotonReset;
if (adc_chequear < 450)  return DiarioBotonReset; 

return btnNINGUNO;
}


byte sensorInterrupt = 0;                //colocar 1 para q trabaje el pin 2
byte sensorPin = 2;


float Factor_calibracion = 7.55;

volatile byte PulsoCont;

float Caudal;

unsigned int FlujoMiliLitros;
unsigned long TotalMiliLitrosA;
unsigned long TotalMiliLitrosB;

unsigned long Tiempo;


void setup()
{
 Serial.begin(9600);
 lcd.begin(16, 2);
 lcd.setCursor(4, 0);
 lcd.print("Proyecto ");
 lcd.setCursor(0, 1);
 lcd.print("control - caudal");
 delay(1000);
 lcd.clear();
 pinMode(led, HIGH);
 pinMode(sensorPin, INPUT);
 digitalWrite(sensorPin, HIGH);

 PulsoCont = 0;
 Caudal = 0.0;
 FlujoMiliLitros = 0;
 TotalMiliLitrosA = 0;
 TotalMiliLitrosB = 0;
 Tiempo = 0;

 attachInterrupt(sensorInterrupt, RPM, FALLING);
}



void loop()
{

//  sei();
//  delay(100);
//  cli();
lcd_opcion = leer_opciones_comando();

switch (lcd_opcion)
{
   case TotalBotonReset:
   {
   TotalMiliLitrosA = 0;
   lcd.setCursor(5, 1);
   lcd.print("Reset");
   }
    
   case DiarioBotonReset:
   {
   TotalMiliLitrosB = 0;
   lcd.setCursor(11, 1);
   lcd.print("Reset");
   }
}


 if((millis() - Tiempo) > 1000)
 {

   detachInterrupt(sensorInterrupt);
  
   Caudal = ((1000.0 / (millis() - Tiempo)) * PulsoCont) / Factor_calibracion;
   
   Tiempo = millis();
   
   FlujoMiliLitros = (Caudal / 60) * 1000;
   
   TotalMiliLitrosA += FlujoMiliLitros;
   TotalMiliLitrosB += FlujoMiliLitros;
   

   unsigned int frac;


lcd.setCursor(0,0);
lcd.print("Fluj");
lcd.write(255);
lcd.setCursor(0,1);


if(int(Caudal) < 10)
   {
   lcd.print(" ");
   }
   lcd.print((int)Caudal);
   lcd.print('.');
   frac = (Caudal - int(Caudal)) * 10;    
   lcd.print(frac, DEC) ;
   lcd.write(255);
   

   lcd.setCursor(5, 0);
   lcd.print("Total");
   lcd.write(255);
   lcd.setCursor(5, 1);
   
   
   
 if(int(TotalMiliLitrosA / 1000) < 10)
   {
   lcd.print(" ");
   }
  if(int(TotalMiliLitrosA / 1000) < 100)
   {
   lcd.print(" ");
   }
   if(int(TotalMiliLitrosA / 1000) < 1000)
   {
   lcd.print(" ");
   }
   
   
   lcd.print(int(TotalMiliLitrosA / 1000));
   lcd.setCursor(9, 1);
   lcd.print("L");
   lcd.write(255);
   
 
   lcd.setCursor(11, 0);
   lcd.print("Diari");
   lcd.setCursor(11, 1);
   if(int(TotalMiliLitrosB / 1000) < 10)
   {
   lcd.print(" ");
   }
   if(int(TotalMiliLitrosB / 1000) < 100)
   {
   lcd.print(" ");
   }
   if(int(TotalMiliLitrosB / 1000) < 1000)
   {
   lcd.print(" ");
   }

   lcd.print(int(TotalMiliLitrosB / 1000));
   lcd.setCursor(15, 1);
   lcd.print("L");

   PulsoCont = 0;
   
   attachInterrupt(sensorInterrupt, RPM, FALLING);
 }
}


void RPM()
{
PulsoCont++; 
// Serial.print(Caudal);
// Serial.println("   RPM");
}

Que valor vas a comparar TotalMiliLitrosAo B?

Primero, las notificaciones no llegan asi que debes entrar habitualmente para ver si hay respuestas.
Algun dia si dios quiere funcionarán.
Ahora que respondiste algun forero o yo mismo, te daremos el resto de código que te hace falta pero es muy simple.

Una variable definida del mismo modo que has usado para TotalMiliLitrosA y luego esto

unsigned long umbral = 10000;  // 10.000 mL. 
// donde defines los globales

if (TotalMiliLitrosA >= umbral) {
   // accionas el servomotor
}

Bueno, lo del servo te lo dejo a ti.
Te cambie algunas cosas que simplifican el programa pero el tuyo estaba bien

#include <LiquidCrystal.h>
#include <Wire.h>

#define btnRIGHT  			0
#define TotalBotonReset 	1 // UP button
#define DiarioBotonReset 	2 // Down Button
#define btnLEFT   			3
#define btnSELECT 			4
#define btnNINGUNO   		5

const byte POT		= A0;
const byte led		= 6;

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int lcd_opcion  	= 0;
int adc_chequear 	= 0;
int leer_opciones_comando()
{
adc_chequear = analogRead(POT);
// ADC_chequear = map(ADC_chequear,0,255,0,150);

	if (adc_chequear > 1000) 
		return btnNINGUNO;
	if (adc_chequear < 250)  
		return TotalBotonReset;
	if (adc_chequear < 450)  
		return DiarioBotonReset; 
	return btnNINGUNO;
}


byte sensorInterrupt = 0;                //colocar 1 para q trabaje el pin 2
byte sensorPin = 2;


float Factor_calibracion = 7.55;

volatile byte PulsoCont;

float Caudal;

unsigned int FlujoMiliLitros;
unsigned long TotalMiliLitrosA;
unsigned long TotalMiliLitrosB;
unsigned long UmbralMiliLitros = 10000;  // 10.000 mL. 

unsigned long Tiempo;


void setup() {

	Serial.begin(9600);
	lcd.begin(16, 2);
	lcd.setCursor(4, 0);
	lcd.print("Proyecto ");
	lcd.setCursor(0, 1);
	lcd.print("control - caudal");
	delay(1000);
	lcd.clear();
	pinMode(led, HIGH);
	pinMode(sensorPin, INPUT);
	digitalWrite(sensorPin, HIGH);
 	
 	PulsoCont 			= 0;
	Caudal 				= 0.0;
	FlujoMiliLitros 	= 0;
	TotalMiliLitrosA 	= 0;
	TotalMiliLitrosB 	= 0;
	Tiempo 				= 0;

	attachInterrupt(sensorInterrupt, RPM, FALLING);
}



void loop() {
    char buffer[20], str[6];

	//  sei();
	//  delay(100);
	//  cli();
	lcd_opcion = leer_opciones_comando();

	switch (lcd_opcion) {

	   case TotalBotonReset:  TotalMiliLitrosA = 0;
	   						  lcd.setCursor(5, 1);
	   						  lcd.print("Reset");
	   						  break;
	   case DiarioBotonReset:
						   	  TotalMiliLitrosB = 0;
							  lcd.setCursor(11, 1);
							  lcd.print("Reset");
							  break;
	}


	if ((millis() - Tiempo) > 1000UL)  {

	   	detachInterrupt(sensorInterrupt);
	   	Caudal = ((1000.0 / (millis() - Tiempo)) * PulsoCont) / Factor_calibracion;
	   	Tiempo = millis();
	   	FlujoMiliLitros = (Caudal / 60) * 1000;
	   	TotalMiliLitrosA += FlujoMiliLitros;
	   	TotalMiliLitrosB += FlujoMiliLitros;

	   	if (TotalMiliLitrosA >= UmbralMiliLitros) {
			// accionas el servomotor
		}
	   
	   	unsigned int frac;

	   	lcd.setCursor(0,0);
	   	lcd.print("Fluj  Total  Diari");

		lcd.setCursor(0,1);
		sprintf(buffer, "%4s %4dL %4dL", dtostrf(Caudal, 4,2,str), TotalMiliLitrosA/1000, TotalMiliLitrosB/1000); // transformo float a string con 4 caracters y 2 decimales.
		lcd.print(buffer);

	   	PulsoCont = 0;
	   	attachInterrupt(sensorInterrupt, RPM, FALLING);
	}
}


void RPM() {
	PulsoCont++; 
}

Ajusta sprinft si no he acertado con las distancias