Shack-Hartmann wavefront sensor is a brainchild of Cold War, born in late 1960-s by the need of US Air Force "to improve the images of satellites taken from earth" -guess who's satellites caused such intense interest of Uncle Sam. The working principle is simple and elegant - the wavefront sampled by an array of micro-lenses, and its local slope is converted into displacements of focal spots: To make an SH sensor today, one needs an array of microlenses and a digital camera. The main difficulty is accurate calibration and the software which will convert camera images into wavefront reading. Thorlabs sells reasonably priced SH sensors and I purchased the WFS-150-7AR for my project. The good It is well built, comes with plate adapter and a C-mount ring adapter. The software runs smoothly and produces expected results (flat wavefront) when tested on spatially filtered and collimated HeNe laser. The manual is very detailed, and API comes in C, C#, and LabVie...
I have no commercial interest in any private company mentioned here, all opinions are my personal.