MOBILE ACCELEROMETER BASED CAR CONTROL AND NAVIGATION SYSTEM

MOBILE ACCELEROMETER BASED CAR CONTROL AND NAVIGATION SYSTEM Naeem Abbas, Osama Kamal, M Tahir Qadri and Hassan Ahmed Sir Syed University of Engineeri...
5 downloads 2 Views 193KB Size
MOBILE ACCELEROMETER BASED CAR CONTROL AND NAVIGATION SYSTEM Naeem Abbas, Osama Kamal, M Tahir Qadri and Hassan Ahmed Sir Syed University of Engineering & Technology, Karachi, Pakistan [email protected], [email protected], [email protected] and [email protected] Abstract: Over the years FPGA’s are increasingly being used in designing of high end circuits where complex computation along with speed and accuracy is desired. FPGA’s are penetrated into the market due to its performance based on Re-configurability, parallel processing and fault tolerance. The main aspiration of this research is to use accelerometer of mobile phone for controlling car via Bluetooth and displays car latitude, longitude and environment temperature on mobile phone based graphical user interface through GPS receiver navigation. It also detects metal using proximity sensor. The main components include a mobile phone application, for controlling, navigating and communicating, and model car with FPGA based embedded system. The mobile application first scans the model car via Bluetooth. If the device found, it connects to it after authentication. In second phase, the graphical user interface (GUI) will display car GPS location, surrounding temperature, mine/metal presence and obstacle detection through ultra-sonic sensors. All these data is acquired by FPGA. FPGA also receives commands from mobile over Bluetooth protocol and acts accordingly. Keywords: FPGA Accelerometer, Remote Car, GPS.

1. INTRODUCTION The modern technologies are modified to bring configurability and portability [1] in order to maintain triple constraint among time, cost and quality. This reconfigurable, compact and potable technology brings mobile phones along additional accessories like GPS, Bluetooth, Cameras, Touch Screen and Accelerometer, through which cell phones can control and communicate with other devices in surroundings. This technology is gaining reputation in robotics, used in security purposes. The remote control cars have great historical background. This technology was then implemented using wireless techniques. The remote control systems have many applications due to their flexibility and covering range. An embedded car system controlled by accelerometer based wireless remotes, are used to detect mines and bombs [2]. The remote control cars for security purposes must be fast, accurate and decision making systems because many lives rely on decisions of these embedded cars. These embedded cars are also used in noxious and hazardous environment. These systems are usually controlled by GPS and Bluetooth. The bomb disposals squad is using remote controlled cars to check objects for bombs from long distances. This provides safety of squad team members from any harm. It is also used in the areas where mines of World War II are still present. A team detects mines using remote controlled car and diffuse them. These accelerometer technologies are in much demand for gaming. Such as in XBOX [3], accelerometer based joysticks and other input devices are used to play Car, tennis and many other video games. This technology is present in Kinect [4] introduced by XBOX and Samsung Smart TV. FPGAs are the most widely held processors for stand-alone systems [5-6]. They are solid-state, fast, and reliable and clock trigger based devices. FPGAs provide configurability for desired task. The growth of FPGA based systems had great advancement in last few years [7]. For enhanced expandability and higher performance, it is gaining more responsiveness as an embedded system platform. FPGAs are appropriate for application in time-critical systems. In divergence, to software based solutions with real time operating systems, FPGAs provide deterministic performance, by this flexibility even complex computations can be achieved in no time. As wide range of complex instruction sets are available therefore better expandability and higher performances are needed accordingly. In nearby future, it is obvious that communication between user and sensor based embedded devices would be strongly dominant in the society. Wireless communication is not only most basic, but also effective way of human communication.

2. SYSTEM MODEL The work is divided into two main parts i.e. mobile system and model car. The mobile phone system has accelerometer, designed by android. Accelerometer senses the tilting and motion. It is built-in electronic device, capable of detecting rotation, tilting and shaking of mobile. All the latest smart mobile phones have this technology. On the other hand, model car consist of FPGA based embedded system. FPGA is connected with Bluetooth module, GPS module, Ultra-Sonic sensor, proximity sensor and temperature sensor. The overall block diagram of system is shown below .

