Why my project is not working please help

Hi!
I’m making a project with esp8266 nodemcu, dht11, capacitive soil moisture sensor, ultrasonic sensor and Blynk IoT.
I made a project where I connected the DHT11, capacitive soil moisture sensor, and an ultrasonic sensor to the esp8266 nodemcu to send some data to Blynk to show the data in the dashboard.
I will show the temperature, humidity, and soil moisture in the dashboard.
i have attached the ultrasonic sensor on the top of my 4cm mini water tank so that it can measure the distance of water and calculate the water percentage and when the water level is less then 20% a relay will be turned on to fill the tank.
The problem is is uploaded the code, connected all the sensors and nodemcu to a breadboard and powered the nodemcu from pc usb port. Now, for some reason, the nodemcu isn’t sending data to blynk and some random characters is showing in the serial monitor. i need to complete this project today.
can someone please help me.

#define BLYNK_TEMPLATE_ID ""
#define BLYNK_TEMPLATE_NAME ""
#define BLYNK_AUTH_TOKEN ""

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Ticker.h>
#include <DHT.h>


#define DHTPIN D4
#define DHTTYPE DHT11

#define TRIGGER_PIN D5
#define ECHO_PIN D6

#define MOISTURE_PIN A0
#define RELAY_PIN_1 D7 // Relay for soil moisture
#define RELAY_PIN_2 D8 // Relay for water pump

// Define wet and dry values for the soil moisture sensor
#define SOIL_MOISTURE_WET 420
#define SOIL_MOISTURE_DRY 490

DHT dht(DHTPIN, DHTTYPE);
Ticker timer;

float humidity, temperature, moisture;
int waterPercentage;

void setup() {
  Serial.begin(9600);
  // Connect to Wi-Fi
  WiFi.begin("My wifi", "pass");
  Serial.print("Connecting to Wi-Fi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("Connected to Wi-Fi!");

  Blynk.begin(BLYNK_AUTH_TOKEN, WiFi.SSID().c_str(), WiFi.psk().c_str());
  dht.begin();
  pinMode(TRIGGER_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  pinMode(RELAY_PIN_1, OUTPUT);
  pinMode(RELAY_PIN_2, OUTPUT);

  timer.attach(10, sendSensorData); // Send sensor data every 10 seconds
}

void loop() {
  Blynk.run();
}

void sendSensorData() {
  humidity = dht.readHumidity();
  temperature = dht.readTemperature();

  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  moisture = analogRead(MOISTURE_PIN);
  
  // Map the raw moisture reading to a percentage based on wet and dry values
  moisture = map(moisture, SOIL_MOISTURE_DRY, SOIL_MOISTURE_WET, 0, 100);

  float duration, distance;
  digitalWrite(TRIGGER_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIGGER_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIGGER_PIN, LOW);
  duration = pulseIn(ECHO_PIN, HIGH);
  distance = duration * 0.034 / 2;
  waterPercentage = map(distance, 1, 4, 100, 0);

  Blynk.virtualWrite(V0, temperature);
  Blynk.virtualWrite(V1, humidity);
  Blynk.virtualWrite(V2, moisture);
  Blynk.virtualWrite(V3, waterPercentage);

  if (moisture < 20) {
    digitalWrite(RELAY_PIN_1, HIGH); // Turn on soil moisture relay
  } else {
    digitalWrite(RELAY_PIN_1, LOW); // Turn off soil moisture relay
  }

  if (waterPercentage < 20) {
    digitalWrite(RELAY_PIN_2, HIGH); // Turn on water pump relay
  } else {
    digitalWrite(RELAY_PIN_2, LOW); // Turn off water pump relay
  }
}

Your timer isn’t running because you don’t have a timer.update(); in your void loop.

But, why are you using Ticker for this instead of BlynkTimer?

Pete.

Tnx! I will change it