Skip to main content

An ESP32 and a mmWave sensor that can tell you're still in the room

A PIR motion sensor notices you walk in, then loses you as soon as you sit still with a book — so the light goes off at the worst possible moment. A 24 GHz mmWave radar module such as the Hi-Link LD2410 picks up a person who is not moving, which is what a room actually needs.

An ESP32 dev board
An ESP32 dev board — the collector and relay for the sensor

The LD2410 is an FMCW radar, working at 24–24.25 GHz. It splits its field into nine distance gates, each 0.75 m wide, and reports motion and stationary energy for each one — so it can pick up even the millimetre-scale movement of breathing. Detection distance is adjustable from 0.75 to 6 m, with a detection angle of about ±60°.

Paired with an ESP32, it is a straightforward build: ESPHome supports the module directly, so an ESP32 and a few wires are enough to get a presence sensor into Home Assistant. Power it from 5 V (it needs more than 200 mA), the serial lines run at 3.3 V so no level shifter is needed, and the module talks at 256000 baud over UART. The LD2410C is the easiest variant to start with — 16 x 22 mm, pins at standard 2.54 mm pitch, and Bluetooth for setup from a phone.

A mmWave human presence sensor module
A mmWave human presence sensor module

Wiring takes about half an hour. Tuning takes longer, and it decides whether the sensor ends up useful or annoying — distance gates and sensitivity need setting for the room, not left at defaults.

That combination — a cheap ESP32 as the collector and relay, and a mmWave sensor doing the actual sensing — is a pattern worth watching. The same ESP32 can gather data from several sensors, relay it over Wi-Fi or MQTT, and feed it into a spatial picture of a building: which rooms are occupied, when, and for how long, without a camera anywhere in sight.

Sources:
https://en.soth.pl/guides/how-to-build-an-mmwave-presence-sensor-with-an-ld2410-and-esphome
https://bluegrays.com/en/blog/ld2410-esp32-mmwave-presence-sensor

Comments

Popular posts from this blog

Google Maps - Quadtree tiling system

So Google and other online mapsite using a tiling system to transfer large images. These images are cut into smaller ones, based on a nested hierachy.... known as Quadtree. Good explaination here Google use q,r,t,s (0-3) to denote one of 4 corners of a tile. So to find your location run this Python code .... Run it like this: python googletiles.py 17 -43.525 172.616 Spherical Mercator (ESPG:900913) coordinates for lat/lon: (19215525.222771712, -5392226.689463486) 17/128383/47899 ( TileMapService: z / x / y ) Google: 128383 83172 Quadkey: 31311030123311311 ( 14851095925 ) Substitute the QUADKEY values as follows 0=q 1=r 2=t 3=s Then type that list of letters into this page. .. Here's an example for Christchurch, NZ http://pallit.lhi.is/bigice/makeme.php?startPic=tsrsrrqsqrtssrrsrr&hTiles=14&vTiles=14 ___________ Other useful info on tiling cut your own tiles - x,y info http://makemeamap.com/cgi-bin/mercator4.pl view tiles on one page http://pallit.lhi.is/bigice...

NZMG - WGS84 Projections

NZMG was the official New Zealand mapping projection until 2001. From the LINZ website (NZ mapping body): "NZMG is not based on a geometric projection (transverse Mercator is based on a cylinder). Instead it uses a complex-number polynomial expansion. This has the advantage of exhibiting minimal scale distortion over New Zealand; however it is a projection unique to New Zealand and so can be difficult to use or program into computer software or positioning devices. " In packages such as ESRI ArcGIS you can reproject data easily...... however if you're writting your own software you need to find some libraries to do this. PROJ4 is one such library. It can be downloaded with GDAL / OGR as part of FW TOOLS. http://fwtools.maptools.org/ Here there are 2 tools to assist in transformations... PROJ and CS2CS. CS2CS caters with changes in DATUM. To convert from NZMG to WGS84 requires a change in datum. There are 3 methods to do this... a) 3 parameter shift b) 7 parameter shift c)...

Python with Gmail - post May 2022 'less secure' option removed

 https://www.abstractapi.com/guides/sending-email-with-python Useful article on how to get Gmail to work with Python post May 2022 when the "Less Secure" app access was turned off. Easiest method is to turn on 2FA and then create an application password. ========= [  Back up of the important text from the link above ]  Two-factor Authentication In order to allow our Python client script to access Gmail accounts we will enable two-factor authentication (2FA) which Google calls " 2-step verification ". With 2FA you add an extra layer of security to your account in case your password is stolen. After you set it up, you’ll sign in to your account in two steps using: something you know, like your  password  and something you have, like your  phone . To enable 2FA: Open your  Google Account . In the navigation panel, select  Security . Under “Signing in to Google,” select  2-Step Verification Click the blue GET STARTED button: Login using your pass...