Hacker News new | past | comments | ask | show | jobs | submit login
Inside a $1 radar motion sensor (10maurycy10.github.io)
597 points by nothacking_ 2 days ago | hide | past | favorite | 102 comments





Through-wall 2.4Ghz Wi-Fi CSI radar can be done with $20 ESP32 boards, https://github.com/Marsrocky/Awesome-WiFi-CSI-Sensing & https://www.cnx-software.com/2022/08/08/esp-wifi-csi-detects...

> Espressif claims it can also capture subtle movements caused by small movements such as breathing and chewing of people or animals in a static environment.. works with all ESP32 series microcontrollers including ESP32, ESP32-S2, and ESP32-C3, and does not require any changes to the hardware

2024 AI/NPU laptops with Wi-Fi 7 from Intel and Qualcomm can combine RF radar and on-device inference to identify human activity.

Related:

DIY Radio Telescope: Building a Camera That Can See WiFi (2019) https://www.youtube.com/watch?v=g3LT_b6K0Mc

Wi-Fi devices set to become object sensors by 2024 via IEEE 802.11bf standard (2021), https://news.ycombinator.com/item?id=40458766

How automotive radar measures the velocity of objects (2024) https://news.ycombinator.com/item?id=40768959

How Wi-Fi sensing of movement became usable (2024) https://www.technologyreview.com/2024/02/27/1088154/wifi-sen...


Wifi sensing is interesting, but you can combine a $3 ESP chip with one of these for a much easier project at lower cost: https://www.dfrobot.com/product-2795.html

I use those for presence detection in my house. 3D print a small case and for < $20 you have highly accurate presence detection that also works when sitting still. Ideal for automatic light and climate control.


My problem with similar sensors is that they don't work very well if you're sitting still around 3m away. Maybe my sensor isn't great, but when I'm sitting still at the computer, it frequently thinks I'm not there any more, which ruins any benefit.

There are some that detect heartbeat, I guess those might work. But those are mmWave, not just cheap 2.4GHz radars or PIR.

I've got LD2410B, which are mmWave, so they should detect heartbeat (and do), but not from more than 2-3m away.

Is the LD2410B sensing range limited by the PCB antenna?

I'm not sure, it always just made sense to me that the farther away someone is, the harder it'll be to detect their small movements.

Smallness detection depends on RF: higher frequency = shorter wavelength = more resolution for imaging.

Detection range without obstacles depends on transmit power and signal reception.

There are other models in the same family which might have more power/range.


A hack is to put a sensor on the chair

I solved the issue by linking my lights to a switch that I turn on when needed. It has worked very well so far, with no false detection at all!

plz let us know how it goes after sufficient testi g

Hmmmmm that's not a bad idea, I'll have to see how to do that, though. I don't want cables restricting me.

If your fine with zigbee, I could see having one of these aqara door sensors in the cushion of the seat, triggering to closed when you sit on it: https://cloudfree.shop/product/aqara-door-and-window-sensors...

Seems like it'd be finicky though.


Zigbee is great, but my chair has a mesh :/ I'll see if I can print something below, so that the sensor is activated, but yes, it does seem that it would be pretty finicky...

You can buy the sensors they use in car seats for like $10 https://a.co/d/0dibAFxc

Ceiling sensor is another option.

For now I've put a mmWave sensor under my desk, which works fairly OK. It's not perfect, but definitely good enough.

Pairing them with PIR detection should help to also detect stationary warm objects.

It's difficult to find good PIR sensors though. The commonly found cheap modules don't include a thermistor to compensate for room temperature. Finding one with analog output or continuous detection is even more difficult, most detect changes.

I did pair them, unfortunately PIR sensors are even worse at detecting stationary objects (less sensitive to body micromovements).

