Automatización botón

buenas estoy experimentando en el mundo Arduino la verdad no tengo mucho conocimiento del tema asique subo mi duda para ver si pueden ayudarme, tengo un humidificador que al pulsar un botón enciende y pulsándolo nuevamente apaga , la idea es usar Arduino para que haga esa función automáticamente, me refiero a que si se precisa humedad encienda el humidificador y cuando llegue a la humedad deseada lo apague, uso display de 4 dígitos y dht22 eso ya esta programado lo que me falta es reemplazar el botón para controlarlo con el Arduino es posible hacer eso ?

https://ibb.co/8j36c3r

Okay, lee las normas del foro y postea el código para que podamos ver que has hecho hasta ahora.

#include <TM1637Display.h>
#include <DHT.h>
#include <DHT_U.h>
#include <EEPROM.h>
#include <Button.h>

#define CLK 2
#define DIO 3

int SENSOR = 4;
int TEMPERATURA;
int HUMEDAD;
int inicio = 0;
int calibracion = 50;
int humedaduno = 0;
int efe = 0;


// H
const uint8_t Humed[] = {
  SEG_F | SEG_G | SEG_B | SEG_E | SEG_C
};

//F
const uint8_t Setup[] = {
  SEG_A | SEG_F | SEG_G | SEG_E
};

//On
const uint8_t Encendido[] = {
 // SEG_G ,
  SEG_G | SEG_E | SEG_C | SEG_D,
  SEG_G | SEG_E | SEG_C,
 // SEG_G 
};

//Off
const uint8_t apagado[] = {
  SEG_A | SEG_F | SEG_B | SEG_E| SEG_C | SEG_D,
  SEG_A | SEG_F | SEG_G | SEG_E,
  SEG_A | SEG_F | SEG_G | SEG_E
};

DHT dht(SENSOR, DHT22);
TM1637Display display(CLK, DIO);

//*********************************************************************
const int buttonPinLeft = 10;//pin boton
const int buttonPinDown = 8; //pin boton
const int buttonPinUp = 9; //pin boton
//*********************************************************************
int buttonStateLeft = 0;    // variable para leer el estado del botón
int buttonStateDown = 0;    // variable para leer el estado del botón
int buttonStateUp = 0;      // variable para leer el estado del botón
//*********************************************************************
const int numOfScreens = 4;
int currentScreen = 3;                //menu
String screens[numOfScreens][1] = {{"uno"}, {"dos"}, {"tres"}, {"cero"}};
//*********************************************************************


void setup() {
  pinMode(buttonPinLeft, INPUT_PULLUP);
  pinMode(buttonPinDown, INPUT_PULLUP);
  pinMode(buttonPinUp, INPUT_PULLUP);
//*********************************************************************
  display.setBrightness(2);
  dht.begin();  
  pinMode(7, OUTPUT);
  display.clear();
}

