How Beacons Work: Physics of iBeacon Technology



    In our first publication, we reviewed and compared a range of iBeacon beacons available on the market. Today we will examine in more detail how the Bluetooth beacon works on the example of our European colleagues, and talk about how to use it to calculate the location inside the building.

    What is inside


    Despite the global coverage of iBeacon technology in the media, business and developer communities, it seems that there is some level of misunderstanding of the principles of its work. Now we will try to fix it and go deeper into the basics and explain what the beacons are and how they work.

    How do beacons work? The principles of their work are quite simple. Under the silicone case is a small ARM computer connected to a Bluetooth module - they are powered by a battery. A small chip from Nordic Semiconductor contains firmware - this is part of the low-level software that guarantees the correct operation of the beacons. Although the processing power of the processor and memory is limited, it is more than enough to process important data and encrypt the ID of the beacons (in order to increase security).

    On the tapering part of the beacon is a short wire that goes directly from the processor - this is the antenna. A broadcast antenna emits waves of a specific frequency and length: 2.4 GHz radio waves. If you disassemble the beacon, you will notice that the antenna does not resemble the antennas of old televisions and radios. And it is not only a matter of size. It has a curved shape and looks like a zigzag.

    This is done for a reason. The electromagnetic field around the straight wire takes the form of a donut - the waves do not propagate with the same force in all directions, which leads to the formation of "empty" zones. The best solution is to change the shape of the antenna so that the electromagnetic field takes the form of an ideal sphere. However, in real conditions this cannot be achieved, therefore, a lot of research is being done for this purpose. There are a huge number of books on the theory of antennas, and we conducted our own experiments so that our antennas produce a powerful and stable field.



    Source: MIT

    Beacons use Bluetooth Smart technology for communication. This is the latest version of the Bluetooth low-power standard, which is designed to transfer small amounts of data. The maximum packet size of Bluetooth 4.2 is 257 bytes. This is not enough to transmit media content, so the beacons only transmit their ID (in the case of the iBeacon protocol, the ID is divided into three parts: UUID, Major, Minor) and information about the strength of the emitted signal - this parameter is necessary to calculate the distance to the smartphone.

    Mathematics and physics


    The transmission range and stability of the beacon signal depend on two main factors: the transmission interval (frequency) and broadcast strength. The beacon does not transmit signals constantly - it works impulse. Frequency is the time between two consecutive data transfers. The higher the frequency, the more accurately the signal is detected.

    This is done because smartphones also “search” for beacons by scanning the air at a certain frequency, and this frequency may depend on the state of the phone (locked, unlocked). The type of OS and device also matters. If the phone is active, it will scan at a high frequency; if you put it in your pocket, after a few minutes it will begin to save battery power and limit the number of Bluetooth scans.

    At Estimote beacons, the time between pulses is 950 ms, but it can be changed in the range from 100 to 2000 ms. The standard frequency is not accidental. On average, iOS scans an area for beacons once a second. 950 ms is almost equal to this value. In a noisy room, the sent packet may not reach the device (or something / someone will block the direct visibility of the smartphone and the beacon). To increase the stability of the connection, you can increase the frequency of the packages.

    If you set the interval to 490 ms, then two packets will be transmitted in one scan by the smartphone. If you set the interval to 330 ms, then three packets will be transmitted in one scan; 240 ms is four packets and so on. If the first packet was not received by the device, there is a possibility that it will accept the rest. It is important to remember that increasing the number of packets sent will decrease battery life.



    In addition to the frequency, it is worth considering the strength of the broadcast. It describes signal strength and is measured in dBm (decibel-milliwatts). dBm is the absolute power level in decibels relative to the reference level of 1 mW. The operating distance of the beacon directly depends on the broadcasting power. It is impossible to say how far the radio waves propagate, since there is no specific point in space where they simply stop. For example, a light bulb, it illuminates a certain area around itself, but the light goes much further, scattering. The same thing happens with radio waves.

    The closer you are to the beacon, the more accurately the distance is calculated - this is due to the higher signal density in the immediate vicinity of the source. When you move away, the signal becomes more scattered and distorted until it becomes indistinguishable from background noise. To better understand the concept, imagine a beacon is a radio receiver and broadcast strength is a volume level.

    If you increase the volume, you can hear music from afar, and, coming closer, you will hear it more clearly. But if the volume level is very low, it may be difficult for you to recognize the melody, even if you attach your ear directly to the speaker. However, knowing the exact volume level in decibels does not allow you to perfectly accurately determine the distance at which the sound will be heard. Too many factors influence this: from obstacles (physical matter through which waves must penetrate) to hearing characteristics.



    Distance calculation


    You already know that a smartphone will be able to calculate the approximate distance to the beacon after it “hears” it. To do this, the phone reads the so-called RSSI (Received Signal Strength Indicator) - an indicator of the strength of the received signal, and then compares it with the signal level, measured 1 meter from the transmitter, which is delivered as part of the packet of transmitted data. So the smartphone calculates the approximate distance to the beacon. A distance of 1 meter was specially chosen: as mentioned above, it is much easier to obtain accurate values ​​at close distances due to the higher signal density.

    We have written the rules by which the distances to the beacons are calculated, but, as usual, in practice it turns out to be not so simple. Let's go back to the radio example: imagine that you put the radio not in a room, but in the middle of a noisy train station. The radio plays at full volume, and you can easily hear it when you are nearby, but you can’t determine its exact location - people hindering here and there. In addition to people, trains arriving and leaving are noisy, the dispatcher announces boarding - all this distorts the sound, so you can’t say with confidence what distance you are from the receiver.

    It is impossible to calculate the exact location of the beacon only on the basis of the received radio waves. Here, it’s not the trains and the dispatcher that bother you, but the multiplicity of wave propagation routes, diffraction, absorption, and interference. Remember, we said that it is impossible to design an antenna that propagates a signal in all directions with the same strength? Because of this, the relative orientation of the beacon and the smartphone in space can affect the approximation: RSSI readings vary greatly.

    If the beacon is located at a distance of 10 meters from your smartphone, the application can show the number 8, then guess and assume a distance of 10 meters, then report 12 meters, again return to 7 and again to 10 ... in general, you understand. If you turn the phone, the system may decide that you are 2 meters closer to the beacon.

    We examined the principles of operation of iBeacon technology using the example of the description of the Estimote beacons. And now we want to talk more about how indoor navigation works using technologies developed by Navigine .

    Indoor Navigation: Comment by Navigine


    Location services for iOS are governed by the Core Location framework, of which iBeacon is a part. The iBeacon standard was not developed to calculate the exact distance to the beacon and only operates with zones. There are four types of zones: immediate proximity (very close to the beacon), close (1-3 meters from the beacon), far (the zone where the signal fluctuates too much, and it is impossible to determine the distance more precisely) and is unknown. The Core Location framework allows you to activate the desired events in each zone.

    For small rooms, such as a cafe or restaurant, this will be enough, but what if you want to get the exact location on an area of ​​thousands of square meters, for example, in a warehouse, industrial enterprise or in a shopping center?

    So, the question remains open: is it possible to build a reliable indoor navigation service using iBeacon beacons? In short, yes, you can. Speaking in more detail, it is for this reason that any hardware infrastructure is only part of navigation systems. Based on the simple and cheap iBeacon infrastructure, our knowledge and approaches to indoor navigation (which we briefly talked about here , and will tell you more soon), we at Navigine developed a service that allows you to determine the indoor situation in the absence of satellite signals.

    The service is based on our integrated inertial navigation algorithms with a wide range of additional (corrective) information based on optimal estimation methods using Bayesian type filters.

    To maximize the scope, we process the following set of additional information:

    • RSSI cards Bluetooth / WiFi fields (so-called digital fingerprints);
    • GPS and GLONASS signals (if there is a partial signal, for example, at windows);
    • indications of crude gimballess inertial navigation systems (SINS) based on MEMS sensors (gyroscope, smartphone accelerometer);
    • information from magnetometers (compass) and smartphone barometers;
    • odometric information (measuring the speed of an object);
    • information about the room map (walls, obstacles, possible routes).

    As a result of the operation of navigation algorithms, the output is a point on the map in the mobile application. Ideally, location accuracy is 1 meter (1 σ).

    Just a year ago, testing indoor navigation based on iBeacon beacons required a long and boring process of removing a radio card. Now it’s enough to note where the beacons were installed on the map. We have an SDK for iOS / Android, which you can test by registering on the site , plus some of the algorithms are available on GitHub ( our repository ). Fork to health.

    Also popular now: