A Measurement Method of Levelness

A Measurement Method of Levelness

It is of great significance to reduce the development cost and difficulty of a levelness measurement system based on an Android Phone. In order to solve the difficulty of using Java language to develop a levelness measurement system, this paper pro poses a method based on S L4 A direction sensor and scripting languages to solve the problem. We first use sl4a to read data from an android phone direction sensor, and then use median filter to filter out noise of data, and finally work out inclination of the phone . The me thod is de ve l ope d and te ste d by the PHP scripting language .The experimental results show that the method is simple, fast, reusable and scalable.

The level measurement technology is not only widely applied in the fie lds of agricultural dump car, tower c rane, plate conveyor, numerical control machine, but also has very important significance for horizontal position of family metope o b jects an d ceilin g s an d flo o rs an d d oo rs an d windows. The common level measuring instruments are the traditional bubble level, the photoelectric level, the electronic level and the image level [1][2][3]. In order to use high precision instruments to measure level, we need to spend a lot of money to buy expensive equipments. Cheng designed a maze game based on Android direction sensor. Due to the constraints of the Android Java language, developers should not only grasp the working principle of Android direction sensor, but also need to grasp the complex classes and interfaces of SensorManager and Sensor and SensorEvent and SensorEventListener[4]. Zhuang and others[5] developed a mobile sensing system ,which can measure the level, co mposed of sensors based on the Android system. An active safety system on the Condition of Veh icle based on the MPU6050 sensor and the Android system is developed by Bian[6]. Because this kind of application is based on JNI method to transmit sensor data across Java and C/C++ language, it has the disadvantage of high development difficulty. SL4A(Scripting Layer for Android) is an Android native service componet that damonkohler provides for the scripts of PHP and Python and JavaScript and so on. SL4A provides services including UI, radio, mobile phones, multimedia, speech technology, GPS, wi-fi, b luetooth and sensors, etc[7]. P.Ferrill[8] and xing[9][10] discussed development technology of Android Python and PHP and JavaScript application based on SL4A . In order to solve the problems such as high cost, complicated and inconvenient to carry, the paper develops a level measuring instrument based on Android SL4A direction sensor and PHP script language.

The method of this paper is tested and passed in the platform of Xiaomi 1s smartphone( 1.3Gh z quad-core CPU, 1.00GB memory, 8G sdcard) + Android 4.4.2 + SL4A + PFA +RHINO. A screenshot of inclination measure of an Android phone is shown in Fig.2. This screenshot shows that the BC edge of the phone is located above the AD edge of the phone, the inclination is 6.14 degrees, and the AB edge of the phone is located above the DC edge of the phone, the inclination is 1.61 degrees. The tilt state of the phone in the screenshot is consistent with the tilt state of the physical phone. Keep water in a glass and refer to the horizontal surface of water in the glass and place a phone horizontally, and the tilt angle of the phone measured by the method of this paper is between 0 and 1 degrees. Place a phone vertically, with the BC edge above the AD edge. The tilt angle of the phone measured by the method of this paper is between 89 and 90 degrees. Place a phone vertically, with the AB edge above the DC edge. The tilt angle of the phone measured by the method of this paper is between 89 and 90 degrees.

In this paper, the phone levelness measurement system based on SL4A director sensor was design and developed. The system has the advantages of simple realization, convenient carrying and convenient measurement etc. And it is suitable for the applications of daily life with low measuring precision, for examp le, hanging objects on the wall. The disadvantage of this method is that the measurement accuracy is not high enough and the system is difficu lt to be applied in the engineering fields with high precision. The next step is to improve the measurement accuracy.