An atomic force microscope (AFM) is used to measure the magnitude of the effective longitudinal piezoelectric constant (d33) of thin films. Measurements are performed with a conducting diamond AFM tip in contact with a top electrode which is driven by an externally applied voltage. The interaction between the tip and electric field present is a potentially large source of error that is eliminated through the use of this configuration and the conducting diamond tips. Measurements yielded reasonable piezoelectric constants of X-cut single crystal quartz, thin film ZnO, Pb(Zr,Ti)O3 (Zr/Ti = 30/70), and nonpiezoelectric amorphous SiO2 thin films. The system was also used to measure d33 hysteresis loops for Pb(Zrx,Ti1−x)O3 thin films.