Introduction: Wireless Boss Eye

About: software engineer from Shanghai China.

This is sequel of previous Arduino boss key. I add RF wireless functionality to the original boss key so that you can put the PIR sensor anywhere you want to catch your boss. I stole the RF wireless from this instruable from which you can find more about the RF transmitter-receiver.

Have you ever been caught surfing during the work time? Have you ever tried to cover your mess when boss is coming? Have you ever dreamed of a gadget that could look you back? Now I have the answer with the help of the Arduino.

This is a very simple project that take advantage of the Arduino (mostly keyboard library) PIR sensor, RF wireless transmitter-receiver and the Autohotkey script.

Basically the PIR sensor tell the Arduino via RF transmitter-receiver, the brain, that someone is coming towards you and Arduino trigger a key stroke to your laptop and the autohotkey script in the laptop listen to this key stroke and interprete to something else, in our case, bring your work i.e. excel file to the front.

Step 1: Parts and Materials

Parts list:

  • Sparkfun Arduino pro micro(mega32u4 which support keyboard library) as receiver
  • Arduino pro mini (mega328p) as transmitter
  • PIR sensor
  • RF 315 transmitter-receiver module
  • USB cable
  • Jumper wires
  • computer or laptop (only support Windows OS)

The parts for this project should be ~100RMB. All the parts should be easily to find in Taobao in China or somewhere from US.

Step 2: Build the Circuit / Wire the Parts

transmitter

PIR sensor:

  • VCC >>> VCC in Arduino
  • GND >>> GND in Arduino
  • OUT >>> D7 in Arduino

RF 315 transmitter:

  • VCC >>> VCC in Arduino
  • GND >>> GND in Arduino
  • ATAD >>> D9 in Arduino

Arduino

  • VIN >>> VCC of 9v battery
  • GND >>> GND of 9v battery

receiver

receiver is simpler, you just need wire the Arduino Sparkfun Pro Micro to the RF 315 receiver

  • VCC >>> VCC in Arduino
  • GND >>> GND in Arduino
  • DATA (the PIN next to the VCC) >>> PIN 9 in Arduino

Step 3: Write the Code (autohotkey)

This part is the same as the previous Arduino boss key.

AutoHotkey is a simple tool that allow you

to turn just about any action into a simple keyboard shortcut. Here comes a introduction from lifehacker: http://lifehacker.com/316589/turn-any-action-into... However it's not required to learn this tool or scripting for this project, you can just download the script file and run it.

1. install authotkey from autohotkey.com if you don't already have it.

2. create a working file, in our case, worklist.xls

3. download the script f3_work.ank here

4. double click the script to enable the script The script map the F3 key to the action that trys to bring working file, worklist.xls in my case, to the front or open the file if it hasn't been opened.

f3::

IfWinExist Microsoft Excel - worklist

{

WinActivate

}

else

{

Run C:\worklist.xls

WinWait Microsoft Excel - worklist

WinActivate

}

return

5. test the autohotkey script by pressing the F3 key. You should be able to see that file is being opened or is brought to the front. --- NOTE! you can choose whatever application or file you want to bring to the front. Just make sure to replace the "Microsoft Excel - worklist" as title with yours.

Step 4: Wirte Code (Arduino)

Library

To be able to control the RF 315 transmitter/receiver, you need to understand protocol and program accordingly. Fortunately there is a popular Library for arduino Called "" VirtualWire"" Created by Mike McCauley

VirtualWire is an Arduino library that provides features to send short messages, without addressing, retransmit or acknowledgment, a bit like UDP over wireless, using ASK (amplitude shift keying). Supports a number of inexpensive radio transmitters and receivers.

This library allow You to send and receive data"byte" and string easily ,

First Download the library from Here .

after extract the folder, and move it to " Libraries " on the arduino Folder

transmitter code

download

receiver code

download

Step 5: In Action

just hide the "transmitter" part to somewhere (e.g. folded magazine) and plug in the "receiver" to usb slot of your laptop.

Please heart this post if you like the idea and if you have any questions/suggestion, please leave a message.

Thank you!