A method for detecting the positioning of an entity, comprising the steps of (a) using a projector, which comprises a laser and a MEMS micro mirror arranged to receive light from the laser and which can oscillate about at least one oscillation axis, to project light towards the entity to project an image which is composed of pixels onto the entity, wherein the image has a first density of pixels (b) changing the density of pixels in the projected image (c) sensing at least a portion of light of the projected image which is reflected from the entity and (d) using the sensed portion of light to determine the position of the entity. There is also provided a corresponding device for detecting position. There is also provided a method and device for determining distance which involves using the sensed portion of light to determine the distance between the entity and projector.