pendulum on a string

Sounds like you are trying to make a Foccault Pendulum. Nice one in the Smithsonian. Demonstrated the rotation of the Earth. I believe that one has a switch and a magnetic coil that attracts a ring up near the pivot point.

Not much for an Arduino to do - the Pendulum will have a very predictable period and that will never change.