We have calculated the piezoelectric coupling between a two-dimensional electron gas and the stress field due to a lateral surface superlattice, a periodic striped gate. Stress is assumed to arise from differential contraction between the metal gate and semiconductor. The piezoelectric potential is several times larger than the deformation potential and generally gives the dominant coupling. It depends on the orientation of the device and vanishes on a (100) surface if the current flows parallel to a crystallographic axis. Most devices, however, are fabricated parallel to {011} cleavage planes in which case the piezoelectric potential is at a maximum. There are several sources of screening, including the partly occupied donors in a typical GaAs-AlxGa1-xAs heterostructure. We also consider different elastic models for the gate. The best agreement with experiment is obtained if the force is distributed over the interface between the gate and semiconductor, rather than being concentrated at its ends.