sensor with pulse with modulation and pin

May be I am doing a stupid question but: if sensor like water flow ones are like a switch that every turn make the output going high for a short time, why have they 3 pins?
I think it would be sufficent to have 2. Using a pull up resistor, one must be connected to digital_in and to the resistor going at 5v and the second connected to GND.
What's the reason of using one more pin? thanks

cantore:
May be I am doing a stupid question but: if sensor like water flow ones are like a switch that every turn make the output going high for a short time, why have they 3 pins?
I think it would be sufficent to have 2. Using a pull up resistor, one must be connected to digital_in and to the resistor going at 5v and the second connected to GND.
What's the reason of using one more pin? thanks

It depends on the sensor. If it's a 'passive' sensor using say a magnetic reed switch that senses a magnet spinning on the flow meter's impeller then only two wires would be required. However if the sensor uses a 'active' sensor, say a hall effect magnetic switch then the hall effect devices requires a voltage source to operate, so needs three wires.

hall effect is a good example, you're right! May be my water flow sensor uses this principle. Thanks

May be I am doing a stupid question but

Questions are not stupid, they cannot be, people NOT asking them might be :slight_smile: