loading

(PLEASE IF YOU LIKED IT, VOTE ON ME IN THE MICROCONTROLLER CONTEST, HELP ME TO BRING MORE USEFUL PROJECTS)

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 platafform you will fell free again. Using two arduinos a signal is launched when someone approach 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

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

It's quite a lot simple 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)

#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

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 a 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.

#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

Step 5: Profit

And here it's how it works, let me know if you liked it! :D

Top! Muito interessante, inovador
<p>Brigad&atilde;o!! ^^</p>
Parab&eacute;&eacute;ns Matheus, projeto brilhante, n&atilde;o te conhe&ccedil;o mas acho que voc&ecirc; tem um futuro brilhante pela frente!!! ?Continue no caminho certo!!!
<p>Muito obrigado Wagner, seria um prazer te conhecer! xD</p>
Woww exellent project very good idea
<p>thank you buddy!! :D</p>
<p>Ive been </p><h3><a href="http://www.urbandictionary.com/define.php?term=rick%20rolled" rel="nofollow">rick rolled</a></h3>
<p>it's super effective to distract isn't it??</p>
nice. idea
<p>Thanks m8!</p>
<p>That is really clever. </p>
<p>thanks buddy!</p>
<p>What a great idea!</p>
<p>thanks!! :D</p>

About This Instructable

7,716views

66favorites

License:

Bio: Just a future engeenir
More by matheus.rochadias:Don't Get Caught Anymore! 
Add instructable to: