A method and apparatus for maintaining the concentration of glucose in a person, animal or tissue within a predetermined range is disclosed. An implanted sensor of living cells produces a detectable electrical signal which varies with the concentration of glucose. A controller detects the electrical signal produced by the sensor and determines if the concentration of glucose is within the predetermined range. If the glucose is too low or too high, the controller activates a pump causing either glucose or glucagon, or insulin to be delivered to the person until the glucose level is within the predetermined range. A separate pump for delivering each of the glucose and insulin may be used, or a single pump which is switchable between them may be used. The system may be adapted to maintain other constituents or conditions within a predetermined range by changing the sensor in use, and by using agents and counteragents appropriate to the condition or constituent level being monitored.