A lens module (100) includes a barrel (10), a lens (20), an image sensor
module (30) and a grating (22). The lens is received in the barrel for
focusing optical signals. The image sensor module is installed on an end
of the barrel for receiving and transforming the optical signals. The
grating is formed on the lens for preventing unnecessary optical signals
from being received by the image sensor module.