The use of cell phone azimuth sensor

Source: Internet
Author: User
Tags in degrees

Today's smartphones have integrated a wide range of sensor devices, such as temperature sensors, barometric sensors, and light sensors. Each sensor has its own role in the actual use of the process. Talk about the use of azimuth sensors today.

The azimuth transducer is orientation sensor. Its data are calculated using accelerometers and geomagnetic field sensors. The interpretation of the azimuth sensor that can be found on the Internet is:

Azimuth sensors are represented by X-, y-, and z-axis coordinates.

The three-axis coordinates return all angle values. is measured in degrees.

First angle: Azimuth (degrees of rotation around the z axis).

Represents the angle of the phone's own y-axis and the Arctic direction of the ground magnetic field, which is the angle of the top of the phone toward the north direction.

When the phone rotates around its z axis, the value of the angle changes.

range from 0-360 degrees.

Second angle: Pitch (degrees of rotation around the x axis).

Represents the angle at which the top or tail of the phone is tilted.

When the phone rotates around its own x-axis, the angle changes and the range of values is-180-180 degrees.

The angle is positive when the z-axis is positive toward the y-axis, and the angle is negative when the z-axis is rotated negatively toward the y-axis.

Suppose you put your phone's screen facing up horizontally on the table, and if the table is completely horizontal, the angle should be 0.

If lifted from the top of the phone until the phone is rotated 180 degrees along the x-axis (the screen is placed horizontally on the desktop), the angle value changes from 0 to-180.

If you lift from the bottom of your phone until you rotate your phone 180 degrees along the x-axis (the screen is placed horizontally on the desktop), the value of that angle changes from 0 to 180.

A third angle: roll (degrees of rotation around the y axis).

Represents the angle at which the left or right side of the phone is tilted.

When the phone rotates around its own x-axis, the value of the angle changes and the value range is-90-90 degrees.

When the z-axis is rotated forward toward the x-axis, the angle is negative;

The angle is positive when the z-axis is rotated negatively toward the x-axis.

More detailed documentation can be found on the web.

But I found that the range of the angle was 0-90 degrees during the actual use.

So I did a demo to see why the show doesn't fit.

In the picture, I display the azimuth sensor information of my phone in three-dimensional form on the graph.

Where the Blue line represents the x-axis, the Green line represents the y-axis, and the red line represents the z-axis. (I'm not used to seeing it:))

The data data frame in the upper left corner of the screen displays the three axes of the azimuth sensor in real time, in Unit degree.

In the actual test, azimuth and pitch were found to be in accordance with the instructions in the official documentation. The angle of azimuth is from 0-360 degrees. The angle of the pitch is from-180-180 degrees. The roll angle is not from 90-90 degrees, but from 0-90 degrees.

There is always a reason for the difference. When doing roll rotation, it is clear why only 0-90 degrees are seen.

The previous picture is the roll angle between 0-90 degrees, the latter is more than 90 degrees after the situation.

It's obvious that the coordinates are flipped.

While rotating the second 90 degrees, the coordinate system does not flip.

Then, when the third 90 degree is rotated, the coordinate system has been flipped again.

When the last rotation is 90 degrees, the coordinate system does not flip.

At this point, we can directly observe that the machine (cell phone) has turned over over the first 90 degrees and the third 90 degrees. Other words:

using the rotation roll angle characteristics, you can detect the reverse side of the mobile phone flip action.

It is now possible to explain why roll has an angle of only 0-90 degrees.

Further think about it, since the rotation roll angle can detect the mobile phone flip action, that rotation pitch angle can also detect mobile phone flip action?

The previous picture is the case when the pitch angle is close to 180 degrees, and the latter one is about 180 degrees to 180 degrees.

It is also apparent that the coordinates have not flipped.

After a 180 degree rotation continues, the coordinates do not flip. Other words:

Rotating the pitch angle does not detect the front and back flip action of the phone.

Here is the test video of the azimuth sensor:

Orientationsensor

Technology (yourtechnic) Blog: http://www.yourtechnic.com:7080/wordpress

The use of cell phone azimuth sensor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.