Self-powered monolithic accelerometer using a photonic gate