icon

Auto Login to Laptop using 24GHz Human Presence Detection Sensor

I love to automate my task and I always prefer to do it using Hardware even if I have a software solution for the same. But why?? That's because hardware is cool. So, like any human being on the planet Earth, I do also have secured my Laptop using a password and to make it more safe I have used a password long enough which make me bore when I have to enter it after every break which I take after every 20-30 mins. I also want to make the solution looks cool if some of my friends visit to me.

STEP 1
Collect the components
HARDWARE LIST
1 24GHz Human detection sensor
1 ESP32 Board
1 Breadboard
4 Jumper wires
STEP 2
Install the required library
icon ESP32-BLE-Keyboard-master (1).zip 11KB Download(2)
STEP 3
Software

This section is more interesting. Why? Let me explain…..

So, I spend more than a month writing the code for the sensor using the library, but there was something which I wasn't able to correct as a result of which I was not able to make it work using the UART connection of sensor but luckily we have the documentation of sensor. After reading about the same I got to know about sensor's IO1 and IO2 pins which made the code so simple that I completed the whole project in just 10 mins.

And the best part is I have not even used the sensor's library. If you have ever written any arduino code by yourself, you will be able to understand my code very easily.

ENJOY!

CODE
//Loving the project? Support us: https://links.electroboffin.com 

#include <BleKeyboard.h>

BleKeyboard bleKeyboard;
int in= 4; //pin of ESP32 board to which sensor's IO pin is connected
bool trial = true;

void setup()
{
  Serial.begin(115200);
  pinMode(in, INPUT);
  bleKeyboard.begin();
}

void loop()
{
  if(bleKeyboard.isConnected()) {
    int val = digitalRead(in);
    Serial.println(val);

    if(val == HIGH && trial==true){
      bleKeyboard.write(KEY_RETURN);
      delay(1500);
      bleKeyboard.print("ABFKODFSG[O"); //Change your password here
      delay(200);
      trial=false;
    }
  }
}
STEP 4
Connection diagram

You might be think I forgot this step?

Actually not, if you have read the code which you should. Then, you might have already guessed the connection diagram. That goes something like this
 

ESP32 Board ---------- mmwave Radar SENSOR

GND--------------------------G

3V3---------------------------V

D4-----------------------------IO1

 

That's it!

STEP 5
Project in action

I hope you loved it. Please do consider following us on social media to support us
https://links.electroboffin.com 

 

NOTE: This device works without connecting it to the PC using wire, it's acting as BLE HID device, I'm using a wire just to power it up. You can use any battery to do the same and then connect the device using bluetooth :)

License
All Rights
Reserved
licensBg
0