  The bandgap of MoS2 is highly strain-tunable which results in the modulation
of its electrical conductivity and manifests itself as the piezoresistive
effect while a piezoelectric effect was also observed in odd-layered MoS2 with
broken inversion symmetry. This coupling between electrical and mechanical
properties makes MoS2 a very promising material for nanoelectromechanical
systems (NEMS). Here we incorporate monolayer, bilayer and trilayer MoS2 in a
nanoelectromechanical membrane configuration. We detect strain-induced band gap
tuning via electrical conductivity measurements and demonstrate the emergence
of the piezoresistive effect in MoS2. Finite element method (FEM) simulations
are used to quantify the band gap change and to obtain a comprehensive picture
of the spatially varying bandgap profile on the membrane. The piezoresistive
gauge factor is calculated to be -148 +/- 19, -224 +/- 19 and -43.5 +/- 11 for
monolayer, bilayer and trilayer MoS2 respectively which is comparable to
state-of-the-art silicon strain sensors and two orders of magnitude higher than
in strain sensors based on suspended graphene. Controllable modulation of
resistivity in 2D nanomaterials using strain-induced bandgap tuning offers a
novel approach for implementing an important class of NEMS transducers,
flexible and wearable electronics, tuneable photovoltaics and photodetection.
