The datasheet says I can use them as switch buttons. I learned in the arduino tutorials how to connect a button to arduino. I just replaced the button with one of the virbations sensors, but its not working.
I don't understand the sketch in the datasheet. Can I use them only with 220V? Or is the voltage they create too high for arduino? I am using an 280 Ohm resistor before the 5V pin.
Make sure you put the zenner diode in it will stop you from zapping the input. Failing that a normal signal diode from the sensor to +5v should be used.
As this sources power you should not enable the pull up resistors in the sketch. That's the digital write high after you have set the pin for input.
Connecting it as an analogue input you will probably need to pull it down with say a 1M resistor (input to 0v ) as well.
Do I nedd a (zener) diode? If yes which parameters do it need? Is this to get direct current? Do I need this only for digital input?
As Analog input:
It seems that I get more range if I use the resistor. Is this possible or is it just my imagination?
I just flipped the sensor, so that Sensor Pin 1 connects now to analog input instead of to GND, and according for Sensor Pin 2. Now the idle value is 0 (not 1023) and if I touch it it has a higher value (up tp 1023).
Yes otherwise you can damage the input of the Arduino. As it says use a 5V1 zener or if you don't have one of that value anything down to 3V3. As I said before :- Failing that a normal signal diode from the sensor to +5v should be used as well as that series resistor.
It seems that I get more range if I use the resistor. Is this possible or is it just my imagination?
What resistor? If it's the series one then you must use it to allow the zener diode to work. If it's the pull down one then it drains some of the current from the input pin allowing the voltage you generate to give a bigger input. You could also try a 0.1uF capacitor across the input to hold the voltage spike up a bit more and offer a bit more protection against over voltage from the sensor.