**4. Embedded system for user identification in access to objects using mobile phone**

Mobile phones and smartphones are standard communication devices that are used by many users. Mobile phone is microprocessor-based system with different peripheral communication elements and memories. SIM (subscriber identity module) card or smart card in mobile phone can memorize many data about user of mobile phone and different identification data (user name, access passwords and other identification data). It enables that mobile phone could be also used as identification device. The mobile phone could consolidate or replace many identification elements, different types of cards and other elements for identification. Such identification elements are for example: identity card, health card, passport, driving license, student index, remote device for access to a car, remote device for access to some object or area, for entering public transport vehicles, for electronic payments, etc. All that identification elements could be replaced by one mobile phone and identification activities could be performed much simpler. The embedded system that enables mobile phone to be not only communication, but also identification device is proposed and described here. Using such approach and such systems it can be avoided usage of other identification elements in many applications with user identification, for monitoring, tracking and control of access of users to different facilities, spaces and services using a standard mobile phone.

*Embedded Systems Based on Open Source Platforms DOI: http://dx.doi.org/10.5772/intechopen.85806*

Developed and implemented system is based on application of open source Arduino microcontroller platform and smartphone with open source Android operation system. Bluetooth Low Energy (BLE) wireless technology was used for communication [5, 6]. The implemented solution is used for control of access of user to objects, for control of user access to the car parking place or garage. Only users with needed identification data in their smartphone and with appropriate International Mobile Equipment Identity (IMEI) number of the smartphone can access to the car parking place or garage. The system is connected with computer of PC type that is used as a central station. It gives possibility to realize monitoring of user presence in the object and memorizing and processing of such obtained information and data. It can be connected with other central stations or with main monitoring centre in the case of more complex system realization.

In order to increase reliability of control it is needed authentication of the user [5–8]. There are practically three authentication methods based on: something that user knows (password, key word, etc.), something that user owns (key, token, etc.), something that user is (voice, fingerprint, etc.) [11]. Implemented system uses and combines the first two methods: something that user knows (user name and password) and something that user owns (smartphone with appropriate IMEI number) [12].

#### **4.1 Smartphone in identification of users**

One of the most important characteristics of the mobile phone is portability. It allows mobile phone to be permanently close to the user and to be such an ideal element for user identification. Hardware architecture of smartphone is different from architecture of standard general purpose processor. There are significant differences in architecture of CPU used in smartphone [13]. Smartphone uses operating system as an integrated element [13]. The most used operating systems in smartphones are: Google Android, Apple iOS, Nokia Symbian, RIM BlackBerry, Samsung Bada, Microsoft Windows Phone. The application is a part of smartphone software providing additional features of smartphone. By using applications user adds needed functionalities to smartphone.

Bluetooth Low Energy (BLE) and Near Field Communication (NFC) are wireless technologies often used for data transfer between smartphone and other systems [14, 15]. Designers should to select one of the technologies that meet their needs. The BLE wireless technology was used for practically implemented and described embedded system. Reduced power consumption and low cost are the most important advantages of BLE wireless technology. These advantages are reasons for selecting BLE wireless technology for communication between smartphone and Arduino board-based system in the implemented solution.

Users carry many identification cards and devices every day. These identification elements are of different shape and production. That complicates all user activities that require identification. Many of user identification elements could be integrated into mobile phone. It is easier for users to carry one mobile phone with identification data for all identification systems they use than to carry many of different elements for identification. The risk of forgery and malversation also decreases in case of losing or stealing of identification element with some kind of intelligence as mobile phone is.

#### **4.2 Design and implementation of user identification system using mobile phone**

Design and implementation of user identification system using smartphone for entrance to the garage or to the car parking space is proposed and described here [5, 6]. **Figure 1** shows structure of the designed and implemented embedded system.

#### **Figure 1.**

*Structure of implemented user identification system.*

