Shack-Hartmann sensors are commonly used wavefront sensors in a large field of applications, like adaptive optics, beam characterization and non-contact measurements. They are popular because of the ease of use and the robustness of the sensor. We introduce a new way to improve the performance of miniaturized and massproducible optical wavefront sensors for industrial inspection: A sensor design due to an aperiodic diffractive element working as microlens array allows the use of small and cost-efficient detector chips. The diffractive element was optimized using raytracing and thin element approximation (done in Zemax). As an example, we present the design and realization of a sensor for laboratory use with a measurement diameter of 20mm. We show an example measurement and results concerning dynamic range. The measurement accuracy was determined by measuring spherical waves.© (2006) COPYRIGHT SPIE--The International Society for Optical Engineering. Downloading of the abstract is permitted for personal use only.