Don’t Get Caught Anymore!

Don’t Get Caught Anymore!

Have you ever been caught seeing something that you didn’t want the others knew you see? Like the new music video of Miley Cyrus, the twilight saga or por….” videos”. You won’t have to be afraid again when you want to see anything. With the Don’t get Caught platform you will fell free again. Using two Arduinos a signal is launched when someone approaches from the door, and close the window that you were seeing, then open a beautiful video. Don’t get caught anymore!

Step 1: Things You Will Need

f31qbd7izt6pyyi

You will need a few things

  1. Arduino Leonardo
  2. Arduino Uno
  3. PIR DYP-ME003 Sensor module
  4. 2 protoboards
  5. RF 433MHz Transmitter module
  6. RF 433MHz Receiver module
  7. 1 Green led
  8. 1 Red led
  9. Jumpers
  10. 2 paper Clips
  11. 2 little ball of Steel wool
  12. 1 resistor of 220 ohms
  13. Your PC

Step 2: Building the Transmissor

Building the Transmissor
16990100_1278326585582389_630553216_o.jpg

It’s quite a lot simply doing this one, as I said before, it’s easy and you can have some other use of it.

You’re going to need those items here:

  1. Arduino Uno
  2. PIR DYP-ME003 sensor module
  3. RF 433MHz Transmitter module
  4. 1 green LED
  5. 1 protoboard
  6. Jumpers
  7. 1 resistor 220 ohms
  8. 1 paper Clips
  9. 1 little ball of Steel wool

You will assemble like the picture above, i used the paper clip and the ball of steel wool like an antenna, to amplify the range of the transmitter module.

Here the sensor PIR will catch any movement and send to the receiver a signal that someone is coming. It will turn on the led when it happens, the code for this arduino is this one: (you’ll need to download the library VirtualWire.h and the Keyboard.h). code1

#include <VirtualWire.h>
const int ledPin = 13;
const int pir = A0;
int value;
char Value_CharMsg[4]; 
int state = 0;
void setup() 
{
  Serial.begin(9600);   
  pinMode(ledPin,OUTPUT);
  pinMode(pir,INPUT);
  vw_set_tx_pin(4);
  vw_setup(5000);
  Serial.println("Looking around: \n");
}

void loop() 
{
  value = digitalRead(pir);
 
  state = 0;
  if (value == 0)
  { itoa(state,Value_CharMsg,10);
    Serial.print("Value sended: ");
    Serial.println(Value_CharMsg);
    delay(1000);
  else {
  
    state = 1;
    digitalWrite(13, true);
     itoa(state,Value_CharMsg,10);
    vw_send((uint8_t *)Value_CharMsg, strlen(Value_CharMsg));
    Serial.print("Value sended: ");
    Serial.println(Value_CharMsg);
    vw_wait_tx();
  
   
    delay(10000);
    digitalWrite(13, false);
}
}

Step 3: Building the Receiver

Building the Receiver
16826158_1279299955485052_2480158749757490873_o.jpg

For this one you gonna use:

  1. Arduino Leonardo
  2. 1 protoboard
  3. 1 Red led
  4. RF 433MHz Receiver module
  5. Jumpers
  6. 1 paper Clips
  7. 1 little ball of Steel wool

You will assemble like the picture above, In this one, the Arduino will detect the signal transmitted from the sensor, and tell to the computer to press combinations of buttons that will active the final program.

Why using an Arduino Leonardo? this platform can interact with your computer and send a command to it so this one will be always connected to the PC.

This is the code you’ll use here. code 2

#include <VirtualWire.h>
#include <Keyboard.h>
//Define pin led
int ledPin = 5;
int value_RF;
char receive_RF_char[4]; 

void setup() 
{
   Keyboard.begin();
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
  vw_set_rx_pin(7);
  vw_setup(5000); 
  vw_rx_start();
  Serial.println("Waiting...");
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    
    if (vw_get_message(buf, &buflen)) 
    {
    int i;
        for (i = 0; i < buflen; i++)
       {            
          receive_RF_char[i] = char(buf[i]);
       }
       receive_RF_char[buflen] = '\0';
       
       value_RF = atoi(receive_RF_char);
         
       Serial.print("receive: ");
       Serial.print(value_RF);
       if (value_RF == 1)
       {
         Keyboard.press(KEY_LEFT_CTRL);
        Keyboard.press(KEY_LEFT_SHIFT);
        Keyboard.press('j');
        delay(10);
        Keyboard.releaseAll();
         
         
         digitalWrite(ledPin, HIGH);
         Serial.println(" - Led on !");
       
       }
       if (value_RF == 0)
       {
      
         digitalWrite(ledPin, LOW);
         Serial.println(" - Led off !");
       }
    }
}

Step 4: Making the Program on the Prompt

Here comes the final part, you’ll need to open the command prompt and open your Web browser (in my case i use the google chrome, so if you use it, you can just copy my program) and digit the command tasklist, it will show you all the open programs, identify your current browser.

Now open the notebook and write this:

//

taskkill.exe/IM (name of your web browser)

start (name of the browser) (the page you want to open)

//

save it like: name_of_program.bat (the .bat is the function that run the prompt). You can open any page.

After that you’re gonna create a shortcut, open the Properties of the shortcut and put this on shortcut key Ctrl + Shift + J, this is the command that the Arduino sends to the computer

files: here

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s