thx for your response GarethMoffatt
I tried both pins. trig and echo. no detection.
shall try your suggestion of testing value with (==) and let you know.
i tried the following before i tested above code
boolean sensorDetected = digitalRead(trigPin);
if (sensorDetected != lastPirState) { // had in declaration bool lastPirState = true; // HIGH or 1
Serial.println(" Ultra Sound sensor not detected ");}
else
sunil