introduces switch on pin 7; creates threshold parameters for activation and disactivation;