How a compass works, including in a smartphone or a simpler phone

Today, humanity has come up with many different models of compasses. They differ not only in design, but also in operating principle. The way, for example, a magnetic compass works is very different from the principle of operation of a compass in a smartphone and a telephone, although in general the end result of their action - the readings - will be similar.

Mechanical compasses all work on the same principle.

Each model has its own advantages and disadvantages, so you can choose the most suitable device for each specific situation.

As an example, let's look at the operating principle of some types of compasses.

Magnetic compass

In a magnetic compass, the main element - the magnetic needle - is located along the lines of force of the Earth's magnetic field - a natural giant magnet - and points to its poles.

The needle of such a compass is aligned in the direction of the Earth's magnetic lines.

Due to the fact that the magnetic poles are located near the geographic poles, over most of the surface of the globe, a magnetic compass can be used to find the approximate direction of true north or south, and from this determine all other cardinal directions.

Difference between geographic and magnetic pole

Once we have obtained a more or less accurate angle of deviation of the compass needle from the north direction, it is time to eliminate another problem. The fact is that the magnetic and geographic poles on our planet differ greatly, depending on where we make the measurement. In other words, the “north” that your hiking compass points to is not at all the north where there is ice and polar bears.

To level out these differences, a certain angle called magnetic declination must be added (or subtracted) to the sensor readings. For example, in Yekaterinburg, the magnetic declination has a value of +14 degrees, which means the measured magnetometer readings should be reduced by the same 14 degrees.

In order to find out the magnetic declination in your coordinates, you can use a special resource:

Electronic (digital) compass

In this type of compass, the readings are also determined by the direction of the Earth's magnetic field, but in this case it is not the needle that works, but a special electronic device (magnetic sensor).

Such a compass does not depend on satellites and their visibility.

Unlike a magnetic compass, this device consumes electricity from a portable battery or batteries.

It is worth noting here that a digital compass is also sometimes called a satellite compass, which is not entirely true. We'll talk about satellite a little later.

How the digital compass works

Due to the widespread use of the Android mobile platform and GPS chips in final products in particular, I became interested in the idea of ​​​​working a digital compass, around which so many questions now arise. So, the object we are considering is a compass, which is based on the principle of construction on determining coordinates using satellite navigation systems. However, in practice there are cases when the compass contains a block of magnetoresistors (the principle of changing resistance depending on the position of an object in absolute space) or Hall elements as a receiver. Hall elements are built on the basis of micromechanical systems that are highly sensitive to changes in the magnetic field in the specific case of a change in the distribution of charges on a silicon wafer under the influence of the Earth's magnetic field. Devices based on magnetoresistors and Hall elements represent a compass in its classic form, as an autonomous measuring instrument, in contrast to “collective” type systems, the input information for which comes directly in the form of a satellite signal. As a result, systems based on an external source of information are essentially devices with a heading angle indication in the form of a compass.

Since in practice we most often deal with determining location and direction through navigation systems, an example of this is Android with its google maps application, the following is the principle of operation of the algorithm for just such a use case: 1. Based on signals from satellites, we take readings of the coordinates of the receiver satellite navigation system (and, accordingly, the object) 2. We note the moment in time at which the coordinates were determined. 3. We wait for a certain period of time, short enough for better results. 4. The location of the object is re-determined. 5. The simplest navigation problem of calculating the movement speed vector from the obtained coordinates of two points and the size of the time interval is solved, after which, knowing the vector, we easily obtain: a) direction of movement b) speed of movement 6. Go to step 2.

As we can see, the operation of the algorithm is ensured cyclically and the starting point for the beginning of the next vector will be the end of the guide vector for the last time interval. The disadvantages of this method in the use of digital compassing: if the object is motionless in absolute space, the direction of movement cannot be determined; the coordinate fixation points coincide in this case. As an exception, there are quite large objects (for example, large sea vessels), where it is possible to install 2 receivers (for example, at the bow and stern). Thus, the coordinates of two points can be obtained immediately, even if the object is stationary, and go to step 5. It is also necessary to take into account the accuracy of determining coordinates by satellite positioning systems and its effect on slow-moving objects, due to the spread of location errors.