Smartphone with the Android operating system is used for entering user identification data at the entrance of the object (garage or car parking space). The microcomputer Arduino Uno R3 platform with ATmega328P microcontroller is used for checking and control of the identification process and for approval of user entry [15, 17]. The mechanism and elements for opening or closing entrance gate of object is connected to and controlled by the Arduino platform. Using Android application on the smartphone user enters username and password. That identification data is transferred via BLE wireless communication to the Arduino platform that is located in the object access point. Smartphone IMEI number is also transferred in the same time. User identification data including smartphone IMEI number is stored in the MicroSD card. Program on the Arduino platform checks out entered user data. User was successfully identified if sent user information is correct (matches with the user data stored on the MicroSD card). It is also obtained permission to access the garage or the car parking and entrance gate is opening. In the case that sent user information is not correct the access is not allowed. Arduino platform is connected with PC type computer that functions as system central station. Information about users, their permissions, accesses, presence and other data are memorized and kept on PC computer and can be analyzed on that computer. The PC type computer can be connected to other such computers (other central stations) and one main monitoring station if it is needed to realize more complex system for access control and monitoring more parking spaces or garages.

Valid user identification data is memorized on the MicroSD module. In that way was avoided entering identification data in Arduino program. It was also enabled to easily add, delete and update identification data using any device that can work with SD card (computer, mobile phone, etc.). Also, user identification would not be possible if the SD card is removed from SD module. It could be very simple mechanism to forbid further use of the system.

Communication and identification data exchange with Android-based smartphone is performed using HМ-10 BLЕ wireless module. Two LEDs connected to Arduino board are used for indicating state of user identification and state of entry gate.

Open source Arduino IDE development environment was used for development of the embedded system [16, 17]. Arduino programming language very similar to C++ programming language was used for programming [16, 17]. Open source Android Studio was used for development of Android application [18].

Designed and implemented programs have two parts: program for the Arduino board and program for the Android smartphone. Program part for the Arduino board accepts commands from mobile phone and returns responses. All elements

connected to the Arduino board are also controlled by that program. **Figure 2a** shows part of that program. Program part for the Android mobile phone processes answers obtained from the Arduino program and the Arduino board and interacts with the user. **Figure 2b** shows part of that program.

The user can use next command from Android mobile phone while the user is not identified and login:

• login—user identification process initialization (the LED 2 is turned on when user is identified).

The user can use the following commands after user identification:


The Android application program on smartphone has three parts. The first part of the program scans whether active BLE devices exist. If exist active BLE devices near they will be shown in the list of devices to what the user can be connected. The second part of the application program is started when device from the list was selected and the connection process started by user pressing button "CONNECT". The user enters identification data (username and password) in this part of the


#### **Figure 2.**

*Part of Arduino program (a) and part of android program (b).*

program. Process of identification starts when user enters the data and presses the button "LOGIN". IMEI number of user smartphone is also transferred in the same time. User will receive message about wrong identification and will be forbidden system usage if the user enters wrong data or if IMEI number is wrong. The user is identified and goes to the third part of the application program if the transferred data is correct. The third part of the application program is the area where the user can stay or can leave the state of identified user and can return to the second part of the application program.

The application program on Android smartphone interacts with Arduino program part for identification. List of BLE devices to what users can be connected appears after starting Android application. It can be also restarted the scan process by pressing the button "REFRESH". It enables to find BLE devices that were later entered into the range of mobile phone or previously were not found for some reason (**Figure 3a**). By selecting one of the BLE devices from the list it is selected and marked that BLE device. Connection with the selected BLE device is performed by press on the button "CONNECT" (**Figure 3b**). It will be displayed the message "Please select device from list to connect" if the user was not selected any BLE device.

The application goes to login process and login form and starts identification of user after application connects to BLE device. **Figure 4a** shows that. User enters username and password in this form. By press on the button "LOGIN" it is performed sending of user identification data including user smartphone IMEI number to Arduino system (**Figure 4a**). User will receive an error message if sends wrong data (**Figure 4b**).

The user is login on the system and in Android application if the identification process was successful. LED diode (LED 2) connected to output of the Arduino board turns on (indication of user identification). User then goes on process and the form where can control entrance gate and LED diode (LED 1) connected to output of Arduino board (indication of access control). **Figure 4c** shows smartphone display form for the case when the user is identified and login.

**Figure 3.** *Refresh of BLE devices list (a) and connection to selected BLE device (b).*

*Embedded Systems Based on Open Source Platforms DOI: http://dx.doi.org/10.5772/intechopen.85806*


#### **Figure 4.**

*User started with login process (a), user entered wrong user data (b) and login user form (c).*

The implemented and described system shows that such way of use of embedded system, smartphone and wireless communication can very much simplify user daily and business activities and reduce costs. It can be simply enabled to access many places, objects and services and to perform complex operations and send and receive various data by using smartphone for identification. It is also used smartphone IMEI number to avoid misuse of the system by unknown and unwanted person.
