We discuss the possibility of implementing a switch based on a conformational change, consisting in a relative rotation of a molecule containing two benzene rings, functionalized with proper substituents. Contacts are simulated with three-atom gold clusters, which are connected to the rest of the molecule via a thiol group. Relative rotation of the two rings, induced by a transverse electric field, determines a variation of the height of the potential barrier separating them, due to the change in the amount of conjugation of the π orbitals. The action of such a barrier is evaluated by computing the shift of the electron density as a function of a longitudinal electric field.