About attachInterrupt - help please

Do I understand that you would put the sensor (intermittently on switch) on the #2 pin, and the controlled (switched) circuit on pin 7?

Yes, because that pin can easily trigger an interrupt. Pin 7 can too, but it's a lot more difficult to set it up.