Figure 1. Block Diagram of system

2.1. BLUETOOTH BASED INFORMATION ENCAPSULATION The work starts with data received from the hand-held device, the Android mobile application (Eclipse) will create a data packet to send over the JY MCU Bluetooth module [8]. Every 100ms the Android mobile application polls the device‘s accelerometer and touch screen. This data is then converted into three bytes packets. The first byte or packet contains “control” bits, the second packet covers the “direction” defining bits and the third packet holds the “cars speed” character. In addition to car model side, the fourth packet contains the ultra-sonic sensor character, the fifth packet has the temperature sensor character, while the sixth packet contain the metal detector sensor character and the last packet have GPS data. There are two tasks; one which continuously polls the position data packets sent from the Android mobile phone device and a second task which contains the control logic. The first task fulfills two important requirements. First, it extracts the Android mobile phone data packets off the Bluetooth module and secondly, it filters the data packets to ensure that the data received is valid car control commands. Since the packets are each one character long, during the extraction process from the Bluetooth module, our program turns the seventh single characters into one seventh character string. This new string is then passed through a filtering process which ensures that the string contains the required character i.e. the control character. If it is determined that the string does not contain all of these characters, then this string is not sent to the control logic task. Once the filtering process determines that the string contains the required data, it sorts the string, ensuring that the first character is the control character, the second character is a steering command and the third character is the speed command. And the fourth character covers the ultra-sonic sensor command, the fifth character has the temperature sensor information and the sixth character is for metal detector sensor command while the last character is the GPS coordinates command. The stage is the sorting of string after which it is sent via Bluetooth module to the control task.

2.2. CONTROLLING OF CAR VIA ACCELEROMETER The movement of the model car will be remotely controlled by the Android mobile phone device. Steering is controlled by the built-in accelerometer, while the speed will be controlled by the touch screen. The Android application will have three states: Drive _Forwards, Drive_ Reverse, and Park. The states can be modeled using a Finite State Machine.

Figure 3. Function Finite State Machine

These states are based on two binary parameters: motor _ enable (either Drive or Park) and motor_ direction (either Forwards or Reverse). Park: This is the initial state. In this state, motor and servo movement (acceleration) is not allowed Switching between Forwards Mode and Reverse Mode is allowed. Drive_ Forwards and Drive_ Reverse: In these states, motor and servo movement is allowed. Switching between Forwards Mode and Reverse Mode is not allowed. When the car is in the Drive states, it can only move in the direction specified by motor_ direction. The user can switch the motor_ direction parameter while the app is in the Park state, using a switch on the Android mobile phone device screen. When in the Drive states, the car will respond appropriately to the following movement commands from the android mobile phone device: Set_ Max_ Speed, Turn _Wheels_ Right, and Turn_ Wheels_ Left. The user will issue the steering commands to the car by tilting the Android device away from its initial orientation. By tilting the Android mobile phone device right or left, the user causes it to send the Steer Right or Steer Left commands to the car. The user will set the maximum speed of the car using a slider on the screen. The car will accelerate to that speed and attempt to maintain it. If the user sets the maximum speed to 0, or pushes the button to move in the opposite direction then the car will come to a stop. 2.3. MODEL CAR INTERFACING WITH FPGA In hardware interfacing phase, the FPGA Xilinx Spartan 3E version is utilized, Two Dc motors, where one for driving and one for steering are integrated with two H Bridges and are interfaced with FPGA which is shown below.

Figure 4. Component Interfacing With FPGA on Model Car

