As the federal government prepares to unveil its marijuana legislation next spring, a researcher at the University of British Columbia has successfully created a breathalyzer test capable of measuring THC levels.

Engineering professor Mina Hoorfar began work on the project in 2013 with the help of PhD student Mohammad Paknahad.

Traditional drug tests rely on blood or saliva samples, which take time and are impractical in a roadside setting.

But Hoorfar鈥檚 breathalyzer can detect tetrahydrocannabinol (THC), the active ingredient in marijuana, using only the subject鈥檚 breath.

鈥淚t鈥檚 very easy to test for THC as it is a big molecule that stays in your breath for a long time,鈥 she said in a . 鈥淭here is a period of 12 hours after you have consumed THC when it can still be detected in your breath.鈥

Hoorfar said the tool can help law enforcement, but is also meant to help marijuana users make an informed and responsible decision before getting behind the wheel.

鈥淭his is a tool not just for the police, but perhaps more for self-testing and self-monitoring,鈥 she said. 鈥淧eople can consciously make the choice to test themselves after they have consumed THC or alcohol.鈥

News of the device comes the same day as Health Minister Jane Philpott announced the federal government will introduce its much-anticipated marijuana legislation in the spring of 2017.

It also coincides with 4/20, an annual celebration of cannabis culture.

In the statement, Hoorfar said that with the legalization of cannabis on the federal government鈥檚 radar, it鈥檚 only a matter of time before driving high becomes a serious law enforcement concern.

The device costs $15 to manufacture using 3D printers at UBC鈥檚 campus in Kelowna. It is also bluetooth-compatible so results can be collected and accessed on a smartphone.

Hoorfar hasn鈥檛 been the only one working on such a device.

In 2014, Vacouver-based Cannabix Technologies announced it was working on a marijuana breathalyzer. The company expects to have a prototype complete in within the next few months.

While developing the technology for the breathalyzer, Hoorfar and Paknahad realized a similar method can be used to detect other odours.

The device is currently being developed to register ketones, meaning diabetics may soon be able to take a breathalyzer test to monitor their glucose levels instead if a finger prick test.