Problem whit ethernet shield

Hello everyone. I am programming an electric consumption meter with a SCT-013 and a ZMPT101B. I have managed to get both to work together. ,My problem is that when I implement the code necessary for the communication of ubidots with ethernet shield, I get a constant value of -1.61 in the voltage

#include <Filters.h>
#include <Ethernet.h>
#include <SPI.h>
#include <UbidotsEthernet.h>
float testFrequency = 50; // Frecuencia (Hz)
float windowLength = 40.0/testFrequency; // promedio de la señal
int Sensor = 0; //A0
float intercept = -0.04; // to be adjusted based on calibration testing
float slope = 0.0405; // to be adjusted based on calibration testing
float volts; // Voltage
float valor_volts;
float valor_Irms;
float valor_potencia;
unsigned long periodo = 3000;
unsigned long tiempoAnterior = 0;
#include "EmonLib.h";
EnergyMonitor energyMonitor;
RunningStatistics inputStats;
double corriente = 0;
double voltaje= 0;
double potencia = 0;
// Parámetros para el servidor de Ubidots.*/
char const * TOKEN = "BBFF-ncrWSSsuupAsyfoolZEtI88VIrPYtq"; // Token asignado por Ubidots
char const * VARIABLE_LABEL_1 = "corriente_sct"; // Asigna una etiqueta de variable única para enviar los datos
char const * VARIABLE_LABEL_2 = "potencia"; // Asigna una etiqueta de variable única para enviar los datos 
char const * VARIABLE_LABEL_3 = "voltaje_zmpt"; // Asigna una etiqueta de variable única para enviar los datos 


 
/* Dirección MAC para el módulo ethernet */
byte mac[] = {
  0x90, 0xA2, 0xDA, 0x0D, 0xA0, 0x88
};

Ubidots client(TOKEN);
// Crear una instancia EnergyMonitor

void setup() {
Serial.begin(9600);
 /* Inicializa la conexión Ethernet */
  Serial.print(F("Inicializando conexión ethernet..."));
  if (!Ethernet.begin(mac)) {
    Serial.println(F("ops hubo un problema"));
  } else {
    Serial.println(Ethernet.localIP());
  }
  // Esperamos un tiempo para el módulo arranque
  delay(2000);
  Serial.println(F("PLaca ethernet lista!!!"));
  energyMonitor.current(1, 1.6);
   inputStats.setWindowSecs(windowLength);
}

void loop() {
Ethernet.maintain();  
Sensor = analogRead(A0); //Leer pin Analógico
inputStats.input(Sensor);
if((unsigned long)(millis() - tiempoAnterior) >= periodo) {
volts = intercept + slope * inputStats.sigma(); //offset y amplitud
volts = volts*(40.3231); //calibración
tiempoAnterior = millis();
double valor_volts = volts;
// Obtenemos el valor de la corriente eficaz
// Pasamos el número de muestras que queremos tomar
double valor_Irms = energyMonitor.calcIrms(1484);
// Calculamos la potencia aparente
double valor_potencia = valor_Irms * valor_volts;
// Mostramos la información por el monitor serie

Serial.print(" Irms = ");
Serial.println(valor_Irms);
Serial.print("Voltage: ");
Serial.println(valor_volts);
Serial.print("Potencia = ");
Serial.print(valor_potencia);
}

}

I have observed that through the serial monitor when I remove the last part of the code, the one responsible for sending the variables, it behaves normally again and measures correctly. This is the part of the code

  /* Enviando datos a Ubidots*/
  client.add(VARIABLE_LABEL_1, valor_Irms);
  client.add(VARIABLE_LABEL_2, valor_potencia );
  client.add(VARIABLE_LABEL_3, valor_volts);
  client.sendAll();
  //Esperemos 5 segunsdo antes de volver a subir otro datos a Ubidots
  delay(5000);
}

Implementing this last part behaves like this

without implementing it, it behaves correctly as in the following image
image
Somebody could help me? I don’t understand what I’m failing. Please