We present design and simulation results of a novel nanomechanical sensor using silicon cantilever embedded with a two-dimensional photonic crystal microcavity resonator. Both of resonant wavelength and resonant wavelength shift could be measured as a fun