Professional Documents
Culture Documents
This paper presents the implementation of a prototype to lock/unlock the vehicle ignition system.
It involves the adaptation of an opto-isolated relay, which has been equipped with a wireless inter-
face of the MQTT protocol. The relay activation is controlled by an embedded board Raspberry Pi 3;
it acts as the main unit of the proposed system. The executed control actions are given depending
on the information received by radiofrequency from an implemented electronic breathalyzer. This
device evaluates the alcohol level and humidity in the driver’s breath using the MQ-3 and DHT11
sensors. In addition, a mobile communication platform compatible with Android smartphones is pro-
vided to inform the enabling/disabling of the vehicle’s ignition system, its geographical location by
GPS coordinates and a front facial photograph of the driver. All these features are incorporated by a
wireless local network (WiFi) for the elements that make up the prototype. This work also presents
the transmission of information to mobile terminals compatible with the Telegram instant messaging
system through the UMTS network. In order to validate this proposal, the corresponding tests are
carried out and their comparison with a commercial device.
RESEARCH ARTICLE
Keywords: Vehicle Locking System, Electronic Breathalyzer, Mobile Communication, Embedded
Devices, Wireless LAN.
1. INTRODUCTION rules that are not met and even driving after the consump-
Technological development has been part of the evolution- tion of alcoholic beverages. The concentration of alcohol
ary career of human beings since long time ago [1, 2]. in human being bodies causes psychological effects, such
It has caused science to generate great multidisciplinary as disinhibition, euphoria, relaxation, aggression, impa-
advances in different areas of knowledge [3–5]. This is tience, problems when associating ideas and motor inco-
evident in the military, academic, social, medical, cul- ordination [10, 11]. When driving after drinking alcohol,
tural, industrial, automotive and other fields. Additionally, some things become different and difficult such as the per-
it can interrelate more than one of them, depending on the ceive of the red color (stop signal at the traffic lights), inac-
requirements of the time [6, 7]. The increasing need in curate appreciation of the distances, visual field decrease,
people to move from one point to another and the speed disturbance in the sense of balance and the inaccuracy
to reach it has caused that transport become a priority axis when making movements [12].
of modern societies [8]. However, nowadays is common Due to the multiple effects that this toxic drink produces
to find at least one vehicle per family in the main urban as soon as it enters in our bodies, many countries have
environments and, those vehicles of the rural type are not a tolerance limit for drivers. The World Health Organiza-
left behind, because they are an important tool for work tion (WHO) established that the maximum allowed limit
and income [9]. of alcohol should not exceed 0.5 g/L of blood and rec-
The ease with which a car can be acquired today, has ommends adopting even lower limits.a However, there are
allowed drivers to lose awareness of the responsibility that countries such as the United Kingdom which have higher
entails. Daily problems are: transit infractions, basic safety limits (0.8 g/L of blood) and others such as Japan that
∗ a
Author to whom correspondence should be addressed. http://www.who.int/.
established a limit of 0.15 g/L. This shows that the socioe- In Ecuador, according to the Organic Comprehensive
conomic environment is the principal and truly influence in Criminal Code (COIP), the traffic watchman will have to
laws and their restrictions. Around the world, transit acci- take the alcohol or drunkenness test with a special device.b
dents caused death of approximately 1.25 million people The article 385 mentions that if measurement exceeds
per year, between 20 and 50 million of them suffered non- 0.3 g/L in blood, an economic fine and a reduction of
fatal injuries. However, most of them acquired a disability, points in the driver’s license will be charged. If you exceed
becoming this, the main cause of death in the age of 15 the measure of 1.2 g/L, the respective fine, suspension
to 29 years. Low- and middle-income countries accounted of the license and thirty days of imprisonment will be
for 90% of deaths related to this fact, despite having only
b
54% of vehicles worldwide. http://www.amt.gob.ec/files/AMT-COIP-CAPITULO-TRANSITO.pdf.
2. STATE OF ART
With the aim of attacking the problem described above,
several research works have been developed and presented
in this Section. The prior research carried out by Barba-
Maza et al. [13] analyses the level of alcohol in a vehicle’s
environment using the MQ-3 alcohol sensor. A midrange
microcontroller emits the control signals to a normally
closed electromagnetic relay, obstructing the ignition of
the car. Using a GPS module, the position coordinates of
the vehicle are disclosed, while a GSM module sends a
message to the security department, indicating the exact
parking place. Rahim et al. [14] present the implementa-
tion of a breathalyzer that controls the ignition switch of a
vehicle, using a PIC16F877A microcontroller. The control
actions are programmed in source code, using assembly
software. For visualization of the process an LCD panel is
placed.
In the proposal developed Novak et al. [15], the driver’s
breath analysis is performed using the sensors Hanwei
MQ-3 (alcohol gas) and Honeywell HIH-4030 (humid-
ity sensor). In the intention of presenting a low-cost
solution, the ATmega328p microcontroller based on an
Arduino Nano is used. Additionally, using a Bluetooth
transceiver, communication is established with an appli-
Fig. 2. Flowchart of control module.
RESEARCH ARTICLE
cation for smartphones with Android operating system.
In the research of Venugopal et al. [16], the performance
applied. The National Traffic Agency (NTA) from January of a sensor that measures the concentration of alcohol
to June 2018, recorded that road crashes have left 1058 in the interstitial fluid (ISF) of a person is evaluated by
dead and 9575 injured (10633 total victims), 59 daily, one means of the skin poration when focusing an infrared
every 40 minutes. Approximately 17% of the accidents laser. The sensor is interconnected to a wireless monitor-
produced on roads are caused by people who are under the ing system, which transfers data over existing wide area
influence of alcohol or another narcotic substance. This is networks (WAN) such as Internet and the cellular network.
3% more than in 2017, which reveals a problem that is Finally, Shao et al. [17] describe the incidence of alco-
increasing and requires more stringent policies or measures hol in the increase in deaths due to traffic accidents is
to provide an effective solution. described. TDLAS (tunable diode laser) is implemented,
In this context, this work presents a car locking sys- which remotely detects the alcohol concentration in the
tem, which evaluates whether the user has consumed alco- vehicle with the absorption spectroscopy analysis.
holic beverages prior to driving a vehicle. This is done
through an electronic breathalyzer that has been designed 3. SYSTEM ELEMENTS
to analyze the temperature and humidity of the user blow 3.1. Hardware
performed on the device. Depending on the person condi- • Router Trinity 3G/Wifi: implements a local wireless net-
tion, the ignition of the vehicle is enabled/disabled and a work (WiFi) to set the communication between the internal
notification is issued that is registered in a mobile com- elements equipped with this technology. In addition, it
munication platform. In addition, the geographic location allows cloud connection through a mobile internet provider
data is provided by GPS coordinates of the vehicle and with UTMS infrastructure.
the frontal face capture of the user is obtained through the • Sensors MQ-3 y DHT11: the first allows the measure-
OpenCV library. ment of alcohol level from 0.04 mg/L to 10 mg/L. It oper-
This project is divided into VII Sections, including the ates at temperatures from −10 C to 70 C. The second,
introduction in Section I, Section II presents the state of detects humidity variations during the blowing of a person.
art. In Section III the systems elements are described. Measures relative humidity values from 20 to 80%, within
Section IV details the development of the proposal and an ambient temperature of 0 to 50 C.
• Raspberry Pi 3: embedded board which registers, con- • Unit nodeMCU2: executes the control actions received
trols, manages and synchronizes the information provided from the Raspberry Pi board. Sends a logic signal of 0 or
by each of the elements presented in the prototype. 1 to the enable input of the opto-isolated relay to open or
• Unit nodeMCU1: obtains data from sensors and estab- close the ignition circuit of the vehicle.
lishes wireless communication with the control module, • Module NEO-6 u-blox: determines the location of the
for data storage of the breathalyzer and humidity levels vehicle by geographical GPS coordinates of latitude and
respectively. longitude. It uses the civil frequency L1 for the horizontal
• Opto-isolated Relay: Optical coupling element whose position with an accuracy of 2.5 m.
control and switching circuits are electrically independent.
Its control voltage is 5 V with 20 mA current, it can control 3.2. Software
loads of up to 250 V AC or 30 V DC at 10 A. This is The Arduino IDE is used to program the instructions to
the reason why this device is suitable for the low voltage be completed by the remote units nodeMCU, previous
management of the vehicles ignition system; it is located the installation of a package that lists to such devices as
between the battery and the ignition coil. compatible.
RESEARCH ARTICLE
Raspbian Operative System: a distribution of free 4.1. 3G/WiFi Connectivity Module
software GNU/Linux with official support for Rasp- Refers to the responsible device for wireless communica-
berry devices. The installation packages are com- tion. The system covers this point as notification by mobile
patible with the hardware provided. Needed features communication. The ability to send +. To solve the need
to establish a link between modules, it was decided to time, breathalyzer data, GPS coordinates and the users pre-
establish a local WiFi network. viously obtained facial capture. It is worth mentioning that
this script is executed permanently to check the commands
4.2. Control Module transmitted by the WiFi network, this process can be inter-
Programming is done in Python and its flow chart is rupted by keyboard.
shown in Figure 2. The process starts with the import
of libraries to interact with the software installed in the 4.3. Alcohol Measure Module
Raspbian operating system. The MQTT protocol sub- Detects the concentration of alcohol in a person’s breath
scriber test/status with the IP assigned to the Raspberry by means of two sensors capable to sense the blow by the
Pi and port 1883, by the mentioned port, LEDon and end measurement of alcohol degrees and humidity. The sen-
commands are detected and transmitted by the Breatha- sors data are transmitted wirelessly to the control module
lyzer measurement module. Upon receiving the instruction and to a Smartphone with the Virtuino application (mea-
LEDon and through the OpenCV library a capture of the surement display). Its flow chart is presented in Figure 3.
driver’s frontal face profile in front of the camera lens is Programming is developed in the Arduino IDE for the
taken. Consequently, it acquires the GPS coordinates of unit nodeMCU1 and starts with the import of libraries.
the u-blox NEO-6 module so it allows to store in a data ESP8266WiFi.h configures the parameters of the esp8266
table inside the database created in phpMyAdmin. When Wi-Fi chip. PubSubClient.h sets the variables to inter-
performing these actions, a fan is turned on to reduce the act with the MQTT server installed on the Raspberry
temperature generated by the electronic devices. Pi. DHT.h implements the communication protocol for
In case of receiving the “fin” command in the the DHT11 element. Virtuino_ESP_WifiServer.h sets func-
msg.payload variable, the last stored values in the php- tions for the visualization of the internal data from sen-
MyAdmin database of blood alcohol level, humidity, sors on an Android mobile device. Credentials are defined
latitude and longitude are consulted. The alcohol level to establish communication with Virtuino WiFi services,
is compared to determine the state of the locking mod- MQTT and the phpMyAdmin database. Subsequently, the
ule, in case of exceeding 0.05 mg/L it is transmitted by pins of the nodeMCU board are distributed, the local vari-
the MQTT publisher block/key/applies command 1. This ables are initialized and the terminals are configured as
enables the opto-isolated relay to close the ignition cir- input/output.
cuit of the vehicle, in case of receiving the instruction 0, To start a breathalyzer test, a button is pressed in an
it does the opposite. Then, a Telegram notification is sent
RESEARCH ARTICLE
RESEARCH ARTICLE
modules.
the opto-isolated relay and the topic subscriber MQTT
lock/key/applies is fixed. If the topic subscriber receives
the instruction 0, the output D0 has a high voltage value. modules described above located inside the vehicle, where
If receives 1, it performs a low level for the mentioned ter- they will perform their respective tasks, for future evalua-
minal, which enables the energization of the relay coil, it tion. The detail cost of all the materials used in the system
means that the normally open contact which is connected are described in Table I.
in series with the ignition circuit of the vehicle is closed,
this activity is maintained for 60 seconds. Its flow chart is
shown in Figure 4.
5. IMPLEMENTATION
Figure 6 shows the elements used to implement the pro-
totype. Based on this scheme, the control, blood alcohol
and locking modules were built. In Figure 7 the final pro-
totypes of the control, alcohol and locking modules devel-
oped are presented. In the other hand, Figure 8 shows the Fig. 8. Final prototypes installed in a vehicle.
6. RESULTS
Basing in previously research, in this project an electronic
breathalyzer using low cost devices is implemented. To
achieve this prototype, free software is used in the tech-
nology nodeMCU units, in the uploaded server inside the
Raspberry Pi board and in the driver’s facial recognition.
The monitoring of the control module of WiFi connectiv-
ity, lock module and measurement module has been done
by pings. Additionally, the possibility to export user and
vehicle data and showing it as a text message using the
Telegram application.
Fig. 9. Electronic breathalyzer interface. Fig. 11. Comparison of the result with a commercial device.
RESEARCH ARTICLE
Date/Time mg/L after 10 s/1 min message the Raspberry Pi board and the nodeMCU units. A topic
publisher should only set the connection with the broker
28-05-2018/09:00 0,10 No/No Yes
28-05-2018/12:00 0,02 Yes/No Yes
during the transmission of the message and upon closing
28-05-2018/16:00 0,80 No/No No the session. While a topic subscriber must remain perma-
29-05-2018/09:00 0,01 Yes/No Yes nently linked. The use of event timers in the program-
29-05-2018/12:00 0,00 No/No Yes ming of the measurement and control modules influences
29-05-2018/16:00 0,60 No/No Yes the latency at the moment of transmission/reception of the
30-05-2018/09:00 0,04 Yes/No Yes
30-05-2018/12:00 0,71 No/No Yes
information. Therefore, the locking/unlocking of the igni-
30-05-2018/16:00 0,19 No/No Yes tion system was carried out with a delay of one second.
31-05-2018/09:00 0,71 No/No Yes The system allows the interaction with the instant mes-
31-05-2018/12:00 0,12 No/No No saging platform automatically. So, notifications of the tests
31-05-2018/16:00 0,50 No/No Yes performed can be received from any point where you have
01-05-2018/09:00 0,11 No/No No
01-05-2018/12:00 0,04 No/No No
cloud access and a mobile device compatible with this ser-
01-05-2018/16:00 0,96 No/No Yes vice. For a correct application of the breathalyzer test it is
04-05-2018/09:00 0,26 No/No Yes necessary to reach a temperature higher than 24 C and a
04-05-2018/12:00 0,16 No/No Yes relative humidity equal to or greater than 75%. The tests
04-05-2018/16:00 0,78 No/No Yes showed that this system has an approximate effectiveness
05-05-2018/09:00 0,81 No/No Yes
05-05-2018/12:00 0,03 Yes/No Yes
of 93%, which makes it a valid tool and the basis for future
05-05-2018/16:00 0,26 No/No No research on the subject.
06-05-2018/09:00 0,14 No/ No Yes As future work, it is proposed to test the designed sys-
06-05-2018/12:00 0,99 No/No Yes tem in a commercial vehicle of new manufacture, with the
06-05-2018/16:00 1,31 No/No No aim of evaluating its operation and presenting improve-
07-05-2018/09:00 0,62 No/No Yes
07-05-2018/12:00 0,01 Yes/No Yes
ments in the design. To do this, more robust complements
07-05-2018/16:00 0,64 No/No Yes used in field applications will be determined. In addition,
08-05-2018/09:00 0,00 Yes/Yes Yes to provide a more intuitive and scalable application, a
08-05-2018/12:00 0,80 No/No Yes fault-tolerant driver will be searched and security in data
08-05-2018/16:00 0,84 No/No Yes communications will be considered.
Acknowledgments: To the dean Pilar Urrutia and 8. Donaldson, D., 2018. Railroads of the raj: Estimating the impact of
authorities of FTITI. This work was financed in part transportation infrastructure. American Economic Review, 108(4–5),
by Universidad Técnica de Ambato (UTA) and Direc- pp.899–934.
9. Zahabi, S.A.H., Miranda-Moreno, L., Patterson, Z. and Barla, P.,
ción de Investigación y Desarrollo (DIDE) under project 2017. Impacts of built environment and emerging green technolo-
PFISEI 26. gies on daily transportation greenhouse gas emissions in Quebec
cities: A disaggregate modeling approach. Transportation, 44(1),
pp.159–180.
References 10. Sandoval, C., Vásquez, B., Souza-Mello, V., Mandarim-de-Lacerda,
1. Zhang, G., McAdams, D.A., Shankar, V. and Darani, M.M., 2017. C.A. and del-Sol, M., 2018. Rol del consumo de alcohol y antiox-
Modeling the evolution of system technology performance when idantes sobre la metilación global del ADN y cáncer. International
component and system technology performances interact: Com- Journal of Morphology, 36(1), pp.367–372.
mensalism and amensalism. Technological Forecasting and Social 11. Gaviria, M.M., Arango, G.C. and Navas, M.C., 2016. Alcohol, cir-
Change, 125, pp.116–124. rosis y predisposición genética. Revista Colombiana de Gastroen-
2. Buele, J., Espinoza, J., Pilatásig, M., Silva, F., Chuquitarco, A., terología, 31(1), pp.27–35.
Tigse, J., Espinosa, J. and Guerrero, L., 2018. Interactive system for 12. McCorkindale, A.N., Sizemova, A., Sheedy, D., Kril, J.J. and
monitoring and control of a flow station using Labview. Advances Sutherland, G.T., 2019. Re-investigating the effects of chronic smok-
in Intelligent Systems and Computing, edited by Á. Rocha and ing on the pathology of alcohol-related human brain damage. Alco-
T. Guarda, Springer, Vol. 721, pp.583–592. hol, 76, pp.11–14.
3. Oh, H.S. and Lee, C.H., 2018. Origin and evolution of quo- 13. Barba-Maza, L.M. and Sánchez-López, C., 2016. Development of
rum quenching technology for biofouling control in MBRs a Breathalyzer for Car Drivers. 2016 IEEE International Autumn
for wastewater treatment. Journal of Membrane Science, 554, Meeting on Power, Electronics and Computing (ROPEC), November
pp.331–345. 9–11; Ixtapa, Mexico. pp.1–4.
4. Bhuyan, M.K., Mohapatra, D.P. and Sethi, S., 2016. Prediction 14. Rahim, H.A. and Hassan, S.S., 2010. Breathalyzer Enabled Igni-
strategy for software reliability based on recurrent neural network. tion Switch System. 2010 6th International Colloquium on Signal
Advances in Intelligent Systems and Computing, edited by H. Behera Processing & its Applications, May 21–23; Mallaca city, Malaysia.
and D. Mohapatra, Springer, Vol. 411, pp.295–303. pp.1–4.
5. Mettler, T., Sprenger, M. and Winter, R., 2017. Service robots 15. Novak, T., Thumula, N., Chen, M. and Chen, Z., 2015. Design
in hospitals: New perspectives on niche evolution and technol- and Characterization of Breath Analysis System for BAC Prediction.
ogy affordances. European Journal of Information Systems, 26(5), 2015 IEEE Virtual Conference on Applications of Commercial Sen-
pp.451–468. sors (VCACS), March 15–October 15; Raleigh, NC, USA. pp.1–5.
6. Johnson, R.D., Lukaszewski, K.M. and Stone, D.L., 2016. The evo- 16. Venugopal, M., Feuvrel, K.E., Mongin, D., Bambot, S., Faupel, M.,
lution of the field of human resource information systems: Co- Panangadan, A. and Pidva, R., 2008. Clinical evaluation of a novel
evolution of technology and HR processes. Communications of the interstitial fluid sensor system for remote continuous alcohol moni-
RESEARCH ARTICLE
Association for Information Systems, 38(1), pp.533–553. toring. IEEE Sensors Journal, 8(1), pp.71–80.
7. Atzeni, P., Cabibbo, L. and Torlone, R., 2018. Data modeling across 17. Shao, J., Tang, Q.J., Cheng, C., Li, Z.Y. and Wu, Y.X., 2010. Remote
the evolution of database technology. Studies in Big Data, edited by Detection of Alcohol Concentration in Vehicle Based on TDLAS.
S. Flesca, S. Greco, E. Masciari and D. Saccà, Springer, Vol. 31, 2010 Symposium on Photonics and Optoelectronics, June 19–21;
pp.221–234. Chengdu, China. pp.1–3.