Electromagnetic compass

This device is also oriented towards the Earth's magnetic field, but in order for it to start working, it must move in space. After all, it is the movement of a frame with a winding in a magnetic field - the main part of an electromagnetic compass - that generates an electric current, which, in turn, is reflected in the form of readings on instruments, which are used to compare the direction of movement of vehicles with a given course.

Thanks to this design, this device is insensitive to magnetic deviations associated with parts of the vehicle on which it is installed. However, to navigate using an electromagnetic compass, you must be in motion, because standing in one place, electric currents will not arise in the coils, which means there will be nothing for the instruments to measure.

Radio compass

In a radio compass, the direction is determined not by a magnetic field, but by a signal from a radio station, the location of which is known in advance. The photo shows an example of such a compass taken from an airplane panel:

Radio compasses are widely used in aviation, however, they have a number of disadvantages associated with the occurrence of large errors in measurements (more than ten degrees) due to distortion of the radio signal. Today they are increasingly being replaced by other navigation devices, for example, GPS navigators.

Satellite compass

A satellite compass works by receiving signals from satellites. Such a device shows the direction to the true poles, that is, to the geographic north and geographic south.

Such a compass will not work indoors or underground, which limits its scope of application.

The readings of this compass do not depend on magnetic anomalies and deviations, however, it will not work if the satellite signal disappears or the power supply runs out. These are the devices that are built into modern phones and smartphones, and on the same iPhone, the compass works by receiving signals from satellites and indicating directions to different sides of the world. Most smartphones initially have a built-in GPS receiver to expand its functionality, and when receiving data on the phone’s location, it is very easy to indicate directions to the cardinal points.

Testing the compass

Since we are using an Arduino pro mini board, we will need some kind of external programmer to load the program into it. We used an FTDI board as a programmer. After loading the program into the Arduino board, you will see that one of the LEDs in our assembled circuit will light up - it will point to the north.

After this, you can change the orientation of the board and watch the LEDs change. You can watch all these processes in more detail in the video at the end of the article. You may also notice that the compass will show the wrong direction to the north if there is a heavy metal object next to it or if you rotate the board along the Z axis. These difficulties in the operation of the compass can be overcome, but that is material for another article.

The best compass for tourism

For tourism, three options can be considered the most suitable - magnetic, electronic and satellite compasses - due to their compactness. However, let's figure out which option is most suitable for a multi-day stay in the wild in extreme conditions.

Electronic and satellite compasses are used in the latest means of communication - mobile phones, smartphones, iPhones, tablets, as well as watches, which makes them constant companions of modern man. This means that with a high degree of probability such a device will be with the owner if he gets into an emergency far from civilization. This is a big advantage of such devices.

Of all the devices that a person always has at hand, the first is a telephone, and often it also has a GPS with a compass function.

However, an electronic compass is inferior to a conventional magnetic one, because to determine the same magnetic poles in the electronic version, you need a source of electricity, and if it breaks down, an electric compass is unlikely to be repaired in the wild. At the same time, a simple magnetic compass does not need to be powered by electric current and can be quickly made from improvised means.

Well, a satellite compass in a modern means of communication, although a necessary thing, is still less convenient than a navigator. It is better to install on your phone not a compass, but a navigator, which will not only orient the owner to the cardinal directions, but will also be able to indicate his exact location on the map.

Since such a functional device is at hand, it is not rational to limit yourself to only the compass function on it.

However, in this case, such a navigation aid will have the same disadvantage as an electronic compass - dependence on electricity and the impossibility of repair in the event of a breakdown. But damage can also occur from falling or getting the phone wet, unless it is equipped with special protection, which most phones do not have.

The advantage of such a digital compass also lies in its miniature size and resistance to magnetic deviations.

In addition, in some cases the signal from the satellite simply will not reach the receiving device, which can lead to an emergency situation. For example, in caves or catacombs, where you can easily get lost, you won’t be able to use a satellite compass: there will be no signal from the satellite. Therefore, out of all the variety of compasses, the magnetic one still needs to come first, due to the simplicity of its design and independence from the power supply.

