Presence Sensor Locks Computer When You Step Away

Having a computer that locks its screen after a few minutes of inactivity is always a good idea from a security standpoint, especially in offices where there is a lot of foot traffic. Even the five- or ten-minute activity timers that are set on most workstations aren’t really perfect solutions. While ideally in these situations we’d all be locking our screens manually when we get up, that doesn’t always happen. The only way to guarantee that this problem is solved is to use something like this automatic workstation locker.

The project is based around the LD2410 presence sensor — a small 24 GHz radar module featuring onboard signal processing which simplifies the detection of objects and motion. [Enzo] paired one of these modules with a Seeed Studio XIAO nRF52840 development board to listen to the radar module and send the screen lock keyboard shortcut to the computer when it detects that the user has walked away from the machine. The only thing that [Enzo] wants to add is a blinking LED to let the user know when the device is about to timeout so that it doesn’t accidentally lock the machine when not needed.

One of the parts of this build that is a little bit glossed over is the fact that plenty of microcontroller platforms can send keystrokes to a computer even if they’re not themselves a USB keyboard. Even the Arduino Uno can do this, so by now this feature is fairly platform-agnostic. Still, you can use this to your advantage if you have the opposite problem from [Enzo] and need your computer to stay logged in no matter what.

14 thoughts on “Presence Sensor Locks Computer When You Step Away

  1. You can also do this with a crotch sensor :P

    One thing that confuses me a bit is the “One of the parts of this build that is a little bit glossed over is the fact that plenty of microcontroller platforms can send keystrokes to a computer even if they’re not themselves a USB keyboard” part.

    From what I see, the uC acts like a HID, so it is a keyboard (as far as the PC is concerned). I am a bit surprised by the simplicity of the code. the whole HID part is just a handful lines of code (and a library).

  2. utter BS. Detecting the absence of a person “in offices where there is a lot of foot traffic” is futile. This can only work in a non-crowded space. Typically where such device is NOT needed.

  3. I had a Windows Hello compatible camera (a Tobii IIRC) set up to lock on absence, but the WIN+L on standing from a chair reflex always beat it to the punch.

  4. New HP tablet/laptops have this feature built in and set as a default in Win11 to turn off when no movement after 120 seconds or so.

    (…and it is the first thing in a huge list of things that I turn off. Can’t stand the utter crap.)

  5. Dang kids with their auto locking workstations, I still lock my workstation manually when stepping away out of habit thanks to unlocked hijinks since high school. Just like putting my seatbelt on to move the car to the end of the driveway. Hard habits to break

  6. Automatic stuff like this feels to me like it will just get in the way and get turned off on enough machine that folks expecting it to work will get no locking at all.

    IFF your Workstation is strictly only ever used by you, and only while you are actually sitting at it it will work fine. But what happens when your computer is playing a media file/presenation for the room so you are not sat at it, or if you happen to use VR in your workflow sometimes, or are constantly stepping away to put the novice you are supervising in the hot seat (etc) – Just learn to automatically lock the system yourself when you leave it! Or always take your important computing device with you so the workstation is just the horsepower, I wonder if you could net or USB drive boot it from your phone so all the important files are on the device most folks always carry everywhere and the workstation is just giving you all that compute performance.

  7. I used BlueProximity on Linux for 15+ years, worked beautifully when I worked on office. It keeps tabs on the Bluetooth connection between your phone and PC, and runs a command when the SNR drops bellow a threshold, and another one when it raises above the other.

    People were amused when I went back in the room and my computer magically unlocked half a second before I sit on the chair…

    Now working from home I don’t need it anymore.

    1. Back in the day I used Salling Clicker’s proximity mode to automatically lock my Mac when I walked away. I’ve always found it a bit surprising that Apple hasn’t integrated something like that into the OS yet, especially since they have the Apple Watch unlock mechanism.

  8. I thought this was another project using tons of unnecessary parts to do one simple job, like: why using ESP32? Then I realized ESP32 does not exist in the original project post. It is an editorial error.

  9. I once had a computer which would lock up whenever I stepped away from it. It took me the longest time to figure out why. It turned out that I had somehow connected the mother board reset to the case hard drive LED.

  10. There was a piece of software a long time ago that managed to do this by sending high-frequency pings through the speakers and then listening for echoes on the mic to determine if someone was in-front of the computer. Worked like a charm.

  11. Did the opposite 10 years ago: intentionally left my session open as a bait. Upon any activity detected on mouse or keyboard it would lock the session… And a webcam hidden in a Tylenol box on my desk would take a photo of the wannabe prankster and set it as background just before locking. At that time windows would display the background when locked.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.