void loop() {
  TEMPERATURA = dht.readTemperature ();
  HUMEDAD = dht.readHumidity();
  //*********************************************************************
  buttonStateLeft = digitalRead(buttonPinLeft);
  buttonStateDown = digitalRead(buttonPinDown);
  buttonStateUp = digitalRead(buttonPinUp);
//*********************************************************************
  if (HUMEDAD <= humedaduno){
    digitalWrite(7, HIGH);
//*********************************************************************
 }else if(HUMEDAD >=  humedaduno){
   digitalWrite(7, LOW);
  }
//*********************************************************************
  if (buttonStateLeft == LOW) {
    display.clear();
    if (currentScreen == 0) {
      currentScreen = numOfScreens - 1;
    } else {
      currentScreen--;
    }
  }
  printScreen();
  Menu();
  delay(200);
//********************************************************************
}
//*********************************************************************
void Menu(){
  switch (currentScreen) {
    case 0:
  display.showNumberDec(humedaduno,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(3,0b11100000,true,1, 1);
  //On y Off
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    inicio = 3;
    efe = 3;
    delay(1000);
    display.clear();
    currentScreen = 3;
  }
  //On y Off
  if (buttonStateDown == LOW) {
    humedaduno = (humedaduno + 1);
  }
  if (humedaduno >= 99){
      humedaduno = 50;
    }
          break;
//*********************************************************************        
    case 1:
  display.showNumberDec(75,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(2,0b11100000,true,1, 1);
    //On y Off
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    humedaduno = 75;
    inicio = 2;
    efe = 2;
    delay(1000);
    display.clear();
    currentScreen = 3;
  }
          break;
//********************************************************************* 
    case 2:
  display.showNumberDec(65,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(1,0b11100000,true,1, 1);
  //On y Off
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    humedaduno = 65;
    inicio = 1;
    efe = 1;
    delay(1000);
    display.clear();
    currentScreen = 3;
  }
            break;
  }
}
//*********************************************************************
void printScreen(){
  if (currentScreen == 3) {
  display.setSegments(Humed, 1, 0);
  //display.showNumberDecEx(inicio,0b11100000,false,1, 1);
  display.showNumberDec(HUMEDAD,false,2, 2);
   if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(apagado, 3, 1);
    humedaduno = 0;
    inicio = 0;
    efe = 0;
    delay(1000);
    display.clear();
  }
  if (buttonStateDown == LOW) {
    display.clear();
    display.setSegments(Setup, 1, 0);
    display.showNumberDecEx(efe,0b11100000,false,1, 1);
    display.showNumberDec(humedaduno,false,2, 2);
    delay(1000);
    display.clear();
  }
  }
}
//*********************************************************************

de seguro hay muchas cosas mal pero hasta ahora cumple con lo que quiero que haga

Bien posteado!!
Aunque al código le faltan cosas te corrijo el tema del control de humedad.
Definí una variable

int humedadBanda = 1;   // variables siempre con minúsculas

entonces lo controlo asi

  if (humedad < humedaduno){
      digitalWrite(7, HIGH);

  } 
  if (humedad > (humedad + humedadBanda)) { // apaga para el valor de humedad + la Banda
                                            // de lo contrario en el humbral se vuelve loco!!
      digitalWrite(7, LOW);
  }

Si la humedad es menor agrega igual si quieres lo enciendes
Pero no corta hasta superar el valor del setpoint de humedad + una banda que llamé humedadBanda.
En este caso vale 1 pero puede valor lo que gustes.
Si usas un DHT22 puedes ponerlo en decimales y hacerlo de 0.5 por ejemplo.
Si llegas a usar floats cambia humedad tmb a float.
Al manejo de menú le faltan pasos.

gracias por la ayuda cambie esto

  if (HUMEDAD + 5 <= humedaduno){
    digitalWrite(7, HIGH);
//*********************************************************************
//sino si 
 }else if(HUMEDAD >=  humedaduno){
   digitalWrite(7, LOW);
  }

no se si esta bien pero con esto me toma 5 por debajo de la configuración echa para encender nuevamente , por ejemplo si coloco que apague a 75% va a encender a 70% que es lo que quería una diferencia de encendido y apagado , lo del menú todavía me falta terminar de apoco voy completando y reformando :slightly_smiling_face: en lo que me quede mas trabado es en la parte que describía lo de manejar el humidificador con el Arduino la verdad pregunto porque no se si se puede la idea es reemplazar el botón push y que lo maneje directamente el Arduino

Esta correcto, en este caso te funciona pero siempre usa () para delimitar esa operación.
Repito

