dimhold.by
← Writing

In one public recording, Wi-Fi signal strength notices a person who walks and mostly misses one who sits

I had read more than once that Wi-Fi can see people through walls. I believed it in a general way. A body is mostly water, water absorbs 2.4 GHz, so a person in the room should change the signal. Every Wi-Fi client already reports that signal, iw dev wlan0 link prints it in dBm. If this number is enough, you can tell whether a room is empty without a camera and without new hardware.

I never checked what one such number actually shows. I also do not have the hardware for a proper test, so I took somebody else’s recordings.

The data

Sebastian Scheurer from University College Cork published a dataset on Zenodo in 2020. It was recorded in July 2018 with the Intel 5300 CSI Tool. Each room has an access point and 3 Raspberry Pi clients. For every packet on every link the file has the signal strength on 3 antennas and the gain of the receiver. A person was outside, sitting in the room or walking in it. Sitting and walking come in blocks of about 5 minutes, the empty stretches last 5 to 14 minutes. An annotation file has the time of every change.

I used 2 of the 4 rooms, where only one person takes part. That gives 6 links and 3 days per room. Per room the annotations have about 3 hours of sitting, against 77 to 87 minutes empty and less than an hour of walking. Some of these minutes have no recording. The minutes in doors and corridors I threw away.

The dataset gives raw numbers for each antenna. I turned them into dBm the same way the tool’s own get_total_rss.m does: add the power of the 3 antennas, subtract 44 and the gain. On average a link sends about 95 or 155 packets per second, depending on the room. I averaged them to one value per second, roughly what a laptop’s signal readout gives. Then I looked at windows of 10 seconds. For each window I took the spread and the mean.

Walking is easy

When the person walks, the median spread in a window goes up 8 to 21 times, depending on the link. The median spread of an empty room window is 0.04 to 0.06 dB, walking gives 0.45 to 0.95. The numbers are small, but the empty room is very quiet.

empty sitting walking sitting empty −59 −55 −51 0 min 10 min 20 min 30 min dBm
Room 2.60, link 4, 23 July 2018, one value per second. Shaded: the person is walking.

To make it a detector I needed a threshold. For each day I took the empty windows of the other 2 days on the same link. The threshold is where 5% of them are above it. So roughly 5% of empty windows should give a false alarm. It was 4.3% to 8.5%, higher in the second room. Walking windows went over the threshold in 80% to 99% of cases.

This part matches what I read. Wilson and Patwari built their “see through walls” tracking on the variance of signal strength, published in 2011. The people who recorded this dataset were working on detecting presence and movement.

A person who sits

A sitting person went over the same threshold in 12% to 43% of windows, depending on the link. That is clearly more than the empty room, so the body is not invisible. But even on the best link more than half of the windows with a person inside look empty.

0% 25% 50% 75% 100% link 128a · 54 link 128a · 56 link 128a · 58 link 260 · 4 link 260 · 6 link 260 · 8 empty sitting walking
Threshold: 95th percentile of the spread in the empty room on the other 2 days of the same link.

My next thought was that nobody needs an answer every 10 seconds. A motion sensor in a corridor keeps the light on for a few minutes after it sees you. So I tried the same rule: the room is occupied if any window in the last 5 minutes was above the threshold. The empty room was lit in 42% to 82% of its windows. I spent a while looking for a bug. Part of it was the protocol, because the empty block starts right after the person leaves. But even when I let only the empty room’s own alarms into the memory, it stayed lit 18% to 60% of the time.

So I counted whole blocks instead. A block is noticed if at least one window inside it is above the threshold. With the 5% threshold, each link noticed 23 to 31 of its 30 or 31 sitting blocks. It also noticed 4 to 7 of its 9 to 11 empty blocks. 5% per window sounds small, but an empty block of 5 to 7 minutes has 30 to 45 windows. Then I raised the threshold to the loudest empty window of the other days. Only 1 empty block per link was noticed, but the sitting blocks dropped to 5 to 21 of about 30.

On my first pass of this count, the links of one room missed 2 of their 9 walking blocks completely. That made no sense after 99% of walking windows. It turned out that the room has no recording at all for those blocks, on all 3 links. I dropped every block where less than half of the windows have data.

The level moves on its own

The other idea was the mean. If a person absorbs part of the signal, the level should drop while they sit in the room. Inside one day the mean while sitting differs from the empty room by -1.41 to +0.69 dB. The sign changes between links and even between days on one link. In 8 of 18 cases the level went up.

On 5 of 6 links the empty room itself moved more between days than the person moved it on the same link. On one link the empty level was -51.85 dBm on the first day and -48.42 on the third, while the person was marked as gone. I do not know what moved it. A door, a moved chair or people in the next room are all part of the channel. So is the hardware itself.

0 dB 1 dB 2 dB 3 dB 4 dB link 128a · 54 3.02 0.65 link 128a · 56 2.14 1.11 link 128a · 58 1.37 0.69 link 260 · 4 0.62 0.54 link 260 · 6 0.63 1.41 link 260 · 8 3.42 0.86 empty room, day to day person sitting, same day
The empty room drifts more between days than a sitting person moves it inside one day on 5 of 6 links.

One thing surprised me. I also tried the spread over raw packets instead of the per second averages and expected more data to help. For sitting it was worse on all 6 links. My guess is that a sitting person moves slowly and the averaging only removes fast noise, but I did not check that.

What I did not check

  • A real home. These are 2 university rooms from 2018 and one person who changed state every 5 minutes. Someone who reads for an hour without moving is probably harder to see.
  • More than one link at a time. The dataset has 3 links per room and I looked at each alone. Radio tomography combines many links and the CSI in the same dataset has 30 subcarriers instead of one summed number. Both probably see more, I did not try.
  • Breathing. A person who does not move still breathes. Patwari and colleagues found breathing in signal strength in 2014 with a network of many links. They write that a single link cannot reliably detect it. Later work found it in CSI. I did not look for it here.
  • Other cards. An Intel 5300 reports whole dB per antenna. Another card or a phone may give a different result.