An officer's pulling over a driver constitutes a detention—the driver hasn't been arrested, but nevertheless isn't free to leave. Where a typical detention is concerned, officers must have reasonable suspicion that the detainee is committing or has committed a crime. But since roadblocks and sobriety checkpoints are, generally speaking, legal, one might wonder whether officers can generally stop drivers on a whim. The answer is no.
In Delaware v. Prouse, the Supreme Court considered the case of man prosecuted for marijuana possession. (440 U.S. 648 (1979).) In the course of a traffic stop, the police officer had seen marijuana on the defendant's car floor.
The officer testified that he hadn't seen the defendant's vehicle violate any traffic laws before he conducted the detention. He hadn't observed any equipment violations, nor had he witnessed any suspicious activity. He enforced the stop only so that he could check the driver's license and the vehicle's registration. He wasn't acting in accordance with any established guidelines or procedures. The Court held that his kind of "spot check," left entirely to the police officer's discretion, is unconstitutional.
For information on challenging an illegal detention or search, see What is a motion to suppress?