ADXL 345 Noise Issue for my use case
If you need to detect the movement of a gate as in a door, then you could use a magnetometer to sense the absolute direction. When using an accelerometer, you'd need a 3-axial unit, so that you can detect the following:


vibrations in the vertical direction (hinges aren't perfect),
centrifugal acceleration in the radial direction, due to swinging of the gate,
tangential acceleration in the direction of the swing.


You can also use a proximity sensor to simply detect whether the gate is closed.

You'd need to tell us more about your application.