Next, we will look at the operation of a magnetic compass - the most universal and popular navigation device among tourists, hunters and other people whose activities involve being in the wild natural environment.

Optimizing the use of computer resources

When working with large assemblies, optimization of the use of computer resources should be ensured by:

  • special KOMPAS-3D settings that reduce the cost of computer resources;
  • using incomplete assembly loading, which frees up computer resources and thereby speeds up work with large assembly models.

1.1. 3D editor settings for working with a large assembly

1) When working with large assemblies, you need to use the simplified display mode - this will speed up the translation and rotation of the model. Set up the simplified display mode (Settings → Options... → System → Model Editor → Simplifications) as follows.

  • In the component simplification settings dialog, reduce the level of detail.
  • In the other settings dialog for simplified display mode, enable all options. By default, simplified model display mode is enabled; All options in the Simplified Display Mode Miscellaneous Settings dialog are also included.

2) Lower the image smoothing quality value (Settings → Options…→ System → Model Editor → Image Control). Select Low or No Antialiasing.

3) Disable all options in the orientation change settings dialog (Settings → Options... → System → Model Editor → Orientation change). This eliminates additional rotations and scaling of the model.

4) Make sure that the option Display read-only access for components in the access rights settings dialog is disabled (Settings → Options... → System → Files → Setting access rights). When this option is enabled, the time it takes to open a model file increases due to checking to see if components have the read-only attribute.

5) To reduce the time it takes to redraw the model after shifting or rotating, perform the following settings.

  • Using the menu commands View → Hide, disable the display of auxiliary assembly objects that are not needed for work (primarily threads). The display of most component helper objects in an assembly is disabled by default. If necessary, you can turn off the display of other objects using the Hide command in the View menu components.
  • Disable the “Halftone with wireframe” display mode, enable “Halftone”.

6) To quickly restore frequently used model positions, save them as custom orientations.

7) Increase the autosave period (10 minutes or more) or disable it altogether (Settings → Options…→ System → Files → Autosave).

More details about the 3D editor settings for working with large assemblies are written in the KOMPAS-3D Help, p. 3D editor settings for working with large assemblies.

1.2. Settings for Large Assembly Associative Drawings

To speed up the construction of associative views of an assembly in a drawing, before creating them, you can make the following settings in the new view parameters dialog for the current drawing (the dialog is called by the command Settings → Options... → Current drawing → Document Options → View):

  • on the Options tab, disable the Hidden and Library options,
  • on the Lines and Design Elements tabs, disable all options.

The described setting will allow you to get only the lines of the visible contour of the model in the drawing.

Images of thread symbols and hidden and library components can be included at the final stage of the drawing. Enabling thread symbols is done on the Design Elements tab of the Properties Panel when editing the view; turning on images of components - using the Show command from the context menu of these components in the Drawing Tree.

You can enable the display of hidden lines, transition lines, and fold lines on the Lines tab of the Property Bar while editing a view. However, when working with assemblies containing more than 1000 parts, it is not recommended to enable transfer to the hidden line view - this will lead to a significant increase in the time it takes to create and rebuild views.

More details about the settings for associative drawings of a large assembly are written in the KOMPAS-3D Help, p. Settings for associative drawings of a large assembly


Parallel View Processing

To create and rebuild several associative views at the same time, you need to activate the Allow parallel processing option in the KOMPAS-3D settings (Settings → Parameters... → System → General → System management).

Enabling parallel processing of views only makes sense if the computer is running a 64-bit OS and has a multi-core processor with sufficient RAM (8 GB or more).

Top Articles: 10 Ways to Help Wildlife and Animals

Working with a magnetic compass

A magnetic compass helps determine the direction to magnetic north and south, as well as the direction to a selected object relative to the direction to north - azimuth.

Since a magnetic compass responds to any magnetic field, in most cases its needle points not towards the magnetic poles of the Earth, which we talked about here, but away from them.

This is primarily due to magnetic deviations, which are caused by nearby magnetized objects.

