By introducing the principle,classification and characteristics of optical fiber sensor ,we can understand the optical fiber sensor to some extent.Based on this,it introduces a filter which is used in lockmaking industry.This device is mainly made up of vibrating disk,optical fiber sensor and solenoid valve.By this filter,including vibration,detection and blowing,we can distinguish different kinds of marbles, also,we can distinguish the front-end and back-end of some kind of mables to meet special need.In this case,just connecting every part to each other and make a special angle of fiber head,then,the filter can distinguish marbles automatically an it improves the efficiency heavily.