Embodiments of the present invention relate to analyte sensors comprising a heparin coating, and methods of coating analyte sensors. The heparin can be stably associated with at least a portion of a porous membrane that covers a portion of the analyte sensors. The heparin can be photochemically linked to the coating through the formation of covalent bonds.