The only way to reduce magnetic deviations in a travel compass is to stay far enough away from magnetic objects (such as a knife, cell phone, or other compass), objects (such as a car, airplane, or ship), and sources of electrical current (such as power lines). Although on sea vessels, magnetic deviations associated with the parts of the ship itself are eliminated using special systems equipped with magnets.

There are also areas in which the Earth's magnetic field lines deviate greatly from similar lines in neighboring areas. Such areas are called magnetic anomalies. The compass needle also “lies” in these areas.

It is worth noting that near the geographic poles of the Earth, both in the northern and southern hemispheres, in our time the compass can give large errors, up to 180°, that is, the largest error hypothetically possible.

It was not for nothing that I said that it is in our time. The fact is that the location of the magnetic pole (both south and north) is not constant. Firstly, at the moment the magnetic poles do not coincide with the locations of the geographical poles, and secondly, the location of the magnetic poles changes over time, and moves unpredictably, changing both the direction of movement and the speed. Therefore, we cannot exclude the possibility that sooner or later at some point in time it will coincide with the position of one of the Earth’s geographic poles.

Throughout the history of the Earth, the magnetic poles have repeatedly changed their location diametrically, that is, near the north geographic pole at different times there was both a north magnetic pole and a south magnetic pole.

In addition, due to the proximity of the geographic poles to the magnetic poles, difficulties can arise in measurements using a magnetic compass for the same reason that they arise at the magnetic poles themselves.

At points on the earth's surface corresponding to the earth's magnetic poles, a magnetic compass will not work, since the earth's magnetic field lines in these areas are directed strictly vertically. More precisely, it will work, but only if it is turned on its side - the magnetic needle in this case will take a strictly vertical position, that is, exactly along the magnetic lines of the Earth.

How to determine cardinal directions

The compass mechanism is simple and ingenious - a magnetized needle, placed in a case under transparent glass in the center of the dial (dial), when released from the stopper, will show the north pole with its north tail, and the south pole, respectively, with its south tail. The limb is marked with the cardinal directions using letters. If the device is domestic, then the letters will be taken from the Russian alphabet, but if the device was not made in our country, then in accordance with international designations, Latin.

The dial has a circular scale of 360 degrees, which is divided into 4 identical sectors, increasing clockwise. The size of the scale step for an individual device may be different, however, in any case, any of the directions of light is delineated by certain degrees:

  • north is marked 0 degrees,
  • south - 180 degrees,
  • east - 90 degrees,
  • west - 270 degrees.

Determining the cardinal directions using the device is quite simple, but in order for the mechanism to indicate the correct direction, a number of simple rules must be followed.

The device must be given an exact horizontal position - for this it is either placed on a flat surface or held with an open palm slightly below chest level.

There should be no magnetic interference nearby, such as:

  • accumulations of metal,
  • railway track,
  • power lines,
  • as well as other similar interference.

If these requirements are not met, the arrow will show the wrong direction.

Once the compass is in the correct position, you will need to release the lock, which acts as a brake or stopper.

The released arrow, having wavered, will take a firm position when the specially marked northern tip indicates north, and the opposite one indicates south.

After this, you need to align the tips of the arrow with the cardinal directions marked on the dial.

In order to determine a route on the ground, it is necessary to correctly select the desired direction of the path, corresponding to the desired part of the map or outline.

Top articles: How much fresh water is there on Earth?

Compass malfunction

A faulty compass can also give incorrect readings, so before you go on a trip, each device you take with you should be checked for serviceability.

To do this, a magnetized object, for example a knife, is brought to the side of the compass until the compass needle deviates to the side. After the object causing the magnetic deviation is eliminated, the needle should return to its previous position. The same must be done by bringing a magnetized object from the other side.

If the arrow returns to its original place after all the manipulations, such a compass will work correctly. If you haven’t returned, then you can’t use this compass: it’s faulty.

Does a magnetic compass work outside of Earth?

Many stars, planets and their satellites have a magnetic field, but often the magnetic field is so weak that it cannot affect the needle of a magnetic compass. More sensitive instruments detect even such an insignificant manifestation of magnetism, but now we are not talking about them.

