Utilising Accelerometer and Gyroscope in Smartphone to Detect Incidents on a Test Track for Cars

Utilising Accelerometer and Gyroscope in Smartphone to Detect Incidents on a Test Track for Cars

Utilising accelerometer and gyroscope in smartphone to detect incidents on a test track for cars Carl-Johan Holst Data- och systemvetenskap, kandidat 2017 Luleå tekniska universitet Institutionen för system- och rymdteknik LULEÅ UNIVERSITY OF TECHNOLOGY BACHELOR THESIS Utilising accelerometer and gyroscope in smartphone to detect incidents on a test track for cars Author: Examiner: Carl-Johan HOLST Patrik HOLMLUND [email protected] [email protected] Supervisor: Jörgen STENBERG-ÖFJÄLL [email protected] Computer and space technology Campus Skellefteå June 4, 2017 ii Abstract Utilising accelerometer and gyroscope in smartphone to detect incidents on a test track for cars Every smartphone today includes an accelerometer. An accelerometer works by de- tecting acceleration affecting the device, meaning it can be used to identify incidents such as collisions at a relatively high speed where large spikes of acceleration often occur. A gyroscope on the other hand is not as common as the accelerometer but it does exists in most newer phones. Gyroscopes can detect rotations around an arbitrary axis and as such can be used to detect critical rotations. This thesis work will present an algorithm for utilising the accelerometer and gy- roscope in a smartphone to detect incidents occurring on a test track for cars. Sammanfattning Utilising accelerometer and gyroscope in smartphone to detect incidents on a test track for cars Alla smarta telefoner innehåller idag en accelerometer. En accelerometer analyserar acceleration som påverkar enheten, vilket innebär att den kan användas för att de- tektera incidenter så som kollisioner vid relativt höga hastigheter där stora spikar av acceleration vanligtvis påträffas. Ett gyroskop däremot är inte lika vanlig som en accelerometer men finns i de flesta nyare telefoner. Ett gyroskop kan detektera rotationer runt en godtycklig axel och kan på så vis användas för att detektera kritiska rotationer. Detta examensarbete kommer att presentera en algoritm för att utnyttja accelerom- etern och gyroskopet i en telefon för att detektera incidenter som inträffar på en test- bana för bilar. iv Acknowledgements I would like to thank the team at Data Ductus for giving me a chance to do this thesis work, and in assisting me with all the relatively trivial issues I had during the project. Thank you for putting up with me and making me feel welcome. I would also like to thank Anton Christoffersson for creating similar systems which detect events based on data from the GPS and the microphone. Once we merged our two projects together into the final system we had a program which was not only capable, but also versatile and flexible. v Contents Abstract ii Sammanfattning iii Acknowledgements iv 1 Introduction1 1.1 Goals and purpose..............................2 1.2 Background..................................2 1.2.1 Accelerometer.............................2 1.2.2 Gyroscope...............................2 1.2.3 Android phone............................2 1.2.4 Android Studio............................2 1.2.5 Google Go...............................3 1.2.6 Proving grounds...........................3 1.2.7 Nelson Proving Grounds Management..............3 1.2.8 NPGM Mobile Unit..........................3 1.2.9 Rajd Systech..............................3 1.2.10 Data Ductus..............................4 1.3 Related work..................................4 1.3.1 Zaldiwar et al..............................4 1.3.2 Ali and Alwan............................4 1.3.3 WreckWatch..............................4 1.4 Method.....................................5 1.4.1 Accelerometer.............................5 1.4.2 Gyroscope...............................5 1.4.3 GPS...................................6 1.4.4 Microphone..............................6 1.4.5 Algorithm...............................6 1.5 Social, environmental and ethical considerations.............6 2 Implementation7 2.1 Application..................................7 2.2 IncidentLib...................................7 2.2.1 Accelerometer.............................8 2.2.2 Gravity.................................8 vi 2.2.3 Gyroscope...............................8 2.2.4 Logging tool..............................9 2.3 Server......................................9 3 Result 10 3.1 Application.................................. 10 3.1.1 Accelerometer............................. 10 3.1.2 Gravity................................. 10 3.1.3 Gyroscope............................... 11 3.1.4 Test-application............................ 12 3.2 Algorithm................................... 12 3.2.1 Parameters............................... 14 3.3 Testing..................................... 15 4 Discussion 17 4.1 Discussing the result............................. 17 4.2 Limitations................................... 17 4.2.1 Hardware limitations........................ 17 4.2.2 Mounting malfunction........................ 18 4.3 Future work.................................. 18 4.3.1 Profiles................................. 18 4.3.2 Hotspots................................ 18 5 Conclusion 19 5.1 Project..................................... 19 5.2 Research phase................................ 19 5.2.1 Accelerometer............................. 19 5.2.2 Gyroscope............................... 20 5.3 Implementation phase............................ 20 5.4 Testing phase................................. 20 1 Chapter 1 Introduction Every winter, major car companies descends upon the Swedish city of Arjeplog to test their concept cars and prototypes for use in winter conditions. Around the city, there are multiple test-tracks, called proving grounds, located which are tracks built for the purpose of testing the performance of the cars. These proving grounds use a management system called Nelson Proving Grounds Management (NPGM). NPGM is a system in which cars contain a smartphone that is meant to act as both a tool for the managers of the track and as a device to provide added security for the drivers. This smartphone contains hardware which, in theory, can be used to detect incidents that could occur on a test track such as collisions. During car collisions, high amounts of G-forces occur which can be detected using an accelerometer, and it is also likely that the airbag deploys. Airbags are deployed using explosives, which means they are loud. By using a microphone, it is possible to detect loud noises such as an airbag deploying or even the sound of the car impacting with something else. A gyroscope which detects rotations can be used to detect if the car is rotating rapidly, e.g. spinning while sill being on its wheels, suggesting that the driver might have lost control of the car. The GPS in the phone can then be used to confirm if the car is still moving or if it is stationary. If the car is stationary after having experienced extensive amounts of G-forces and a loud noise is detected, it is highly likely that the car has crashed in which case an emergency event will generate. On the other hand, if the gyroscope detects rapid rotations while the GPS states that the car is still moving, it can be assumed that the driver has lost control and an emergency event will generate immediately. If the accelerometer and microphone then detect significant spikes in G-forces and a loud noise respectively and the GPS states that the car is stationary, a new emergency event will generate. This thesis work presents an algorithm for utilising the above-listed sensors and hardware in a smartphone to detect incidents on a test track for cars. The algorithm listens to the accelerometer, the gyroscope, the GPS, and the microphone in the phone, and by analysing the data determines if an incident has occurred. If an event has occurred, it passes the event on to the server which then handles the event. This thesis work will be focusing on the parts of the algorithm which I specifically worked on, meaning the accelerometer and the gyroscope. 2 Chapter 1. Introduction 1.1 Goals and purpose The aim of this thesis work was first to research the possibility of using data from the accelerometer and gyroscope inside a smartphone to detect incidents on a track such as collisions and other accidents. If it was deemed possible to detect such incidents, I was then supposed to develop a system for detecting incidents on a track and report them to a server. Once the system was completed, it would then be integrated into the NPGM Mo- bile Unit system [1]. 1.2 Background 1.2.1 Accelerometer An accelerometer works by detecting proper acceleration affecting the accelerometer to determine the G-forces affecting the accelerometer [2]. Proper acceleration means acceleration that is relative to free-fall [3]. An object in free-fall would as such have no acceleration affecting it while an object at rest on the surface of the earth would experience an acceleration of 9,81 m=s2 upwards due to the surface pushing the object upwards to negate gravity. Accelerometers in smartphones bases their functionality on micro-electromechanical-systems (MEMS), which measure electric currents based on compression of a seismic mass, often silicon, caused by acceleration [4][5]. 1.2.2 Gyroscope A gyroscope is a device which detects rotations around an arbitrary axis [6]. The gyroscope in a phone detects rotational speed around each axis of the phone in rad=s . By using a timestep and multiplying the timestep with the rotational speed from the gyroscope, it is possible to calculate how many radians the phone has rotated during the time-step

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    29 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us