         delay(100);
         digitalWrite(led_pin,LOW);
     } else {
-        // delay the loop if there was no input
-        delay(250);
         if(relay_delay_counting){
             if(relay_delay > 0){
                 relay_delay--;

    light_value = analogRead(A4);
    temperature_value = analogRead(A5);

    // voltage mapping
    battery_value = (10 * (float)voltage_value * 4980)/1023000;

    // set led bar accordingly to solar value
    led_bar_value = round((battery_value-10.0)/4.0*10); // min: 10V max: 14V

        } else if (incomingByte == 51) { // turn relay on if input was ASCII "3"
            digitalWrite(relay_pin,HIGH);
            Serial.println("{ \"relay_state\": 1 }");
            relay_delay = 30 /2; //30s
            relay_delay_counting = true;
        } else { // otherwise, reply with sensor data
            
