but i don't have any input signal on this pin. it isn't used.
Is it normal, that there are a "default" volatage?
do i need to substract some value, if i use the pin tho measure the voltage of a sensor??
No, it should read zero if the A0 pin of the D1 mini is not connected. As suggested, try connecting it to ground to see if that makes a difference.
On most arduino, like Uno etc, or a bare esp8266 module, a floating (unconnected) analog pin could read any value. But on D1 mini, there is a voltage divider on the board:
The resistor R2 should pull the ADC pin down and cause it to read zero if A0 is unconnected.
No. The input range of the ADC on the esp8266 module is 0.0V to 1.0V. However, that voltage divider on the D1 mini increases that range to 0.0V to 1.0x(100+220)/100 = 3.2V.
The ADC has 10 bit resolution, so an increase of 1 in the ADC reading corresponds to 3.2/(2^10) = 3.125mV
That could damage the D1 mini (assuming it isn't already damaged, which seems to be a possibility), depending on what type of anemometer. Please post a link to the specs of the anemometer.
The linked page also describes how to calculate the wind speed:
Auswertung des Signals: Windgeschwindigkeit (m/s) = Spannung (V) x 25
Beispiel: Am Windsensor wird 1V gemessen. 1 x 25 = 25m/s
Umwandlungsfaktor m/s zu Km/h= 3,6
25m/s x 3,6 = 90Km/h
An input of 1V from the anemometer (=90Km/h) would give an ADC reading of 1/3.2x(2^10) = 320.
So your sketch can calculate the wind speed in Km/h like this
I just uploaded your code to one of my Wemos D1 Mini Pro.
I was surprised by the result.
I also see 14 or 15 with A0 not connected.
If I connect the A0 pin to ground, I get the value 10.
If I connect the A0 pin to 3V3, I get the value 1024.
I then used another D1 Mini Pro
With this board I get value 2 if A0 is not connected
If I connect the A0 pin to ground, I get the value 1.
If I connect the A0 pin to 3V3, I get the value 1024.
So maybe your results are normal for esp8266/wemos d1 mini.
I was surprised that connecting to 3V3 gave 1024 instead of 1023 which I expected. Apparently this is a known "feature":