The present invention is directed to membranes composed of heterocyclic nitrogen groups, such as vinylpyridine and to electrochemical sensors equipped with such membranes. The membranes are useful in limiting the diffusion of an analyte to a working electrode in an electrochemical sensor so that the sensor does not saturate and/or remains linearly responsive over a large range of analyte concentrations. Electrochemical sensors equipped with membranes described herein demonstrate considerable sensitivity and stability, and a large signal-to-noise ratio, in a variety of conditions.