  We investigated the depth dependence of coherence times of nitrogen-vacancy
(NV) centers through precisely depth controlling by a moderately oxidative at
580{\deg}C in air. By successive nanoscale etching, NV centers could be brought
close to the diamond surface step by step, which enable us to trace the
evolution of the number of NV centers remained in the chip and to study the
depth dependence of coherence times of NV centers with the diamond etching. Our
results showed that the coherence times of NV centers declined rapidly with the
depth reduction in their last about 22 nm before they finally disappeared,
revealing a critical depth for the influence of rapid fluctuating surface spin
bath. By monitoring the coherence time variation with depth, we could make a
shallow NV center with long coherence time for detecting external spins with
high sensitivity.