if (HUMEDAD + 5 <= humedaduno){  // es correcto

pero esto

if ((HUMEDAD + 5) <= humedaduno){

hace lo mismo pero a los ojos es mas claro. No se si me explico.
Yo definiría tolerancia en las constantes y pondria por ejemplo

tolerancia = 5;

Y luego opero con eso. Son pequeñeces pero ya verás, si el programa es grande y usas esa variable un par de veces, debes cambiar a mano todo.

bien así quedo todo creo que esta bien

#include <TM1637Display.h>
#include <DHT.h>
#include <DHT_U.h>
#include <EEPROM.h>
#include <Button.h>

#define CLK 2
#define DIO 3

int SENSOR = 4;
int TEMPERATURA;
int HUMEDAD;

//********************************************
//es el estado de configuracion comparable con la humedad actual 0%,65% y 75%
int humedaduno = 0;
//*********************************************
//cambia el esta de la configuracion F0 dependiendo cual seleccionamos
int efe = 0;
//**********************************************
//es el 5% de la diferencia de humedad para encender nuevamente 
int tolerancia = 5;


// H
const uint8_t Humed[] = {
  SEG_F | SEG_G | SEG_B | SEG_E | SEG_C
};

//F
const uint8_t Setup[] = {
  SEG_A | SEG_F | SEG_G | SEG_E
};

//On
const uint8_t Encendido[] = {
  SEG_G | SEG_E | SEG_C | SEG_D,
  SEG_G | SEG_E | SEG_C,
};

//Off
const uint8_t apagado[] = {
  SEG_A | SEG_F | SEG_B | SEG_E| SEG_C | SEG_D,
  SEG_A | SEG_F | SEG_G | SEG_E,
  SEG_A | SEG_F | SEG_G | SEG_E
};

DHT dht(SENSOR, DHT22);
TM1637Display display(CLK, DIO);

//*********************************************************************
const int buttonPinLeft = 10;//pin boton
const int buttonPinDown = 8; //pin boton
const int buttonPinUp = 9; //pin boton
//*********************************************************************
int buttonStateLeft = 0;    // variable para leer el estado del botón
int buttonStateDown = 0;    // variable para leer el estado del botón
int buttonStateUp = 0;      // variable para leer el estado del botón
//*********************************************************************
const int numOfScreens = 4;
int currentScreen = 3;                //menu
String screens[numOfScreens][1] = {{"uno"}, {"dos"}, {"tres"}, {"cero"}};
//*********************************************************************


void setup() {
  pinMode(buttonPinLeft, INPUT_PULLUP);
  pinMode(buttonPinDown, INPUT_PULLUP);
  pinMode(buttonPinUp, INPUT_PULLUP);
//*********************************************************************
  display.setBrightness(2);
  dht.begin();  
  pinMode(7, OUTPUT);
  display.clear();
}

void loop() {
  TEMPERATURA = dht.readTemperature ();
  HUMEDAD = dht.readHumidity();
  //*********************************************************************
  buttonStateLeft = digitalRead(buttonPinLeft);
  buttonStateDown = digitalRead(buttonPinDown);
  buttonStateUp = digitalRead(buttonPinUp);
//*********************************************************************
//si la humedad es 5% menor a la configurada se prende
  if ((HUMEDAD + tolerancia) <= humedaduno){
    digitalWrite(7, HIGH);
//*********************************************************************
//sino si la humedad es mayor a la configurada se apaga 
 }else if(HUMEDAD >=  humedaduno){
   digitalWrite(7, LOW);
  }
//*********************************************************************
//ingreso del menu con delay de 200 milisegundos 
  if (buttonStateLeft == LOW) {
    display.clear();
    if (currentScreen == 0) {
      currentScreen = numOfScreens - 1;
    } else {
      currentScreen--;
    }
  }
  printScreen();
  Menu();
  delay(200);
//********************************************************************
}
//*********************************************************************
//F3 % manual 
void Menu(){
  switch (currentScreen) {
    case 0:
  display.showNumberDec(humedaduno,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(3,0b11100000,true,1, 1);
// grabamos la configuracion 3 (F3) colocando on en pantalla y volviendo a la pantalla de inicio
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    efe = 3;//numero de configuracion F0 a grabar 
    delay(1000);
    display.clear();
    currentScreen = 3;//volvemos a la pantalla inicial 
  }
//al apretar el boton se va sumando 1 a humedaduno llegando a la configuracion deseada 
  if (buttonStateDown == LOW) {
    humedaduno = (humedaduno + 1);
  }
  if (humedaduno >= 99){//si humedaduno llega a 99 encones volvera a 50 
      humedaduno = 50;
    }
          break;
//********************************************************************* 
//F2 75% de humedad          
    case 1:
  display.showNumberDec(75,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(2,0b11100000,true,1, 1);
// grabamos la configuracion 2 (F2) colocando on en pantalla y volviendo a la pantalla de inicio
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    humedaduno = 75;//% de humedad a grabar 
    efe = 2;//numero de configuracion F0 a grabar 
    delay(1000);
    display.clear();
    currentScreen = 3;//volvemos a la pantalla inicial 
  }
          break;
//********************************************************************* 
//F1  65% de humedad         
    case 2:
  display.showNumberDec(65,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(1,0b11100000,true,1, 1);
// grabamos la configuracion 1 (F1) colocando on en pantalla y volviendo a la pantalla de inicio
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    humedaduno = 65;//% de humedad a grabar 
    efe = 1;//numero de configuracion F0 a grabar 
    delay(1000);
    display.clear();
    currentScreen = 3;//volvemos a la pantalla inicial 
  }
            break;
  }
}
//*********************************************************************
//pantalla principal muestra la humedad 
void printScreen(){
  if (currentScreen == 3) {
  display.setSegments(Humed, 1, 0);
  display.showNumberDec(HUMEDAD,false,2, 2);
//*************************************************
//colocamos la configuracion de humedad en 0%
   if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(apagado, 3, 1);
    humedaduno = 0;//% de humedad a grabar 
    efe = 0;//numero de configuracion F0 a grabar 
    delay(1000);
    display.clear();
  }
//******************************************************
//cambiamos por 1 segundo la pantalla para visualizar el estado de la configuracion grabada
  if (buttonStateDown == LOW) {
    display.clear();
    display.setSegments(Setup, 1, 0);
    display.showNumberDecEx(efe,0b11100000,false,1, 1);
    display.showNumberDec(humedaduno,false,2, 2);
    delay(2000);
    display.clear();
  }
  }
}
//*********************************************************************

lo que me queda ahora es reemplazar el led con algo que maneje el botón del humidificador :thinking:

Bueno, usa un relay, para ello.
Recuerda que se suelen manejar de modo invertido.
un LOW activa y un HIGH desactiva el relay. O sea en tu caso LED ON sera un LOW y LED OFF sera un HIGH.

gracias por tu respuesta había pensado también en lo del relé, pero tengo entendido que eso funciona abriendo un circuito o cerrándolo permanentemente, en este caso yo precisaría que el circuito lo cierre y abra inmediatamente para prender el humidificador y los mismo pasaría al apagarlo cierra y abre rápidamente , dejo 2 video uno del humidificador desarmado y el otro armado, para que se pueda ver el funcionamiento que quiero hacer

Comprendo, debes simular la presion. No pasa nada, puedes hacerlo
Esto lo hace y mira que siempre reniego del delay() pero para estos casos es la mejor solución.

digitalWrite(pinRele, LOW); // esto simula la presion
delay(100);                             // no hago nada por 100 mseg
digitalWrite(pinRele, HIGH); // esto simula que sueltas el pulsador

bien a ver agregue esto

int rele = A3;

pinMode(rele, OUTPUT);
digitalWrite(rele, HIGH);//esto para no activar el rele cuando inicie el sistema 

  if ((HUMEDAD + tolerancia) <= humedaduno){
   digitalWrite(rele, LOW);
   digitalWrite(7, HIGH);
   delay(100);
   digitalWrite(rele, HIGH);
   digitalWrite(7, LOW);
//*********************************************************************
//sino si la humedad es mayor a la configurada se apaga 
 }else if(HUMEDAD >=  humedaduno){
   digitalWrite(rele, LOW);
   digitalWrite(7, HIGH);
   delay(100);
   digitalWrite(rele, HIGH);
   digitalWrite(7, LOW);
  }

deje el led para ver como se ve y lo que hace es prender y apagar el led, rele continuamente que hice mal ? :sleepy:

Haces lo mismo en los dos casos, te has dado cuenta?
presionas para encender y tmb presionas para apagar?
Ahora el led lo prendes 100 mseg y apagas inmediatamente. y lo vuelves a haer cuando superas la humedad. Algo no va!!

claro el problema que tengo es que se precisa presionar el botón para encender y volver a presionarlo para apagar como muestro en el video , por lo que entiendo lo que hice es apagar y prender el relé con una demora de 100 mseg, cuando la humedad sea menor a la configurada, pero si respeta eso lo va hacer cada 100 mseg por eso se prende continuamente , funcionaria si lo ejecuta una sola ves para prender y nuevamente para apagar respetando el control de humedad y esa es la parte donde estoy complicado

Te he hecho algunos cambios leves en particular ya entendí que era lo que estaba mal, solo pusiste el código que te sugerí al final lo cual no corresponde.
Ahora lo introduje donde si corresponde con una salvedad y es que no podemos estar activando el pulsador cientos de veces o mejor dicho cada vez que pasamos por esa parte del código.
Aprovechando que el LED se pone ON u OFF uso una variable que consulto para saber si ya pasé y si lo hice no lo presiono de nuevo el pulsador.

#include <Arduino.h>

#include <TM1637Display.h>
#include <DHT.h>
#include <DHT_U.h>
#include <EEPROM.h>
#include <Button.h>

#define CLK     2
#define DIO     3
#define sensor  4
#define LED     7
#define rele    A3

int temperatura;
int humedad;

//********************************************
//es el estado de configuracion comparable con la humedad actual 0%,65% y 75%
int humedaduno = 0;
//*********************************************
//cambia el esta de la configuracion F0 dependiendo cual seleccionamos
int efe = 0;
//**********************************************
//es el 5% de la diferencia de humedad para encender nuevamente 
int tolerancia = 5;
bool statusLed = false;

// H
const uint8_t Humed[] = {
  SEG_F | SEG_G | SEG_B | SEG_E | SEG_C
};

//F
const uint8_t Setup[] = {
  SEG_A | SEG_F | SEG_G | SEG_E
};

//On
const uint8_t Encendido[] = {
  SEG_G | SEG_E | SEG_C | SEG_D,
  SEG_G | SEG_E | SEG_C,
};

//Off
const uint8_t apagado[] = {
  SEG_A | SEG_F | SEG_B | SEG_E| SEG_C | SEG_D,
  SEG_A | SEG_F | SEG_G | SEG_E,
  SEG_A | SEG_F | SEG_G | SEG_E
};

DHT dht(sensor, DHT22);
TM1637Display display(CLK, DIO);

//*********************************************************************
const int buttonPinLeft = 10;//pin boton
const int buttonPinDown = 8; //pin boton
const int buttonPinUp   = 9; //pin boton
//*********************************************************************
int buttonStateLeft     = 0;    // variable para leer el estado del botón
int buttonStateDown     = 0;    // variable para leer el estado del botón
int buttonStateUp       = 0;      // variable para leer el estado del botón
//*********************************************************************
const int numOfScreens  = 4;
int currentScreen       = 3;                //menu
String screens[numOfScreens][1] = {{"uno"}, {"dos"}, {"tres"}, {"cero"}};
//*********************************************************************

void presionoBoton() {
  digitalWrite(rele, LOW);
  delay(100);
  digitalWrite(rele, HIGH);
}

void setup() {
  pinMode(buttonPinLeft, INPUT_PULLUP);
  pinMode(buttonPinDown, INPUT_PULLUP);
  pinMode(buttonPinUp, INPUT_PULLUP);
//*********************************************************************
  display.setBrightness(2);
  dht.begin();  
  pinMode(LED, OUTPUT);
  display.clear();
  pinMode(rele, OUTPUT);
  digitalWrite(rele, HIGH);//esto para no activar el rele cuando inicie el sistema 
}

void loop() {
  temperatura = dht.readTemperature ();
  humedad = dht.readHumidity();
  //*********************************************************************
  buttonStateLeft = digitalRead(buttonPinLeft);
  buttonStateDown = digitalRead(buttonPinDown);
  buttonStateUp = digitalRead(buttonPinUp);
//*********************************************************************
//si la humedad es 5% menor a la configurada se prende
  if ((humedad + tolerancia) <= humedaduno && !statusLed){ 
      presionoBoton();
      statusLed = HIGH;
      
      //*********************************************************************
      //sino si la humedad es mayor a la configurada se apaga 
  } else if(humedad >=  humedaduno && statusLed)){
      presionoBoton();
      statusLed = LOW;
  }
  digitalWrite(LED, statusLed);
//*********************************************************************
//ingreso del menu con delay de 200 milisegundos 
  if (buttonStateLeft == LOW) {
    display.clear();
    if (currentScreen == 0) {
      currentScreen = numOfScreens - 1;
    } else {
      currentScreen--;
    }
  }
  printScreen();
  Menu();
  delay(200);
//********************************************************************
}
//*********************************************************************
//F3 % manual 
void Menu(){
  switch (currentScreen) {
    case 0:
          display.showNumberDec(humedaduno,false,2, 2);
          display.setSegments(Setup, 1, 0);
          display.showNumberDecEx(3,0b11100000,true,1, 1);
          // grabamos la configuracion 3 (F3) colocando on en pantalla y volviendo a la pantalla de inicio
          if (buttonStateUp == LOW) {
              display.clear();
              display.setSegments(Encendido, 2, 1);
              efe = 3;//numero de configuracion F0 a grabar 
              delay(1000);
              display.clear();
              currentScreen = 3;//volvemos a la pantalla inicial 
          }
          //al apretar el boton se va sumando 1 a humedaduno llegando a la configuracion deseada 
          if (buttonStateDown == LOW) {
              humedaduno = (humedaduno + 1);
          }
          if (humedaduno >= 99){//si humedaduno llega a 99 encones volvera a 50 
              humedaduno = 50;
          }
          break;
//********************************************************************* 
//F2 75% de humedad          
    case 1:
          display.showNumberDec(75,false,2, 2);
          display.setSegments(Setup, 1, 0);
          display.showNumberDecEx(2,0b11100000,true,1, 1);
          // grabamos la configuracion 2 (F2) colocando on en pantalla y volviendo a la pantalla de inicio
          if (buttonStateUp == LOW) {
              display.clear();
              display.setSegments(Encendido, 2, 1);
              humedaduno = 75;//% de humedad a grabar 
              efe = 2;//numero de configuracion F0 a grabar 
              delay(1000);
              display.clear();
              currentScreen = 3;//volvemos a la pantalla inicial 
          }
          break;
//********************************************************************* 
//F1  65% de humedad         
    case 2:
            display.showNumberDec(65,false,2, 2);
            display.setSegments(Setup, 1, 0);
            display.showNumberDecEx(1,0b11100000,true,1, 1);
            // grabamos la configuracion 1 (F1) colocando on en pantalla y volviendo a la pantalla de inicio
            if (buttonStateUp == LOW) {
                display.clear();
                display.setSegments(Encendido, 2, 1);
                humedaduno = 65;//% de humedad a grabar 
                efe = 1;//numero de configuracion F0 a grabar 
                delay(1000);
                display.clear();
                currentScreen = 3;//volvemos a la pantalla inicial 
            }
            break;
  }
}
//*********************************************************************
//pantalla principal muestra la humedad 
void printScreen(){
  if (currentScreen == 3) {
      display.setSegments(Humed, 1, 0);
      display.showNumberDec(humedad,false,2, 2);
      //*************************************************
      //colocamos la configuracion de humedad en 0%
      if (buttonStateUp == LOW) {
          display.clear();
          display.setSegments(apagado, 3, 1);
          humedaduno = 0;//% de humedad a grabar 
          efe = 0;//numero de configuracion F0 a grabar 
          delay(1000);
          display.clear();
      }
//******************************************************
//cambiamos por 1 segundo la pantalla para visualizar el estado de la configuracion grabada
      if (buttonStateDown == LOW) {
          display.clear();
          display.setSegments(Setup, 1, 0);
          display.showNumberDecEx(efe,0b11100000,false,1, 1);
          display.showNumberDec(humedaduno,false,2, 2);
          delay(2000);
          display.clear();
      }
  }
}
//********************************************************************

