• Almost there...

    Enzo Lombardi07/05/2023 at 19:16 0 comments

    A couple of small improvements.

    1. Made the switch to the Attiny85, digispark flavor. This toy is fantastic and has the bare minimum needed to emulate the keyboard and...
    2. Added a neopixel ring. When someone is present a green LED will circle; if no presence detected, the ring will show a Knightrider KITT type of anymation. See video here.

    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

  • The concept

    Enzo Lombardi07/02/2023 at 02:38 0 comments

    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: