It's not clear if that is happening. The "data sheet" for these sensors does not show the internal circuit. The output is described as "NPN" which is not explained. But it could mean open collector, as @anon35827816 suggested, in which case it won't expose the esp pins to 5V. But that's only a theory!
No, that does not follow logically. It could be done without using interrupts, provided the pulses are not too short. The only way to find out the width of the pulses would be to use an oscilloscope. If you don't have a multimeter, it's pointless asking if you have one of those! But however short or long the pulses, they will still have 2 edges, and if you count both, you will get 2x the true windspeed, whether you use interrupts or not.
Actually, an oscilloscope is not the only way! You could use the pulseIn() function for that.
Yea, I was just going to make a post that the OP needs to address the open collector thing as @anon35827816 has mentioned and the OP fails to take note of.
So we need to change the "CHANGE" to either "RISING" or "FALLING" to get true wind speed?
This manual shows several types with NPN outputs. I believe yours has an internal 4.7K pullup resistor to power (5V).
This is easy to check with a voltmeter or your UNO's analog input ... you could also get a plot of what the signal looks like. Note specifically what the lowest voltage is (this might be higher than the VIL rating of the ESP32's input.
If the anemometer has an internal pullup resistor on its output, I suggest adding a 10K pulldown resistor, then use an analog input on the ESP32 to detect the pulses. Could easily add hysteresis to this method.
Thanks for that, it's a slightly better manual than the others I had found.
Specifies maximum power consumption for the pulse output model as <= 0.2W, so up to 40mA @ 5V. That answers my question, and I won't be buying one for my project. The cheap one I have now, which I would like to replace with something more robust, contains only a magnet and reed switch, so with an external edge detector circuit (resistor+cap) I have a current consumption of only a few uA. I want my project to last months on a small battery, so 40mA to run the anemometer is a deal breaker for me.
