A laboratory characterization of a new wavefront sensor for adaptive optics applications called a pyramid sensor is presented. This characterization is aimed at establishing the sensor accuracy and sensitivity. To investigate the operation of the sensor in low and high order correction adaptive optics systems, its behavior for different amplitudes of incoming wavefront aberrations is studied. The sensor characterization is carried out using a two arm optical set-up that allows the comparison of the PS measurements with those of a commercial Fizeau interferometer. This is done when a certain aberration is introduced into the optical path of both instruments via a deformable mirror. The experimental data are analyzed and discussed using both geometrical and diffractive optics theory. The closed loop sensor accuracy is investigated experimentally and demonstrates closed loop wavefront correction down to 30 nm root mean square for starting aberrations whose root mean square ranges from 170 nm to 300 nm. Modal noise propagation coefficients are determined and are compared with Shack-Hartmann sensor coefficients.