A miniature biosensor immobilized on the backside of a gold lid is protected inside a microfabricated vial. To activate the protected biosensor, the conjugated polymer/gold lid is opened by the application of 800 mV. Both independent sensing and drug delivery from the microvalves are demonstrated.