My Problem is : the value from the sensor not stable
Yes that is the problem with that libiary the values are not stable.
Even with a dedicated capacitance sensor chip you will not get stable values. This is because your circuit is not physically stable. Wires move and it is not in a fixed position.
It's not a software problem, it's a hardware problem instead. Cut your sensor in two, and connect one part to the Arduino Gnd. The additional ground plane is required in detail with battery operation. For testing you can touch the Arduino Gnd with one hand, then approach the sensor with your other hand.
Grumpy_Mike:
Yes that is the problem with that libiary the values are not stable.
Even with a dedicated capacitance sensor chip you will not get stable values. This is because your circuit is not physically stable. Wires move and it is not in a fixed position.
Sorry this is a trap that fools many a beginner.
is there any way for this sir or the other way?, atleast i could move servo when the value become high and go otherwise when low
DrDiettrich:
It's not a software problem, it's a hardware problem instead. Cut your sensor in two, and connect one part to the Arduino Gnd. The additional ground plane is required in detail with battery operation. For testing you can touch the Arduino Gnd with one hand, then approach the sensor with your other hand.
i already try it sir but its result same problem the value not stable when touched. I already try it with ground with one hand and the other hand touch sensor .
In the pic, The long foil is connected to ground (the between foil).
And now i use supply from battery 12V (accu) and with stepdown to 6.2 volt for supply arduino & servo. Thank you sir