The H-bridge follows three directional conditions. First one is, dc motor run on clock wise. Second one is, dc motor run on anti-clock wise and the last one is dc motor stop. FPGA collect location information from GPS and sent a navigated data to Bluetooth module. This navigated data can be seen on Android mobile phone. The navigated data includes latitude and longitude co-ordinates. This is bidirectional communication and achieved by using 2 bits i.e. TX and RX pins of Bluetooth module. Since FPGA is collecting and sending data to Bluetooth at the same time therefore flags must be continuously monitored. The ultra-sonic sensor is interfaced with FPGA to provide the information of obstacles or blocking problems. It tends to stop or turn model car according to programmed FPGA. The proximity sensor mounted on CAR MODEL and integrated with FPGA is used to detect a metal. It sends a high pulse whenever it detects any metal in its path. This is useful in mine detecting applications. Temperature sensor is used to measure the temperature level of car’s environment. Since car has many important components. These components must be protected from hazardous environment. Temperature is connected with FGPA through ADC. All these information are sent to GUI through Bluetooth module by FPGA.

3. WORKING The developed GUI application for Android mobile phone gathers data from touch screen and accelerometer and sends it to Bluetooth module. The FPGA scans data from Bluetooth module and sends appropriate commands to H-bridges to make the desired movement. The FPGA at the same time also get data from temperature, proximity, ultra-sonic, GPS and feedback sensors to gather information of car’s surroundings. This collected data is sent to Bluetooth module it then transmitted to GUI application to display the current condition of car’s environment. The accelerometer sends the movement commands of car while the touch screen can be used to control the speed of vehicle. The accelerometer and touch screen is interface with developed Android application which sends it to FPGA via Bluetooth communication protocol. The FPGA then extracts data from Bluetooth module and sends appropriate signals to H-bridges. The other components connected to FPGA provide environmental information to user. The connected GPS provide the longitude and latitude information to GUI application so that user can locate the vehicle. The proximity sensor senses any metal in the path and provides high pulses to FPGA, FPGA then sends message to user end. The ultra-sonic sensor is used to detect any obstacle in path. This helps FPGA in decision making. It also works as feedback sensor. The temperature sensor is deployed to measure temperature of environment. It is very useful in underground applications. All the analog data is first sent to ADC and then to FPGA. FPGA sets command according to received information and send it to Android GUI application through Bluetooth technology which can be observed at the Mobile Device.

4. CONCLUSION AND FUTURE WORK This paper discusses a method for implementing an accelerometer based FPGA system. These types of techniques are used in security, gamming and exploring applications. It provides Bluetooth communication between Model car and Android mobile phone. Mobile motion moved the car. The car steering control means mobile accelerometer through car steering control. Other components are connected to provide significant information of atmosphere. The work can be enhanced by image processing. The Android mobile phone device screen will display a live video feed that is sent from a front-facing digital camera, mounted on the car. Due to the limitation of the Bluetooth range and also the power requirement to keep it on, this work can be further enhanced towards the Wireless Communication arena. References [1]. JS. Shin, S. Hwang, S. Park, HY, Won, “Portable electronic device with configurable operating mode”, US Patent, US 8532563 B2, US, 2013. [2]. Swetha, N. "Design and Implementation of Accelerometer based Robot motion and Speed control with Obstacle detection", International Journal of Science, Engineering and Technology Research 2, no. 3, pp-749, 2013. [3]. Andrews, Jeff, and Nick Baker. "Xbox 360 system architecture." Micro, IEEE26, no. 2, pp 25-37, 2006

[4]. I Tashev, ‘‘Recent Advances in Human-Machine Interfaces for Gaming and Entertainment,‘‘ International Journal Information Technology and Security, vol. 3, no. 3, pp. 69-76, 2011. [5]. Monmasson, Eric, and Marcian N. Cirstea. "FPGA design methodology for industrial control systems—A review." IEEE Transactions on Industrial Electronics, pp.1824-1842, 2007. [6]. Bailey Donald G, “Design for embedded image processing on FPGAs”, John Wiley & Sons, 2011. [7]. Pocek Kenneth, Russell Tessier and André DeHon, "Birth and adolescence of reconfigurable computing: A survey of the first 20 years of field-programmable custom computing machines", IEEE International Symposium on Field-Programmable Custom Computing Machines. 2013. [8]. JY-MCU Bluetooth Wireless Serial Port Module for Arduino. Available at http://dx.com/p/jy-mcu-arduinobluetooth-wireless-serial-port-module-104299#.UxgaR9IW0qM