Provided herein is a device for controlling the release of a substance at a site of interest in a biological membrane comprising a means of monitoring a physiological state at the site of interest; and a means of releasing a variable amount of the substance to the site of interest where the amount varies in response to the status of the monitored physiological state. Also provided are methods of using the device.