I’ll start this off with a scenario that I know all too personally:
Just after midnight on March 27, 2012, police officer Morgan Struble observed a Mercury Mountaineer veer slowly onto the shoulder of Nebraska State Highway 275 for one or two seconds and then jerk back onto the road. Nebraska law prohibits driving on highway shoulders, and on that basis, Struble pulled the Mountaineer over at 12:06 a.m. Struble is a K–9 officer with the Valley Police Department in Nebraska, and his dog Floyd was in his patrol car that night. Two men were in the Mountaineer: the driver, Dennys Rodriguez, and a front-seat passenger, Scott Pollman.
Struble returned to Rodriguez's vehicle a third time to issue the written warning. By 12:27 or 12:28 a.m., Struble had finished explaining the warning to Rodriguez, and had given back to Rodriguez and Pollman the documents obtained from them. As Struble later testified, at that point, Rodriguez and Pollman “had all their documents back and a copy of the written warning. I got all the reason[s] for the stop out of the way[,] ... took care of all the business.”
Nevertheless, Struble did not consider Rodriguez “free to leave.” Although justification for the traffic stop was “out of the way,” Struble asked for permission to walk his dog around Rodriguez's vehicle. Rodriguez said no. Struble then instructed Rodriguez to turn off the ignition, exit the vehicle, and stand in front of the patrol car to wait for the second officer. Rodriguez complied. At 12:33 a.m., a deputy sheriff arrived. Struble retrieved his dog and led him twice around the Mountaineer. The dog alerted to the presence of drugs halfway through Struble's second pass. All told, seven or eight minutes had elapsed from the time Struble issued the written warning until the dog indicated the presence of drugs. A search of the vehicle revealed a large bag of methamphetamine.
Rodriguez v. United States, 135 S. Ct. 1609, 1612–13, 191 L. Ed. 2d 492 (2015)
Of course, my experience didn’t end with the discovery of a fat sack of crank. But you get the general idea. It’s any festival-goer's nightmare. It’s unpleasant to think about, but knowing the law surrounding the use of drug dogs might help you avoid this kind of situation or at least help you know what to tell your lawyer about.
In 2005, the U.S. Supreme Court decided that it was lawful for the police to use a drug dog during a traffic stop even if there is no reasonable suspicion to do so. The Court justified that outcome by saying that there is no legitimate privacy interest in concealing the possession of contraband. Because the drug dog only reveals the presence of such contraband and no other private information, the sniff does not constitute an unreasonable search under the Fourth Amendment. See Illinois v. Caballes (2005).
There is, however, a limitation on that rule: the police can’t detain you for an unreasonably long time after the business of the traffic stop has concluded to conduct the search unless there is reasonable suspicion. That means after the ticket or warning has been issued, the police can’t call in a dog and make you wait too long for it to arrive. How long is an unreasonably long time? In Rodriguez v. United States, it was only seven or eight minutes. So, if you are stopped for a traffic or equipment violation and there’s something in your car, it might be a good idea just to admit to the violation when the officer asks “do you know why I stopped you” and move things along.
You should note that "reasonable suspicion" is a pretty low bar. Reasonable suspicion can be found if you are especially nervous or if you have implausible travel plans.
As a quick aside, notice that in the story above, Dennys was asked to consent to the use of the dog and he said no. If asked permission for pretty much anything, you should always say no. On the other hand, you should almost always comply with a command, because if it was given lawfully you can get hit with an obstruction charge. It’s possible to imagine scenarios when an obstruction charge would be the least of your worries, but as a general rule you should do what you’re told in an encounter to avoid more trouble.
And finally, as always, my exploration of the law should not be confused with an endorsement. It also doesn’t mean that it will always be followed by police, but that's why it's good to know something about it: so you can challenge their actions in court if you need to. And if you are charged with an offense that faces you with the possibility of incarceration, you are entitled to an attorney if you can’t afford one. Always assert your Fifth Amendment right until you can talk to your attorney!