Entangled states are beneficial for quantum metrology, but difficult to prepare and maintain. To tackle this issue, we here propose a quantum metrology scheme in a cavity QED setup to achieve the Heisenberg limit without preparing entangled states. In our scheme, a series of identical two-level atoms randomly pass through and interact with the cavity mode. We show that the initial atomic coherence will induce an effective driving to the cavity field, whose steady state is an incoherent superposition of orthogonal states, with the superposition probabilities being dependent on the atom-cavity coupling strength. By measuring the average photon number of the cavity in the steady state, we demonstrate that the root-mean-square of the fluctuation of the atom-cavity coupling strength is proportional to 1/N 2 c (N c is the effective atom number interacting with the photon in the cavity during its lifetime). It implies that we have achieved the Heisenberg limit in our quantum metrology process. We also discuss the experimental feasibility of our theoretical proposal. Our findings may find potential applications in quantum metrology technology.