I am wanting to detect any lateral movement of a rod pendulum. The pendulum is attached to a 10k pot at one end and the other end hanging down and is free to swing back and forth in one 2 directions. The Arduino then fires off a command if it detect a voltage change on pin A0 from the 10k pot.
This works great but when the pendulum is NOT moving the voltage is floating slightly on the Arduino A0 pin thus my readings are eg 556,556,557,558,556,555,557 probably due to noise!
I have put the readings into a moving average to help smooth and using that to detect any changes which has help but I still do get the odd of fluctuations so instead of detect 1mv change on the A0 pin I am having to detect approx 5mv but I would like to lower this.
Does anybody know of a way to say reduce this further either electrically or programmatically.