  Incorporating functional molecules into sensor devices is an emerging field
in molecular electronics that aims at exploiting the sensitivity of different
molecules to their environment and turning it into an electrical signal. Among
the emergent sensors, microelectromechanical systems are promising for their
extreme sensitivity to mechanical events. However, in order to bring new
functions to these devices, the functionalization of their surface with
multifunctional molecules is required. Herein, we present original hybrid
devices made of an integrated polymer microelectromechanical resonator
functionalized with switchable magnetic molecules. The change of their
mechanical properties and geometry induced by the switching of their magnetic
state at a molecular level alters the device dynamical behavior, resulting in a
change of the resonance frequency. We demonstrate that the device can be
operated to sense light or thermal excitation. Moreover, thanks to the
collective interaction of the switchable molecules, the device behaves as a
nonvolatile memory. Our results open up broad prospects of new flexible photo
and thermoactive hybrid devices for molecule based data storage and sensors.