For example, on the Moon, it is most likely impossible to use a magnetic compass for orientation, since the Moon’s magnetic field is very weak.

The same applies to outer space at a great distance from celestial bodies. Here the magnetic fields, as a rule, are so small that they are not able to move the needle of the magnetic compass from its place.

The last statement is true only for a magnetic compass located far from a spaceship roaming the expanses of space. On the ISS, compass readings will depend entirely on magnetic deviations caused solely by parts of the space station itself.

On the other hand, we should not forget that even on those planets where the magnetic field is no less, or even greater, than on Earth, the magnetic poles periodically change places, and the direction to the magnetic pole will most likely not coincide with the direction to the geographic pole . In principle, as mentioned earlier, the Earth has the same “trouble”, and the fact that today we have the opportunity to use a magnetic compass to approximately determine the direction to the geographic poles is, one might say, just a happy coincidence.

Thus, speaking about a magnetic compass as the main means of navigation for a tourist, one must always remember about the limitations in its operation, which, fortunately, are not many. In most cases, a magnetic compass, when used correctly, will help people find their way in space; if they have a map, they will help determine their location, as well as find the direction for further movement, including in order to quickly reach people in an emergency.

If in an emergency situation a person does not have a navigator, a compass, or metal objects from which one could be made, then all that remains is to navigate using the so-called solar compass - a gnomon.

Author: Maxim Chechetov

Orientation using a compass

Let's move on to practical issues - using a compass in hiking conditions. Let's say you find an interesting geographical object on the map and want to get to it. First you need to determine the azimuth.

  1. Determine your location on the map.

Draw a line vertically upward from this point, this direction is north.

Place a compass on the map so that its center lies on the point where you are, and the letter C (or N) is on the drawn line.

Rotate the map until the compass needle points north (remember to release the brake).

While looking through the slot at the front sight, rotate the top of the compass to bring the desired object into the “sight.”

All that remains is to see what value the pointer arrow is pointing at. If it is between two numbers, take the smaller value; then count the number of divisions from the number to the arrow. Since each of these corresponds to 5⁰, multiply the resulting number by five and add to the value read on the scale.

  1. Place the compass on a hard surface. If there are no rocks, stumps or similar objects nearby that are of suitable height, use a backpack standing on the ground. You can set the azimuth while holding the device in your hands, but this will create additional difficulties.

Release the brake and align the blue end of the arrow with the letter C (or N).

Place the pointer on the azimuth value.

Look through the slot at the front sight and select a landmark.

You can hit the road. Once you reach a landmark, take out your compass and determine the next one. Continue until you come to the right place.

And if you like outdoor recreation, do not miss our description of campsites.

  1. Position the device so that the blue end of the arrow points to the letter C (or N).

Rotate the top to direct the front sight to the parking area.

Write down the azimuth value in case the pointer gets lost.

When moving through the cloud, hold the compass in front of you, make sure the north end of the arrow is aligned with the letter C, and go in the direction that the sighting device is pointing.

Of course, this method is not accurate enough, and it is better not to get into such situations, but if necessary, you can use it. If the distance is short, you won’t pass by the mountain, but without a compass you can go somewhere unknown or circle in one place for an infinitely long time.

If anything is unclear or you want to reinforce the material, watch the video on how to use the compass:


At one time, knowing how to navigate using a compass helped me get out to people in the taiga. Just leaving the camp, I immediately determined my direction using the compass and, moving forward, adhered to the high landmarks that lay on this line. Two days later, I followed the compass back to the tents, where my excited friends were waiting for me.

Top Articles: These Little Sticky Leaves Are a Deadly Insect Trap

To be honest, I don’t know how to navigate with a compass, although at school I went to a “terrain navigation” club. Of course, some knowledge remains and, if desired, you can strain and remember. I may need it someday, but I would work with an instructor.

For me, using a compass was just a game during my school years. There were lessons where we learned to determine azimuth, which was very interesting for us. Now my daughter goes to tourist clubs. I believe that everyone should be able to navigate the terrain.

( 2 ratings, average 4.5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]