A drug delivery system includes a substrate, an integrated sensor disposed on the substrate, a drug delivery element disposed on the substrate, and a control unit coupled to the integrated sensor and the drug delivery element. The integrated sensor includes first and second electrodes disposed on a first surface of the substrate. The drug delivery element includes a reservoir disposed on the first surface of the substrate, a thermally active polymer enclosing the reservoir, and a heating coil disposed over the thermally active polymer. The control unit is configured to measure a biological parameter by measuring a voltage difference between the first and second electrodes of the integrated sensor, and to apply a trigger signal to the heating coil of the drug delivery element responsive to the measured biological parameter indicating a designated condition to heat up the thermally active polymer to selectively release a drug from the reservoir.