Keeping Drunk Drivers Off the Streets With LabVIEW

  Read in   |   Print Print

"We needed to include flexible algorithms in the software because this application area is subject to change. …We also needed it to run 24/7 without supervision, which was supported well by the Linux OS and the LabVIEW Run-Time Engine. "

- Martin Peeker, DVel AB

The Challenge:
Determining if a driver is under the influence of alcohol or fit for driving in a quick and automatic way.

The Solution:
Using NI LabVIEW system design software to develop a fast, accurate, and contact-free breathalyzer that screens groups of people for alcohol intoxication with unprecedented speed and quality.

Author(s):
Martin Peeker - DVel AB

TGS: A Unique Breathalyzer

An alcohol screening device needs to be fast, easy, and intuitive to use to work as a passage control. It should also be accurate to minimize the risk of false positive tests and still prevent any intoxicated persons from passing. Devices on the market have suffered from failing to meet one or more of these requirements. Fuel cell-based breathalyzers require a personal mouthpiece and significant force when blowing into them. Biometric devices take up to 20 seconds and may need personal calibration for everyone being tested.

The Swedish company Servotek developed the TGS, a fast, accurate, and contact-free breathalyzer that helps users perform alcohol intoxication screening of groups of people with unprecedented speed and quality. Several public transport operators use the TGS to ensure their drivers are fit to transport commuters safely. Drivers identify themselves and blow into the TGS before accessing their vehicle. This process takes about a second for a measurement with no alcohol and, if any alcohol is detected, it takes a few seconds longer to accurately determine the level of blood alcohol intoxication. The system does not require physical contact or a mouthpiece, so maintenance is low while repeatability remains high. The physical effort of blowing into the TGS is comparable to blowing out a candle, so it does not discriminate against people who cannot blow forcefully.

Many operators have integrated the TGS into their administrative systems through a provided TCP/IP interface and others use it as a stand-alone system. The TGS plays a key role in a pilot project in Gothenburg Harbor, where users integrated it in a boom system that screens all trucks rolling off the ferries from Kiel, Germany. This system uses the electrical interface of the TGS to control the boom while using the TCP/IP interface to monitor the system from a control center. The Swedish Abstaining Motorists’ Association (MHF), Servotek, and numerous Swedish authorities, including the police, collaborated on this project. The goal is to install this system in all Swedish harbors. Initial results show a decrease in alcohol-related disturbances on the ferries thanks to information about the system. Of the 5,900 tested professional drivers, only four have tested positive for alcohol intoxication. When operators tested the system on the ferries without giving the drivers any information, six drivers out of 1,300 tested positive in one week.

The Technology

The TGS consists of a measuring unit and a computer, which are connected to each other with USB. The person to be tested blows toward a funnel shaped opening in the measuring unit from a distance of approximately 5 cm (2 in.). No physical contact is needed, which results in lower maintenance and eliminates the need for individual mouthpieces. Mouthpieces can be a nuisance to handle and tend to bring dust into measurement devices, thereby degrading their performance. The exhaled air, mixed with the ambient air, goes into a cuvette, where a rotating filter wheel in front of a photo sensor measures light absorption on several different wavelengths. The setpoints from the photo sensor transfer to the computer continuously through USB, along with a number of parameters such as flow, pressure, and temperature. 

The computer runs a slimmed down Linux Ubuntu distribution with a LabVIEW application running on the NI LabVIEW Run-Time Engine. The standard device includes a panel PC with a touch screen so the administrator of the system can log in and change configurations or view statistics; however, the system can use any computer with a USB port that can run the OS.

The LabVIEW application uses a number of algorithms to convert the data from the measuring unit to concentrations of alcohol, water, and carbon dioxide. The gas in the measuring unit is a mixture of gas from the lungs and the ambient air, so these concentrations by themselves do not tell us much. However, the water concentration of exhaled air is a fixed value corresponding to the saturation concentration of water at the temperature in the lungs, approximately 44 mg/L. We plot the measured alcohol concentration against the measured water concentration, fit this to a linear function, and then extrapolate it to 44 mg/L water, which gives us the alcohol concentration in the exhaled air. This proves to give an exact measurement of alcohol intoxication.

National Instruments Alliance Partner DVel, in close collaboration with Servotek, developed this LabVIEW application. We needed to include flexible algorithms in the software because this application area is subject to change. We planned to use the device as a commercial product as well as a research tool, so we needed different GUIs. In addition, we discussed different ways to store data, handle users, and other peripheral functionalities. We chose an object-oriented programming (OOP) approach that relies heavily on dynamic dispatch. We also needed it to run 24/7 without supervision, which was supported well by the Linux OS and the LabVIEW Run-Time Engine.

DVel developed a platform that we could easily adapt using a mixture of by-reference and by-value OOP and well established design patterns. Decoupling the GUI from the code was a key contributor to the platform’s success. Code modules that initially seemed unnecessary to prepare for adaptation have repeatedly shown that the initial work was worthwhile. Servotek and DVel continue to collaborate with ongoing research for new application areas, auxiliary products, and services to TGS.

For more information, please visit these links:

Servotek: www.servotek.se
DVel: www.dvel.se
The Swedish Abstaining Motorists’ Association: www.mhf.se

Watch a video from the Gothenburg harbor project: 

Author Information:
Martin Peeker
DVel AB
martin.peeker@dvel.se

Bookmark and Share


Explore the NI Developer Community

Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.

‌Check‌ out‌ the‌ NI‌ Community


Who is National Instruments?

National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI