  Electrically-active defects have a significant impact on the performance of
electronic devices based on wide band-gap materials such as diamond. This issue
is ubiquitous in diamond science and technology, since the presence of charge
traps in the active regions of different classes of diamond-based devices
(detectors, power diodes, transistors) can significantly affect their
performances, due to the formation of space charge, memory effects and the
degradation of the electronic response associated with radiation damage. Among
the most common defects in diamond, the nitrogen-vacancy (NV) center possesses
unique spin properties which enable high-sensitivity field sensing at the
nanoscale. Here we demonstrate that NV ensembles can be successfully exploited
to perform a direct local mapping of the internal electric field distribution
of a graphite-diamond-graphite junction exhibiting electrical properties
dominated by trap- and space-charge-related conduction mechanisms. By
performing optically-detected magnetic resonance measurements, we performed
both punctual readout and spatial mapping of the electric field in the active
region at different bias voltages. In this novel "self-diagnostic" approach,
defect complexes represent not only the source of detrimental space charge
effects, but also a unique tool to directly investigate them, by providing
experimental evidences on the conduction mechanisms that in previous studies
could only be indirectly inferred on the basis of conventional electrical and
optical characterization.
