The present invention provides a system and method for detecting a target in a sample. In one aspect, a collection device includes a collection chamber, a test chamber, a passageway between the collection chamber and the test chamber, and a detection system positioned within the test chamber. The detection system includes at least one of a spiropyran, a molecularly imprinted polymer and a nonimprinted polymer.