Electron spins of diamond nitrogen-vacancy (NV) centers are important quantum
resources for nanoscale sensing and quantum information. Combining NV spins
with levitated optomechanical resonators will provide a hybrid quantum system
for novel applications. Here we optically levitate a nanodiamond and
demonstrate electron spin control of its built-in NV centers in low vacuum. We
observe that the strength of electron spin resonance (ESR) is enhanced when the
air pressure is reduced. To better understand this system, we investigate the
effects of trap power and measure the absolute internal temperature of
levitated nanodiamonds with ESR after calibration of the strain effect. We also
observe that oxygen and helium gases have different effects on both the
photoluminescence and the ESR contrast of nanodiamond NV centers, indicating
potential applications of NV centers in oxygen gas sensing. Our results pave
the way towards a levitated spin-optomechanical system for studying macroscopic
quantum mechanics