One of my side projects has been to develop an open-source visual motion / optical flow sensor that may be usable in all sorts of devices, whether robotic related or not. I’ve found though that one of the most difficult parts of developing tiny vision sensors is finding the right optics. Ideally we want something that is cheap, easy to mount, has a decent field of view, and yet creates a reasonable image. For higher resolution images (hundreds of pixels across or more) and image sensors four or more millimeters wide, there are many excellent lens assemblies available from companies like Sunex. (We’ve used and still use their products in higher resolution sensor designs, always with success.) However there is really nothing available for image sensors a millimeter wide.
Make your own plastic mini lens via DIY Drones