The “Vital Sign Detection & Healthcare”[1] section is very interesting, thank you! I am looking for a way to measure the heartbeat of a single person in a completely non-invasive manner (so without contact) and I see that it can be done with Wi-Fi (2019 Paper [2]). However, I’ve noticed that there are a lot of methods (video analysis, thermal camera, etc.), but they are hard to find as ready-made products at a reasonable price. The simplest solution is under-mattress sleep trackers, but unfortunately they are not an option for me.

1. https://github.com/Marsrocky/Awesome-WiFi-CSI-Sensing#vital-...

2. https://arxiv.org/abs/1908.05108


> measure the heartbeat of a single person in a completely non-invasive manner

NIST, "Monitoring Respiratory Motion with Wi-Fi CSI" (2022), https://www.nist.gov/news-events/news/2022/12/wi-fi-could-he... & https://doi.org/10.1109/ACCESS.2022.3230003

Google: Nest Hub sleep sensing for one person, with Fitbit Premium, https://www.techradar.com/health-fitness/how-to-track-your-s...


Interesting. I'd be interested in a breathing sensor that can work on someone working at a computer.

I’m sure it can be done with a normal camera and enough light, especially with the advancement of AI technologies in recent years. I haven’t had time to experiment, but if you have an iPhone, you can try this app [1] I installed yesterday to study its feasibility.

On the homepage, there is a video [2] explaining more as well, and their paper [3].

1. https://www.rouast.com/vitallens/

2. https://www.youtube.com/watch?v=_0HHjovI8hc

3. https://arxiv.org/pdf/2312.06892


Intel Meteor Lake+ platforms can use NPU for WiFi 7 Sensing.

Presence (commercial): https://community.intel.com/t5/Blogs/Tech-Innovation/Client/...

Breathing (research): https://www.intel.com/content/www/us/en/research/respiration...

For older Intel wifi radios, there is custom firmware and many research papers: https://dhalperi.github.io/linux-80211n-csitool/


> chewing of people or animals

The ESP32 can detect the difference between a cannibal and a vegan?

That's impressive.


How can you tell someone is a vegan? Don't worry, this 1$ radar motion sensor can tell you.

I think you could go cheaper. A sound detection sensor is a bit cheaper, and it just needs to detect the word 'vegan.'

Strangely enough I've heard far more people make this "joke" than actual vegans speaking up. Even when living in LA.

The issue with this joke is that it's 100% confirmation bias. You know that all the vegans tell you they're vegan because you don't know about the ones that didn't.

There are people that I discovered were vegans when discussing what to eat. And there are people that loudly announced they'd become vegans without any context.

The later group used to be larger, but I don't remember anybody doing that recently.


I think it's also survivorship bias. All the people who tell you they're vegan being vegan does not mean that all the people who are vegan will tell you they're vegan, just like all the people who won the lottery probably having bought lots of tickets does not mean that buying lots of tickets will win you the lottery.

That's what I meant, maybe I used the wrong bias name.

Confirmation bias typically refers to accepting very little evidence or rejecting disproofs. Survivorship bias is the one where you forget to account for the non-survivors of a particular selection criteria.

I know this under "selection bias", so now we have three contenders.

Still, I'm not sure if it's a big factor. You likely know who is vegan in your circles, because veganism is unusual enough to be a good topic for gossip, you can easily see it when sharing a meal with someone, and it's also something you'd like to know when inviting people over, if you want to be a good host. So I think a more relevant estimate would be number of vegans you know vs. how many of them announce their veganism at the earliest opportunity.


I believe survivorship bias is a specific type of selection bias.

It made more sense 20 years ago when it was more generally true. Veganism seems to have spread beyond the merely self-righteous now. It's a very old joke (possibly from the 90?s).

“Practically everyone knows what veganism is, but vegans are actually a very small minority.

There are more Americans with gambling addictions than there are people committed to vegan diets!”

Chart: https://x.com/cremieuxrecueil/status/1805367282270433791?s=4...


That's the trick, you invert the logic. If you hear the word vegan, assume the person saying it is not.

Come on, that's simple, just use voice recognition since the vegan won't stop telling the sensor about it.