genio!!! funciona bien ahora me queda armar todo para probar el sistema completo muchísimas gracias y discúlpame por las molestias así quedo el código completo

#include <Arduino.h>
#include <TM1637Display.h>
#include <DHT.h>
#include <DHT_U.h>
#include <EEPROM.h>
#include <Button.h>

#define CLK 2
#define DIO 3
#define LED 7

int SENSOR = 4;
int TEMPERATURA;
int HUMEDAD;
int rele = A3;
//********************************************
//es el estado de configuracion comparable con la humedad actual 0%,65% y 75%
int humedaduno = 0;
//*********************************************
//cambia el esta de la configuracion F0 dependiendo cual seleccionamos
int efe = 0;
//**********************************************
//es el 5% de la diferencia de humedad para encender nuevamente 
int tolerancia = 5;
bool statusLed = false;

// H
const uint8_t Humed[] = {
  SEG_F | SEG_G | SEG_B | SEG_E | SEG_C
};

//F
const uint8_t Setup[] = {
  SEG_A | SEG_F | SEG_G | SEG_E
};

//On
const uint8_t Encendido[] = {
  SEG_G | SEG_E | SEG_C | SEG_D,
  SEG_G | SEG_E | SEG_C,
};

//Off
const uint8_t apagado[] = {
  SEG_A | SEG_F | SEG_B | SEG_E| SEG_C | SEG_D,
  SEG_A | SEG_F | SEG_G | SEG_E,
  SEG_A | SEG_F | SEG_G | SEG_E
};

