Compartment occupied detector