Life is too short to always remember to lock your workstation
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
A couple of small improvements.
Since the Attiny85 doesn't seem to provide pull-down resistor, a 200ohm is required. In the code the number of LEDs is hard coded. The KITT animation won't work with less than 4 LEDs and will likely crash the app. Caveat emptor
I always liked the concept of automatically locking my workstation when I leave the desk unattended for a short period of time. Oh well, apparently the LD2410, the presence sensor everyone is talking about for being cheap, practical, and functional is the perfect fit for the project.
Simply: the sensor operates with 5V, which I can provide via USB, and sets a pin HIGH at 3.3V (fantastic, no level shifting required) if a human is detected. Have a MCU that supports USB natively and presto the solution is ready.
I connected the sensor to my favorite dev board (a Seed Xiao nrf52840) using the pin D7. The rest is very simple code.
Wait for the pin to go high, set a timeout and when the timeout triggers send the corresponding lock sequence keyboard shortcut (on Mac: GUI + CTRL + Q). I resisted the temptation of using interrupts as the MCU has literally nothing to do, it's connected to a reliable power source and further thinking totally overboard.
A built-in LED echoes the status reported by the sensor for easy monitoring (is the thingy powered on?)
The only improvement left is to have the LED blink during the timeout period in order to attract enough attention to avoid a surprise lock when not appropriate.
Enjoy
INGREDIENTS:
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates