Micro-nano optomechanical accelerometers are widely used in automobile, aerospace, and other industrial applications. Here, we fabricate mechanical sensing components based on an electrically pumped GaN light-emitting diode (LED) with a beam structure. The relationship between the blueshift of the electroluminescence (EL) spectra and the deformation of the GaN beam structure based on the quantum-confined Stark effect (QCSE) of the InGaN quantum well (QW) structure is studied by introducing an extra mass block. Under the equivalent acceleration condition, in addition to the elastic deformation of GaN-LED, a direct relationship exists between the LED’s spectral shift and the acceleration’s magnitude. The extra mass block (gravitational force: 7.55×10−11 N) induced blueshift of the EL spectra is obtained and shows driven current dependency. A polymer sphere (PS; gravitational force: 3.427×10−12 N) is placed at the center of the beam GaN-LED, and a blueshift of 0.061 nm is observed in the EL spectrum under the injection current of 0.5 mA. The maximum sensitivity of the acceleration is measured to be 0.02 m/s2, and the maximum measurable acceleration is calculated to be 1.8×106 m/s2. It indicates the simultaneous realization of high sensitivity and a broad acceleration measurement range. This work is significant for several applications, including light force measurement and inertial navigation systems with high integration ability.