A weak force sensor scheme is presented in an optomechanical system, in which the two cavity modes couple to a mechanical mode with linear and quadratic coupling. Due to introducing time-dependent hopping, the linear and quadratic coupling terms coexist under the rotating-wave approximation in the interaction picture. Compared with the quantum non-demolition measurement (ignoring the quadratic optomechanical coupling), the current scheme can decrease the additional noise to a lower level. Our proposal provides a promising platform for improving the detection of a weak force.