In view of the large scientific and technical interest in the MEMS accelerometer sensor and the limitations of capacitive, resistive piezo, and piezoelectric methods, we focus on the measurement of the seismic mass displacement using a novel design of the all-optical sensor (AOS). The proposed AOS consists of two waveguides and a ring resonator in a two-dimensional rod-based photonic crystal (PhC) microstructure, and a holder which connects the central rod of a nanocavity to a proof mass. The photonic band structure of the AOS is calculated with the plane-wave expansion approach for TE and TM polarization modes, and the light wave propagation inside the sensor is analyzed by solving Maxwell’s equations using the finite-difference time-domain method. The results of our simulations demonstrate that the fundamental PhC has a free spectral range of about 730 nm covering the optical communication wavelength-bands. Simulations also show that the AOS has the resonant peak of 0.8 at 1.644µm, quality factor of 3288, full width at half maximum of 0.5nm, and figure of merit of 0.97. Furthermore, for the maximum 200nm nanocavity displacements in the x- or y-direction, the resonant wavelengths shift to 1.618µm and 1.547µm, respectively. We also calculate all characteristics of the nanocavity displacement in positive and negative directions of the x-axis and y-axis. The small area of 104.35 µm2 and short propagation time of the AOS make it an interesting sensor for various applications, especially in the vehicle navigation systems and aviation safety tools.