Devices are provided that include a plurality of microneedles that penetrate skin and that receive interstitial fluid from the skin tissue. The microneedles are further configured to direct the received interstitial fluid to nanosensors configured to change an optical property based on interaction with an analyte in the received interstitial fluid, allowing optical detection of the analyte. Direction of the received interstitial fluid to the nanosensors can be facilitated by a pump configured to control the flow rate of the interstitial fluid through the microneedles. Such devices could be configured to detect the analyte independently or in combination with a reader device configured to be periodically mounted to the devices and to detect the analyte. Further, such devices can include delivery systems configured to transdermally deliver a drug or other substance into or through the skin in response to a detected concentration, presence, or other property of the analyte.