In nine U.S. states, you’re legally allowed to puff on your jazz cabbage whenever you please, like when taking your dog for a walk or chilling on your stoop or picnicking with friends.

But even where marijuana is legal, it’s a bad idea to drive while stoned (laws for driving after partaking in the devil’s lettuce are difficult to sort out and enforce, some states do have thresholds for the amount of THC, an active ingredient in marijuana, that can be in a person’s blood while they drive. In California, that number is 5 milligrams per milliliter of blood).

These days, if police want to book someone for driving while high, they have to bring them down to the station and give them a blood test. If they’re high, they’d probably already be sober by the time they get there; if they’re not, well, they just wasted a lot of time.

Police may soon have the tools to enforce those rules in the field — cheap, effective breathalyzers for substances other than alcohol. That would likely include marijuana and drugs like cocaine, which is illegal all over the U.S. and which you definitely should not do before (or while) driving.

The technology behind breathalyzers (or scanners that analyze blood, saliva, or urine) for drugs isn’t new. But a team of researchers from University at Buffalo recently developed a small, inexpensive chip that provided results much more quickly than any device before it— in a matter of minutes.

Other marijuana breathalyzers announced a few years ago were expected to cost anywhere from $500 to $1,000, but the materials for this new chip cost about a dime and the assembly process was also relatively low-cost.

Their chip is made of several thin layers of silver and nanoparticles of gold and silver. As long as the person using the device knows what they’re testing for, the gadget could detect anything from marijuana, to cocaine, to opioids like heroin or fentanyl. If the drug is in the sample, nanoparticles would detect the chemical signature of each drug. The result: a quick on-the-spot analysis.

Breathalyzers and other scanners based on this new research aren’t available yet, but the team says that their chips are essentially ready to integrate into a portable device to collect and test samples. The early stage of this research means we don’t yet know what kinds of biological samples it would test for drugs — breath, saliva, blood, or urine? And we don’t yet know what the results would look like either — would it be a concentration of how much of the drug is in the blood, or just an indicator of whether it’s there at all? All that depends on what kind of device the chip gets built into.

Because these new drug detectors are so cheap, they could lead to more widespread protection against people who make the unfortunate choice to drive when they can’t do so safely. And if you find yourself feeling paranoid for some mysterious reason, these low-cost devices could even tell you whether or not you’re too stoned to get behind the wheel.

More research into how marijuana affects driving, and more specific laws about where to set limits, will mean that devices like these will be particularly handy in the future. But until then, it’s not a bad idea to isolate your use of recreational drugs from the times you need to be in the driver’s seat.