Thank you all for your replies. I have tested your suggestions and here are my results:
wvmarle:
That R1 forms a voltage divider with R2 and R3, reducing the effective voltage change you see on the comparator's input. Remove R1, increase the value of R2 and R3. 100k-220k or so will do just great. That will give a great improvement.
Also note that C1 should be non-polarised! So that means ceramic, as film is not available in those values. If your largest ceramic is just 1µ or 2µ2 you may have to increase R2 and R3 even more, 470k-1M even. This to keep your RC constant nice and high, so the offset resistors don't decrease your signal much.
I replaced C1 (originally used a 10μF electrolytic) with a 1μF MKT and swapped R2 and R3 for two 100KΩ resistors. I initially tested the circuit with the function generator at a low amplitude and it seemed to work just as fine as the original configuration did. But as I increased the AC amplitude (>1Vp-p) the output signal started getting cropped, as seen in the attached picture 1. Same results obtained with two 470KΩ resistors in place of R2 and R3. I even tried R2=470KΩ and R3=1MΩ, but still the same issue occurs.
What's worth mentioning is that while the AC amplitude was low enough to prevent this "cropping", the Arduino test code (FreqCount library example) was successfully reading the correct frequency, regardless if the input was the function generator or the anemometer's coil.
wvmarle:
Part of the problem is of course the rather low frequencies and low voltages you get from that anemometer most of the time (low wind speeds), making this AC coupling harder to pull off. So an alternative approach could be to bias the anemometer coil itself: in the data sheet there's a mention of a J1 between two black wires, if you keep that open you would be able to bias the coil itself. Basically voltage divider on one input of the coil and the same voltage to your comparator; the other end of the coil to the other input of your comparator. The voltage produced by the spinning coil will simply be added to that bias.
You are apparently referring to the diagram on page 4 of the datasheet. Note that I only own the bare anemometer. It's only the generator coil and a entirely passive PCB with no components (see attachment). The coil wires (black and red) are attached on one side of the PCB. The other side of the PCB has three wires: red which is directly connected to coil's red, black connected to coil's black and green which is connected to PCB's copper pour. No jumpers whatsoever.
That said, I assume you are suggesting a design like the one posted by jremington:
jremington:
Here is the circuit I use to interface a home made AC anemometer with an Arduino.
The anemometer coil (R4 and V1) outputs only 10 mV at low wind speeds, but the circuit still outputs a respectable squarish wave (0.6 to 4.4V). It works very well in practice.
Note that decoupling capacitors are not shown in the schematic, but are absolutely required.
I wired this circuit on one of the four comparators of the LM339 I am using and added a 100nF cap in series with the coil. Result can be seen in attached picture 2.
In general, none of the above suggestions seemed to work better in my case. In the attached picture 3 you can see the output of the comparator, configured as in the original design I posted (C1 being 10μF electrolytic), which works well for an amplitude as low as 400mVp-p.