Great links! I recall seeing somewhere that AMEX was investing in WiFi object detection…can’t remember exactly for what or how…

You can also use a single ESP and your WiFi AP as a source of packets.

These $1 boards also work through walls (I tried this).

I always go through walls.

— kool aid man


The gesture recognition sounds incredibly interesting. I work with vision based band tracking, and performance really isn't good enough for my application.

I wonder what kind of resolution you can reasonably achieve? Is it good enough to detect finger pose?

Aside: is there a way around IEEE paywall? I'd really love to read some of these papers


Reminds me of the HB100 teardown, but at least this one has an IC to make it more soothing that I don't really understand how it all works. https://www.allaboutcircuits.com/news/teardown-tuesday-hb100...

  I don’t know who designed this, but they were a master of the black art of Radio Frequency waveguide engineering. I am impressed. The PCB, itself, is a major component. Not only for the patch antennas but also several RF filters, the local oscillator, and the mixer are all largely made from peculiarly-shaped PCB tracks. Apart from the PCB, there are only five “components" on the board. Five passive components to implement a Doppler radar module. C’mon. You have to be impressed by that!


A little tangential, but are these things safe for humans? I have a couple of LD2410 devices and I’d like to use one of them with ESPHome in the bedroom. I did some research and they seem to be very low power and safe, but you know, before sleeping with a radar pointing at us all night long, I’m looking for as much feedback as possible.

Non-ionizing radio waves are generally safe for humans.

The only mechanism besides ionization that could harm humans is through the transfer of lots of power into the human body (think soldiers keeping themselves warm by stepping in front of a radar emitter).

So let's try to do a ballpark estimate of how much that could matter.

I haven't found (from a quick search) any data regarding the transmission power, but the data sheet at https://fcc.report/FCC-ID/2AD56HLK-LD2410B-P/6620025.pdf says the average current consumption is 79mA at 5V, which means it uses 0.4W.

How much of that is actually transmitted? I'd guess 10%-50% (likely much less, but let's go with this more conservative estimate, from a safety perspective), so now we're in the range of 40mW to 200mW.

