Ultrasonic did not read

hi. this is my aquaponic code but i have some problem with 2 ultrasonic sensor where both of them cant read the value ( ultrasonic 1 = waterlevelSENSOR | ultrasonic 2 = foodlevelSENSOR) … can you check my code . any mistake ?

#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); 
#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>
#include <SimpleTimer.h> 
//#include <dht.h>
#include <LiquidCrystal.h>


LiquidCrystal LCDone(21, 22, 23, 24, 25, 26);
LiquidCrystal LCDtwo(28, 29, 30, 31, 32, 33);
LiquidCrystal LCDthree(34, 35, 36, 37, 38, 39);


const int WLTRIGPIN = 4;
const int WLECHOPIN = 5;
const int FLTRIGPIN = 6;
const int FLECHOPIN = 7;

const int AQUAPUMPPIN = 8;
const int FOODALERTPIN = 9;

long duration, distance;
long duration1, distance1;

WidgetLED AQUAPUMPLED(30);
WidgetLED FOODALERTLED(31);

 char auth[] = "1f3c6399849144d6881ae751597b11a6";
//dht DHT;
SimpleTimer timer;


void setup()
{
  DebugSerial.begin(9600);
  Serial.begin(9600);
  Blynk.begin(auth, Serial);
 // dht DHT;

  LCDone.begin(16, 2);
  LCDtwo.begin(16, 2);
  LCDthree.begin(16, 2);

  pinMode(WLTRIGPIN, OUTPUT);
  pinMode(WLECHOPIN, INPUT);
  pinMode(FLTRIGPIN, OUTPUT);
  pinMode(FLECHOPIN, INPUT);
  pinMode(AQUAPUMPPIN, OUTPUT);
  pinMode(FOODALERTPIN, OUTPUT);

  timer.setInterval(1000, waterlevelSENSOR);
  timer.setInterval(1000, foodlevelSENSOR);
}

void waterlevelSENSOR()
{
  digitalWrite(WLTRIGPIN, LOW);
  delayMicroseconds(2);
  digitalWrite(WLTRIGPIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(WLTRIGPIN, LOW);
  duration = pulseIn(WLECHOPIN, HIGH);
  distance = (duration/2) / 29.1;
  Serial.print("WATER LEVEL: ");
  Serial.println(distance);
  if( distance >= 50 || distance <=0)
  {
    AQUAPUMPLED.off();
    //Serial.println("WATER LEVEL IS OKAY");
    digitalWrite(AQUAPUMPPIN, LOW);
    LCDthree.print("PUMP2 OFF");
    LCDthree.setCursor(1,0);
  }
  else
  {
    //Serial.println("WATER LEVEL IS lOW: AQUAPUMP ACTIVATED");
    AQUAPUMPLED.on();
    digitalWrite(AQUAPUMPPIN, HIGH);
    LCDthree.print("PUMP2 ON");
    LCDthree.setCursor(1,0);
  }
}
void foodlevelSENSOR()
{
  digitalWrite(FLTRIGPIN, HIGH);
  delayMicroseconds(2);
  digitalWrite(FLTRIGPIN, LOW);
  delayMicroseconds(10);
  duration1 = pulseIn(FLECHOPIN, HIGH);
  distance1 = (duration1/2) / 29.1;
  Serial.print("FOOD LEVEL: ");
  Serial.println(duration1);

  if( distance1 >= 50 || distance1 <=0)
  {
    //Serial.println("FOOD LEVEL IS OKAY");
    FOODALERTLED.off();
    digitalWrite(FOODALERTPIN, LOW);
  }
  else
  {
    //Serial.println("FOOD LEVEL IS LOW: SENDING NOTIFICATION");
    FOODALERTLED.on();
    digitalWrite(FOODALERTPIN, HIGH);
     Blynk.notify("FISH FOOD LEVEL IS LOW");
  }
}
  
void loop()
{
  Blynk.run(); 
  timer.run(); 
}

Well, your code looks pretty much ok when looking over it briefly. Does your code work without Blynk? That would be my first question and your first stop in debuggin. I see you are using very small delays (probably for measuring) but I think that should ok.

finally its get the reading… for waterlevel i got exact value of measurement but for foodlevel it goes to thousand of value which mean the distance print on serial monitor for both ultrasonic is not same value. how to overcome this?

Same as I said above, try without Blynk first.

yup… i try it without bylnk but get same problem…

Good, we now can conclude it’s probably something with wiring, hardware or your code. Can you try switching the two ultrasonics to see if the problem is in the hardware?

There can be a certain period between the disconnect message and the actual disconnected hardware. If your project is working fine (does it?) I wouldn’t bother with the “disconnected” messages because they tend to be cached to the App. For example, if you have a disconnected piece of hardware but you don’t open the App until two days later, it’ll still say the hardware is disconnected, but that was from two days ago.

my project is working fine… i can measure with the serial monitor and get the output…but still cant connect to blynk app…

So, you don’t see any data in the app, right? Can you post the settings of your dashboard (e.g. a screenshot with the project stopped).