I stopped buying expensive motion sensors once I realized a $6 ESP32 could do a better job for less

I stopped buying expensive motion sensors once I realized a $6 ESP32 could do a better job for less

Published Dec 3, 2026, 7:00 PM EST Patrick Campanale has been in the tech space for well over a decade, specializing in PC/gaming news and reviews, as well as maker-focused products to build small businesses. With a start in technology back in 2010 surrounding the Palm/webOS ecosystem, Patrick spent his formative years developing mobile applications as well as blogging for various publications, eventually leading to starting his own website in 2014. After running a technology blog for a few years, he stepped out of that role and into the world of high-end custom PC manufacturing and building, with a focus on YouTube video production and overclocking. Then, in 2017, Patrick joined the 9to5Toys team as an editor/writer/reviewer with over 14,000 articles being published during his time there, ranging from deals and roundups to in-depth reviews on the latest technology, video games, 3D printers, and more. In his free time, Patrick loves to create projects from wood using various robots and methods, including leveraging the technologies of CNCs and lasers. If Patrick isn't working on a computer or playing video games, he's likely in his 2-car garage workshop creating something unique. In addition to all this, Patrick is also the media director at his local church where he feels God has called him to serve, and he loves every minute of it. One night I got up in the middle of the night to go to the bathroom and relied on my motion sensor to turn the lights on for me. It did, but then they shut off a few minutes later because it thought nobody was there anymore. Thankfully I had grabbed my phone so I could use it as a flashlight to get back to bed. I knew there had to be a better way to handle something like this, and mmWave sensors were just too expensive. So, I decided to grab a few ESP32 boards from my drawer and give ESPresense a try. Needless to say, I’m hooked now. My motion sensors only know that something moved They can't tell me from my wife or the dog, and they think I left when I sit still A normal motion sensor detects just that—motion. I put a normal PIR motion sensor in our bathroom and it worked fine to detect when movement occurred, but it couldn’t detect presence. Stop moving for a certain amount of time and the motion detector no longer knows you’re there. This becomes an issue if you, like me, want to use a motion sensor to turn the bathroom lights on automatically at night and then off again when you leave the bathroom. Or, if you want to turn the lights at your office desk on when you sit down, but then you’re too still for them to stay on. I know that there are mmWave presence detectors, but off-the-shelf systems can get expensive. Even then, presence detectors only know that someone is there, but not necessarily who. So, for this specific project, I decided to skip mmWave sensors due to their cost and because they could only tell me that a body entered the room and I wanted more than that. So I turned to ESP32s and Home Assistant. ESPresense turns a bare ESP32 into a room presence sensor It finds my iPhone and Apple Watch over Bluetooth with no extra parts Many people use ESP32s to build mmWave-based motion sensors. In fact, before I found ESPresence, I was looking at buying ESP32s to build my own mmWave-based presence detectors for the house. Then, when I found ESPresence, everything changed for me. How is ESPresense different from normal presence detectors? An mmWave sensor looks for micro movement like breathing to know if there’s someone in the room. ESPresense uses Bluetooth Low Energy (BLE) to know if a device is in a room. This is how ESPresense is able to not only know if someone is in a room, but who it is. The way this works is simple. Every BLE-compatible device (almost every device with Bluetooth these days) gives off a unique identifier. As long as a device is powered on, it’s broadcasting this BLE identifier. ESPresense runs on an ESP32 that supports BLE and listens for these identifiers. Since every device is unique, my Apple Watch and iPhone have different BLE identifiers. Both my wife’s iPhone and her Apple Watch also have different BLE identifiers. My AirPods, MacBook, iPad, even Kobo all have unique BLE identifiers. ESPresense simply listens for the identifiers to know who is where at what time. It works by looking at the signal strength of the BLE device to the closest ESPresense node to know what room you’re in. So, if you have a large room, you might want to add multiple ESPresense nodes to the room, while smaller rooms could use just one. I tested the deployment with just two ESPresense nodes just to get a feel for the technology—one in my office, and one in my kitchen. ESPresense was able to detect when I entered a new room within about five seconds or so, which is a perfectly acceptable delay for me. Setting up ESPresense with Home Assistant isn’t that complicated You just need MQTT and a bit of YAML Actually deploying ESPresense is honestly pretty simple. ESPresense offers a web flasher that flashes the ESP32 board through a web browser. I had some issues with my ESP32 boards rebooting after being flashed but unplugging them from the computer and plugging them up to normal power booted them right up and started broadcasting the captive setup portal. From there, I just inserted my Wi-Fi network information, gave the ESPresense node a name, and then input my Home Assistant MQTT broker information. Once I hit save, the ESPresense node was broadcasting to Home Assistant within about 60 seconds. Once inside Home Assistant, you can start configuring how ESPresense works. Since Apple devices rotate their Bluetooth address every few minutes, they have to be paired slightly differently than other products. I had to use Home Assistant to navigate to the webpage for each ESPresense node directly. This allowed me to “enroll” my devices with the ESP32 natively. This enrollment captures the device’s IRK (Identity Resolving Key), which is a key that allows one device to identify another BLE device even when it has a rotating address. When enrolling my Apple Watch, the ESPresense node showed up as a “health device” but it’s not a big deal because once you do the initial pairing you can forget the ESPresense node on the Apple Watch or iPhone as it’s no longer needed. Once I had my iPhone and Apple Watch paired, I was able to monitor them inside of Home Assistant. This is where ESPresense really starts to shine. For instance, I am working on making my office smarter with smart lighting that turns on when I enter the room and off when I leave. So I can just tell Home Assistant to monitor my devices and turn the office lights on whenever I walk into the room. I can also add my wife’s devices too if we want in the future. I can then program it to shut off the lights once I walk away for, say, 10 minutes so it doesn’t turn on and off constantly throughout the day as I walk in and out of my office. The monitoring is done through YAML, like most of Home Assistant. I just had Claude write the code for the YAML, but it's fairly straightforward if you want to write it yourself. My code is below. sensor: - platform: mqtt_room device_id: "patrick-watch" name: "Patrick Watch Room" state_topic: "espresense/devices/patrick-watch" timeout: 10 away_timeout: 120 - platform: mqtt_room device_id: "patrick-phone" name: "Patrick iPhone Room" state_topic: "espresense/devices/patrick-phone" timeout: 10 away_timeout: 120 automation: - alias: "Office lights on when I walk in" triggers: - trigger: state entity_id: sensor.patrick_watch_room to: "patrick_office" actions: - action: light.turn_on target: entity_id: light.office - alias: "Office lights off 5 minutes after I leave" triggers: - trigger: template value_template: "{{ not is_state('sensor.patrick_watch_room', 'patrick_office') }}" for: "00:05:00" actions: - action: light.turn_off target: entity_id: light.office The best part about ESPresense is Home Assistant knows whether it’s my wife or I in a room. This allows me to program my office to turn on just the perimeter lights if my wife walks in so she can see, but to turn on everything including my monitor light bar and even start playing music when I walk in. I'm putting one of these in every room next They're cheap and sip power, as long as I can live with a few seconds of lag I started with just two ESP32-based ESPresense nodes because I wanted to prove the concept before going all-in on it. I already had some ESP32 boards from previous projects and it only took a second to flash them. Now, I plan to pick up a dozen or so ESP32 boards that I can use for this project to make the whole house know where we are at any given moment. The best part is, Home Assistant is private. I’m not giving this tracking information to Google, Apple, or Amazon. I’m giving it to me and me alone. So, I don’t mind if my smart home tracks me if it doesn’t tell anyone else what the information is. ESP32 boards can sip power, and can draw roughly half a watt to a watt with Wi-Fi and BLE scanning. This means I can pick up some cheap batteries and plug the boards in and just hide them anywhere. Or, if available, plug them into any USB-C outlet for unlimited power. The boards or sensors don’t need to be able to see anybody, they just need to be able to receive BLE signals, meaning I can place them inside cabinets or drawers to hide them and keep them plugged in 24/7. For my purposes, the 5 to 10 second delay that it takes ESPresense to know if someone enters the room is just fine. It takes me a few seconds to walk into the office and get situated at my desk, so the delay won’t matter much to me there. In a place like the bathroom at night, when I might or might not grab my phone, I’ll probably still eventually put an mmWave sensor there for evening routines, but it’ll be a backup to ESPresense if anything. The only downside to ESPresense is that it requires a BLE device to travel room to room. So, if there’s a day when I leave my Apple Watch charging in the bedroom and my iPhone on the kitchen counter, my office won’t wake up when I walk in. This is a very rare occurrence though, so I’m not worried too much about it. I'm not investing in sensors that can't tell who's in the room For the majority of rooms in the house, the small delay doesn’t beat the cost savings. An mmWave sensor can cost $50 or more depending on what other features it has onboard, and it’s hard to find a pure mmWave sensor with nothing else on it. PIR sensors are basically useless for most things too, since they stop detecting if movement stops. So, I’ll just pick up cheap ESP32 boards that only cost a few dollars a piece and can be bought in bulk to add presence sensors around my home. I’m going to work on pairing more devices with ESPresence, too, like my AirPods, MacBook, iPad, and other stuff so that way it can track me throughout the house even if I leave my iPhone or Apple Watch behind. 3-pack ESP32-S3 N16R8 This 3-pack of ESP32-S3 N16R8 microcontrollers are perfect for your DIY projects. Being the N16R8 models, there's enough memory and storage to run projects using platforms like MicroPython instead of having to rely on just straight C coding. Also, the breadboard pins are included in the package, though you will have to solder them on.

Original Source

Read the full article at Howtogeek →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.