DHT dht(SENSOR, DHT22);
TM1637Display display(CLK, DIO);

//*********************************************************************
const int buttonPinLeft = 10;//pin boton
const int buttonPinDown = 8; //pin boton
const int buttonPinUp = 9; //pin boton
//*********************************************************************
int buttonStateLeft = 0;    // variable para leer el estado del botón
int buttonStateDown = 0;    // variable para leer el estado del botón
int buttonStateUp = 0;      // variable para leer el estado del botón
//*********************************************************************
const int numOfScreens = 4;
int currentScreen = 3;                //menu
String screens[numOfScreens][1] = {{"uno"}, {"dos"}, {"tres"}, {"cero"}};
//*********************************************************************

void presionoBoton() {
  digitalWrite(rele, LOW);
  delay(100);
  digitalWrite(rele, HIGH);
}

void setup() {
  pinMode(rele, OUTPUT);
  digitalWrite(rele, HIGH);
  pinMode(buttonPinLeft, INPUT_PULLUP);
  pinMode(buttonPinDown, INPUT_PULLUP);
  pinMode(buttonPinUp, INPUT_PULLUP);
//*********************************************************************
  display.setBrightness(2);
  dht.begin();  
  pinMode(LED, OUTPUT);
  display.clear();
}

void loop() {
  TEMPERATURA = dht.readTemperature ();
  HUMEDAD = dht.readHumidity();
  //*********************************************************************
  buttonStateLeft = digitalRead(buttonPinLeft);
  buttonStateDown = digitalRead(buttonPinDown);
  buttonStateUp = digitalRead(buttonPinUp);
//*********************************************************************
//si la humedad es 5% menor a la configurada se prende
  if ((HUMEDAD + tolerancia) <= humedaduno && !statusLed){
      presionoBoton();
      statusLed = HIGH;
//*********************************************************************
//sino si la humedad es mayor a la configurada se apaga 
 }else if(HUMEDAD >=  humedaduno && statusLed){
      presionoBoton();
      statusLed = LOW;
  }
    digitalWrite(LED, statusLed);
//*********************************************************************
//ingreso del menu con delay de 200 milisegundos 
  if (buttonStateLeft == LOW) {
    display.clear();
    if (currentScreen == 0) {
      currentScreen = numOfScreens - 1;
    } else {
      currentScreen--;
    }
  }
  printScreen();
  Menu();
  delay(200);
//********************************************************************
}
//*********************************************************************
//F3 % manual 
void Menu(){
  switch (currentScreen) {
    case 0:
  display.showNumberDec(humedaduno,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(3,0b11100000,true,1, 1);
// grabamos la configuracion 3 (F3) colocando on en pantalla y volviendo a la pantalla de inicio
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    efe = 3;//numero de configuracion F0 a grabar 
    delay(1000);
    display.clear();
    currentScreen = 3;//volvemos a la pantalla inicial 
  }
//al apretar el boton se va sumando 1 a humedaduno llegando a la configuracion deseada 
  if (buttonStateDown == LOW) {
    humedaduno = (humedaduno + 1);
  }
  if (humedaduno >= 99){//si humedaduno llega a 99 encones volvera a 50 
      humedaduno = 50;
    }
          break;
//********************************************************************* 
//F2 75% de humedad          
    case 1:
  display.showNumberDec(75,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(2,0b11100000,true,1, 1);
// grabamos la configuracion 2 (F2) colocando on en pantalla y volviendo a la pantalla de inicio
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    humedaduno = 75;//% de humedad a grabar 
    efe = 2;//numero de configuracion F0 a grabar 
    delay(1000);
    display.clear();
    currentScreen = 3;//volvemos a la pantalla inicial 
  }
          break;
//********************************************************************* 
//F1  65% de humedad         
    case 2:
  display.showNumberDec(65,false,2, 2);
  display.setSegments(Setup, 1, 0);
  display.showNumberDecEx(1,0b11100000,true,1, 1);
// grabamos la configuracion 1 (F1) colocando on en pantalla y volviendo a la pantalla de inicio
  if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(Encendido, 2, 1);
    humedaduno = 65;//% de humedad a grabar 
    efe = 1;//numero de configuracion F0 a grabar 
    delay(1000);
    display.clear();
    currentScreen = 3;//volvemos a la pantalla inicial 
  }
            break;
  }
}
//*********************************************************************
//pantalla principal muestra la humedad 
void printScreen(){
  if (currentScreen == 3) {
  display.setSegments(Humed, 1, 0);
  display.showNumberDec(HUMEDAD,false,2, 2);
//*************************************************
//colocamos la configuracion de humedad en 0%
   if (buttonStateUp == LOW) {
    display.clear();
    display.setSegments(apagado, 3, 1);
    humedaduno = 0;//% de humedad a grabar 
    efe = 0;//numero de configuracion F0 a grabar 
    delay(1000);
    display.clear();
  }
//******************************************************
//cambiamos por 1 segundo la pantalla para visualizar el estado de la configuracion grabada
  if (buttonStateDown == LOW) {
    display.clear();
    display.setSegments(Setup, 1, 0);
    display.showNumberDecEx(efe,0b11100000,false,1, 1);
    display.showNumberDec(humedaduno,false,2, 2);
    delay(2000);
    display.clear();
  }
  }
}
//*********************************************************************