The quality of life is negatively impacted by chronic wounds for more than 25 million people in the US. They are quite prone to infection, which may lead to the eventual loss of a limb. By exposing the ulcers to treatment agents at the appropriate time, the healing rate is increased. On-demand drug release in a closed-loop system will aid us in reaching our goal. In this study, we have developed a platform capable of real-time diagnosis of bacterial infection by wirelessly reading wound pH, as well as slow and on-demand local administration of antibiotics. The drug carrier microparticles, an electrical patch, a thermoresponsive hydrogel with an integrated microheater, and a flexible pH sensor comprised the closed-loop patch. Here it is reported that slow and smart release of cefazolin can be addressed by incorporation of drug encapsulated hydrophobic microparticles embedded into a thermo-responsive hydrogel. The utilization of a programmable bandage to provide antibiotic medication highlights the need of not only choosing appropriate therapeutic substances but also the controlled release of the medicine and its rate of release within the wound area. The results of our study indicate that the use of cefazolin encapsulated polycaprolactone (PCL) microparticles can effectively regulate the application of antibiotic treatment for chronic skin wounds. The results also showed a substantial gradual release of cefazolin from the thermo-responsive Pnipam hydrogel when the wound dressing was subjected to a temperature of 37°C. We believe that the developed flexible smart bandage can have a significant impact on chronic wound healing.