Welcome to the MySensors community @Prithiv-Raj ! Have you looked at the distance sensor example?