If you absorb 1/4th of that (again, somewhat conservative estimate; you'll likely also reflect some, and most of it is going to pass you), we're at 10mW to 50mW extra power that is absorbed by your tissue.

Again, this is a super high (and thus for our purpose, conservative) estimate. Somebody else in this thread mentioned microwatts being absorbed, which sounds much more plausible.

To put this into context, the base level of power that an adult human operates on at rest is about 100W. This is a factor of 500 to 2500 more than the power absorbed from our millimeter wave radar. Unless all the absorption happens by a very specific and sensitive part of the body (like your eyes or so), this should just be background noise.

If you want another perspective, you could try to compare it with whatever radiation (both RF and heat) that your phone emits, that you likely carry in your pocket for hours at a time.


>soldiers keeping themselves warm by stepping in front of a radar emitter

Holy, did people actually do this? A quick search yielded no results. Not sure if thankful or not.


Works, it's a weird feeling, speaking from experience. HF antennas can give some respectable burns too.

But the effects are debated and not entirely scientific: https://www.reddit.com/r/army/comments/13r6hod/i_keep_being_...


Weren't microwave ovens invented because someone's chocolate melted in their pocket while operating a radio transmitter? Maybe it's just a lady godiva story since it seems weird that the person wouldn't feel overly hot as well, but maybe.

It's a well known story, he was doing maintenance:

https://en.wikipedia.org/wiki/Microwave_oven#Discovery

The thing is, you don't need a lot of extra heat to melt a chocolate bar on your pocket. It's perfectly possible that everybody felt hot when working on an active radar, but didn't discuss it or maybe even notice the correlation.


The bit on that wikipedia page about reanimating frozen hamsters is a bit of a sci-fi nightmare

Tom Scott has a great video on that: https://www.youtube.com/watch?v=2tdiKTSdE9Y

Oh wow it's even known what brand of a bar it was, funny that.

> The first food deliberately cooked with Spencer's microwave oven was popcorn, and the second was an egg, which exploded in the face of one of the experimenters.

They were having a blast I see.


> The only mechanism besides ionization that could harm humans [is heat]

This claim is, IMO, too strong given available evidence.

There are many chemical interactions with characteristic energies well below 1eV, or any reasonable threshold for "ionizing". Photons can couple with these interactions without ionizing anything. 4GHz range is probably fine, because the per photon energy is a small fraction of a mEv, but even then I would not rule out the possibility of multiple photons coupling to a structure without the imparted energy immediately being dispersed as heat.

Any time you have EM with low entropy/etendue, it is always theoretically possible for interactions to occur outside of the thermal regime.


Some phones have a SAR of almost 2W/kg, compared to that milliwatts of 10GHz RF are nothing. Not to mention that with standard energy dissipation formula of E~R^(-2) you're getting into microwatts at any practical distance from the antenna.

I have these all around the house, but not in the bedrooms. I use weight sensors to detect that someone is in bed and traditional PIR for motion in bedrooms.

Probably overly careful, but I didn't want to point a radar at my sleeping kids (and myself) for 12 hours per day. Similar for the WiFi access point upstairs, it's only in the hallway and not at maximum power.


> Probably overly careful, but I didn't want to point a radar at my sleeping kids (and myself) for 12 hours per day.

While I understand the sentiment. It's very very unlikely to be dangerous and there are plenty of other environmental dangers.

The biggest being the sun. But the most common man-made ones are probably auditory. Like toys and TVs being too loud or high-frequency sounds blasted from speakers in malls or under bridges to avoid "loitering."


Yeah on one hand you have people afraid of wifi and simultaneously sending their kids to play all day outside in UV index 11 without a hat or sunscreen. Things that are "natural" being inherently safe and anything technological literally death itself.

Loud toys are definitely dangerous for my children, they make me angry.

I agree with you, especially regarding children and anyone who hasn’t explicitly made this choice, which is why I asked the question. The only thing is, I suspect we get scared by certain words, like “radar” and “microwaves”, and then we might spend all day with our heads next to a Wi-Fi router or a phone constantly downloading files on 4G.

For example: maybe the ESP32 transmitting the bed weight exposes us to more danger than the radar sensor (that can also be placed very far from the bed)? Maybe with our smartphones charging on the nightstand too.

I’m not a big fan of fear-based, illogical decisions. But, again, I understand perfectly.


USB C mm wave "radars" that hook to home automation are a thing.

Priced between 11 and 20 bucks they are fairly feature rich...

If you want to roll your own check out what the folks over at ESP home have going on (google esp home mm wave).


The actual component costs about $5, if you want to roll your own with an ESP32.

Don't like these cheap sensors most of the time since most can't tell between a moving person and a fan rotating or curtain moving in a breeze. They are configurable to some degree but seems like not enough.

I'm sure there are more expensive options but they're more locked down/limited as well.


The LD2410 (B) is another option and it operates over UART. It is a bit more expensive ~$5 but has more configuration options.

Get the B variant, you can configure it over Bluetooth from your phone. Otherwise it's a huge hassle.

That said, it doesn't work very well for me when sitting still 4-5m away, it thinks I've left.


These radars are designed to detect motion, not someone sitting still.

Wrong, most of these radars are 24Ghz and specifically designed to detect body micro movements. They specifically give both human 'occupancy' and dynamic ranging information.

I wrote low level drivers for the ESP32 for all the ones I could buy and have tested all of them. The only one that does not try to give a human occupancy position is the car speed sensor.

The ld2450 can track three people at once.

https://github.com/mianos/hk-heltec-radar/tree/main/src


This sounds very interesting, how do your drivers work? I'd love to try them out, but there's no documentation. I've made a sensor board with various sensors, I could really use some occupancy detection improvements on the LD2450B.

All the boards provided by HiLink have an on board MCU and offer a serial protocol of some sort. I wrote a finite state machine based decoder for each them from the basic info on some documents,random example code and the textual description of the protocol from the aliexpress page. They are all wrapped in an outer state machine that provides entry and exit triggers. If you can read C++ the code is nothing fancy.

I have another more complete project for just the 2450 in another repo for the esp-idf with wifi provisioning and publishes presence to mqtt. I have 3 of these around the house.


That's great, I'll have a look, thank you!

here is the ld2450 multi object tracker: https://github.com/mianos/mqttradar It's pretty complete. There was some other guy who wanted an ld2450 tracker so I worked with him to get it going.

This is very exciting, thanks!

ps, it uses the esp-idf. I'm not using the Arduinio framework anymore. Any trouble getting it going or feature, put a ticket in.

I've played with these all the time! Great to know how they work!


MCU rp2040 from Pi Pico also costs 1$. We really are in great time for affordable hacking

Now if only the GHz-range oscilloscopes came down in price ...

The competition between Siglent Rigol and Uni-T will most likely drive down the cost. From a high baseline but still.

Wiener functions. I love 'em. An analog application too, top secret in WW II. Now also used in handset to eNodeB comms.

Since the user manual for this sensor mentions security monitoring as a possible application, I'm wondering: is there any simple way to prevent detection from such a mm wave radar? (Assuming for simplicity that we know where it's mounted, and in which direction it's pointing).

Depends on the definition of "simple", imo. The first thing that comes to mind is research into materials with good (tens of dB), wideband absorption in the mmWave bands. It's an area of active research [1] [2] (just a couple articles from a quick google, so caveat emptor).

[1] https://www.cambridge.org/core/journals/international-journa...

[2] https://pubs.rsc.org/en/content/articlelanding/2022/tc/d1tc0...


LD2410 work well too (do by the cable too, they have tiny non-standard pins)

Almost not related, but reminded me about recent RC hack I was working on.

I have an driveway alarm from mighty mule, which uses 433Mhz radio powered by two AA batteries to communicate signal from the coil sensor detection sitting next to the driveway to the base station in the house using OOK modulation. The stock PCB antenna was not very good at the distance I had it to work with, so I started experimenting with external antenna. I tried loaded antenna (i think it is what it is called - the one with the coil) and straight piece of wire.

I quickly realized that formula for 1/4 length is more of a starting point, and a lot depends on actual output components of the RC circuit (I have little to no understanding of how all of that works). I tried to cut slightly different sets of wires trying them next to HackRF/PortaPack showing me signal strength in the real time. Basically was eyeballing how strong and clear OOK bursts are, and how well or noisy they sounds through the built-in speaker... (again, I have no idea what I am doing...)

At some point I got tired of cutting wires and soldering them, so I tried to cut slightly longer wire and use thin piece of copper tubing to cover end of the antenna at various depth, hoping to simulate the antenna length changes. But at some point something weird to me happened - when just the tip of the antenna was covered by the tube, signal increased dramatically. I am talking about -55db - -50db to -36db on HackRF at the lowest usable gains settings...

I ended up with the antenna length slightly below 173mm ideal antenna length with a about 5mm-10mm "cap" made of aluminum foil tape (used for air ducts and such) at the very tip of the antenna. I also closed the other end of this wrap (in my imagination so that the signal does not escape this cap???). The cap itself is electrically disconnected from the antenna, it is just that - a cap.

I have no idea why it worked this way. I suspect by adding such a "cap" I modified something related to the capacitance or perhaps there is some resonance thing coming to play - no clue. But it became much more reliable at communicating over the distance I have it installed.

Perhaps someone who knows about such things, might give me a clue what I was dealing with.

Another thing that probably plays a role in this hack - outdoor transmitter is in the plastic box sitting vertically on a pvc pole, with batteries inside the same box. 1/4 straight antenna would not fit into it, but I also did not want to cut a hole at the top of the box to avoid water intrusion, so I pointed it down. But it also means it goes in parallel with the "USB" cable that connects to the coil-sensor next to the driveway. While system is not grounded, I suspect this USB cable is somehow became part of the antenna, since the best signal was when the line of sight between the antenna and base station, the usb cable was right behind the antenna. Distance between the antenna and usb cable running inside PVC pole is probably about 20-30mm.


I need to see a picture, but fyi some of components of an antenna are "electrically" disconnected, but still play a role, wave guides being one example.

Also note, if you are just receiving signals you have more freedom to experiment. Antenna tuning matters a lot more when transmitting (especially at larger powers). (Not implying that it doesn't matter with reception)


Just to clarify - I changed transmitters antenna.

I'm pretty curious if you could sketch something up.

Sounds like you might have inadvertently created a wave guide.

If you are feeling adventurous you might want to try dropping your creation into an Antenna Simulation software like NEC or something similar.

https://www.xnec2c.org/


https://imgur.com/qelKWpL

Here is youtube video someone fixing broken unit to get an idea what it looks like inside - https://www.youtube.com/watch?v=-k_6NsqFAdc

Not sized properly. Transmitter is sitting on a pretty tall pole right now and getting it off is a bit of a hassle. And I also already covered cap with a glued heatshrink to protect against elements, so accurate measurements are not possible without destroying it... But I hope it can give an idea what I came up with.

Thanks for the link to the simulation tool!


A capacitance hat is a legit way to electrically lengthen an antenna.

I have had decent success with them when finetuning antennas for lower bands.


thanks for the "capacitance hat" search term. from googling it looks like this hat is electrically connected to the antenna? In my case if the "cap" touches the copper wire of the antenna - signal strength decreased. Only when I kept the cap close but not touching the antenna it performed well.

Sure, but that does not stop it from capacitively coupling it.

Even tape or insulation from a wire can, be used to electrically lengthen or fine tune an antenna. But thats less about capacitance and more about the electrical lenght being longer in the dielectric.


You cannot try to rationalize the prices that China charges for goods. Everything is, more or less, state-owned and state-controlled.

If the Chinese government wants to undercut an American product, they will tell the manufacturer to drop the price to X, and the manufacturer will comply.

This also does not take into account Chinese currency manipulation.

Profit or loss be damned.


The BOM of this circuit really is very minimal because it’s a clever circuit.

It’s not without flaws (regulatory approval is non-existent for this) but they really did combine some dirt cheap components on to a dirt cheap PCB.

You, too, could assemble this circuit at scale for extremely low prices, no government intervention necessary.


Isn't the US basically the same? The US government gives massive subsidies, tax breaks or just has the military buy components for 10x the price (to offset commercial loses and R&D).

And creates regulatory capture for the rest, e.g. healthcare and big pharma ($4T a year), both of which too charge nontrivial multiples of what the rest of the world pays.

Not really. The American system of graft is more transparent. If there's a subsidy, there's a record of it. Tax breaks are public, tho there can be creative ways of couching them so they aren't obvious. Military expenditures are (with some very big exceptions) public record. And a US business under most circumstances can say "I'm not selling below cost".

None of this is really true of the Chinese system.


You make China sound like a VC,

Uber, AirBNB, etc ran at a loss to try to own the market.


The government also stands to benefit greatly if they throw their weight behind smart ideas, just like VCs. It would be interesting if the government could fund itself with investment.

VC returns are overall much worse than the S&P 500. The top firms are potentially better but that's a very limited investment pool. Softbank has shown what happens if you try the VC approach with a massive pool. Not good returns. The core value of VC has historically been due to it being uncorrelated with the stock market. That allows it to be a risk hedge for investors. The perception is that it is no longer uncorrelated so even that value is mostly gone.

The US government invests in growing the economy, or tries to, which increase tax revenue which gives the government more money.

edit: Also it's not that top VCs are better at finding investment but rather that their social capital means they provide values to companies beyond the investment money. As a result companies that are doing well which choose to take money from top VCs versus other VCs. As a result the model doesn't scale since there's a limited pool of top companies to invest in.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: