An officer does not have an automatic right to search your vehicle if you are pulled over for a traffic violation. And you should always refuse to allow an officer to search your vehicle. Be aware that an officer may search your vehicle even if you decline to give consent. The law allows an officer to conduct a search if he has probable cause. Probable cause means that a police officer has a reasonable belief that a person committed a crime.
Committing a minor traffic violation, like speeding or failing to come to a complete stop, is not reasonable suspicion to believe the driver has committed a more serious crime. An officer is only able to investigate the driver regarding the traffic violation he pulled the person over for committing. In order for an officer to continue to detain a person and ask more questions, he must first have a reasonable suspicion that a person is committing a crime, and in order for him to lawfully search the car, he needs probable cause.
If an officer pulls a person over for speeding and he smells an odor of marijuana as he approaches the car, he will have probable cause to search the vehicle for drugs. An officer is the one who determines whether or not he has probable cause, not the driver.
Its important to know that realistically, an officer can always search your vehicle. An officer can always say he smells the odor of marijuana and thus he has established probable cause for the search. If marijuana is found, a judge is unlikely to rule that the officer did not smell it.
Remember to never give consent. You cannot stop an officer from conducting the search but you must say you do not agree to allow the search. If you consent, there is no grounds to suppress the evidence.