Converted the emulator to a contact sensor