Water flow sensor unable to get readings I connected my "arduino(nano)" to "water flow sensor" and wrote a code which simply prints the readings like 0-1023 and tested it. First i got the readings but now i'm not getting it.

My code looks something like this.

void setup(){
 Serial.begin(115200);
}

void loop(){
 int vla=analogRead(2);
 Serial.println(vla);
 delay(1500);
}


and my connection.


  Sensor to Supply module 
  Vcc -->  5v 
  Gnd -->  Gnd 
  
  Sensor to Arduino(Nano)
  Sig --> D2
Sensor to Arduino(Nano)
  Sig --> D2


Your connections are wrong.

int vla=analogRead(2);


is reading from analog channel 2, which is pin A2 on your Nano, not D2

D2 is not an analog pin and thus you can't use it with analogRead().