Open/close door sensor based on LSM303