Introduction: Don't Get Caught Anymore!
(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
- Arduino Leonardo
- Arduino Uno
- PIR DYP-ME003 Sensor module
- 2 protoboards
- RF 433MHz Transmitter module
- RF 433MHz Receiver module
- 1 Green led
- 1 Red led
- Jumpers
- 2 paper Clips
- 2 little ball of Steel wool
1 resistor of 220 ohms
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:
- Arduino Uno
- PIR DYP-ME003 sensor module
- RF 433MHz Transmitter module
- 1 green LED
- 1 protoboard
- Jumpers
- 1 resistor 220 ohms
- 1 paper Clips
- 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:
- Arduino Leonardo
- 1 protoboard
- 1 Red led
- RF 433MHz Receiver module
- Jumpers
- 1 paper Clips
- 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