Accurate measurement of the wavefront perturbations caused by atmospheric turbulence is vital to the operation of an adaptive optics system. Current systems typically use a Hartmann-Shack wavefront sensor to perform this measurement. This type of sensor uses a lens to translate the problem of phase tilt detection to one of spot centroid detection at the lens focal plane. The accuracy with which a CCD array in the focal plane measures the centroid of this spot is analyzed, taking into account the finite pixel dimension, pixel quantity and dead space between pixels. The optimum design of the wavefront sensor is discussed and the required flux from the reference source is computed. If we require the corrected telescope to have a Strehl ratio of 0.85, and assume typical values for the detector parameters, then the required return flux per seeing cell of size ro is approximately 115 photocounts per measurement.© (1989) COPYRIGHT SPIE--The International Society for Optical Engineering. Downloading of the abstract is permitted for personal use only.