  The discovery of graphene has put the spotlight on other layered materials
including transition metal dichalcogenites (TMD) as building blocks for novel
heterostructures assembled from stacked atomic layers. Molybdenum disulfide,
MoS2, a semiconductor in the TMD family, with its remarkable thermal and
chemical stability and high mobility, has emerged as a promising candidate for
post-silicon applications such as switching, photonics, and flexible
electronics. Since these rely on controlling the position of the Fermi energy
(EF), it is crucial to understand its dependence on doping and gating. Here we
employed scanning tunneling microscopy (STM) and spectroscopy (STS) with gating
capabilities to measure the bandgap and the position of EF in MoS2, and to
track its evolution with gate voltage. For bulk samples, the measured bandgap
(~1.3eV) is comparable to the value obtained by photoluminescence, and the
position of EF (~0.35eV) below the conduction band, is consistent with n-doping
reported in this material. Using topography together with spectroscopy we
traced the source of the n-doping in bulk MoS2 samples to point defects, which
we attribute to S vacancies. In contrast, for thin films deposited on SiO2, we
found significantly higher levels of n-doping that cannot be attributed to S
vacancies. By combining gated STS with transport measurements in a field effect
transistor (FET) configuration, we demonstrate that the higher levels of
n-doping in thin film samples is due to charge traps at the sample-substrate
interface.
