From LedHed's Wiki
Jump to: navigation, search
Line 1: Line 1:
 
Often I wear my headphones at work and listen to music. Unfortunately I sit at a corner desk and my view of the office entrance is obstructed. This leads to people standing over my shoulder with out my knowing about it. This bugs me, so one day I decided to do something about it.
 
Often I wear my headphones at work and listen to music. Unfortunately I sit at a corner desk and my view of the office entrance is obstructed. This leads to people standing over my shoulder with out my knowing about it. This bugs me, so one day I decided to do something about it.
 +
 +
== DISCLAIMER ==
 +
I take no responsibility for any loss or damage that may result from building this device or using the software or source code provided below.<br>
 +
<span style="color:red">'''Use at your own risk!'''</span>
 +
 +
  
 
== Goals ==
 
== Goals ==
 
While I could very well have placed a mirror on my desk or monitor I decided that it would be nice when someone walks in to receive some form of notification in the form of a balloon notification, audible tone, or a screen flash.  This requires a motion sensor that can interface with my PC.
 
While I could very well have placed a mirror on my desk or monitor I decided that it would be nice when someone walks in to receive some form of notification in the form of a balloon notification, audible tone, or a screen flash.  This requires a motion sensor that can interface with my PC.
  
'''Requirements'''
+
 
 +
 
 +
== Requirements ==
 
* Inexpensive
 
* Inexpensive
 
* Simple to build
 
* Simple to build
* Small
+
* Small (easily disguised in a picture frame or paperweight)
 
* Reliable (Not to many false positives)
 
* Reliable (Not to many false positives)
  
Line 35: Line 43:
 
'''Wire:'''
 
'''Wire:'''
 
I used strands of wire from CAT5 cable I had laying around for the internal wiring.
 
I used strands of wire from CAT5 cable I had laying around for the internal wiring.
I also used an old headphone cable for the link cable between the Serial port to the project box (AKA Altoids can).
+
I also used an old headphone cable for the link cable between the Serial port to the project box (a.k.a [http://www.altoids.com ALTOIDS] can).
  
 
=== USB to Serial adapter ===
 
=== USB to Serial adapter ===
Line 61: Line 69:
 
== .NET Code ==
 
== .NET Code ==
 
I decided to use the DSR pin on the Serial port because VB.NET has the an Event Handler that deals with ''pinchanged'' events. <br>
 
I decided to use the DSR pin on the Serial port because VB.NET has the an Event Handler that deals with ''pinchanged'' events. <br>
Specifically on the [http://msdn.microsoft.com/en-us/library/s9yhswbz.aspx System.IO.Ports.SerialPort] class there is the [http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.dsrholding.aspx DSRHolding] property that will return a True/False based on whether the DSR pin is receiving current or not.
+
Specifically on the [http://msdn.microsoft.com/en-us/library/s9yhswbz.aspx System.IO.Ports.SerialPort] class there is the [http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.dsrholding.aspx DSRHolding] property that will return a True/False based on whether the DSR pin is receiving current or not. <br>
 +
<br>
 +
Please keep in mind that programming is not my profession nor even a hobby of mine. I'm almost certain there are better / more efficient ways of coding this application.
 +
That said, I'm providing the code for others to use or even expand on to their liking.
 +
 
 +
[[Media:USBEye-1.0-source.zip|USBEye-1.0-source.zip]]
 +
 
  
 +
=== Executable ===
 +
[[Media:USBEye.zip|USBEye.zip]]
  
  

Revision as of 01:57, 22 February 2013

Often I wear my headphones at work and listen to music. Unfortunately I sit at a corner desk and my view of the office entrance is obstructed. This leads to people standing over my shoulder with out my knowing about it. This bugs me, so one day I decided to do something about it.

DISCLAIMER

I take no responsibility for any loss or damage that may result from building this device or using the software or source code provided below.
Use at your own risk!


Goals

While I could very well have placed a mirror on my desk or monitor I decided that it would be nice when someone walks in to receive some form of notification in the form of a balloon notification, audible tone, or a screen flash. This requires a motion sensor that can interface with my PC.


Requirements

  • Inexpensive
  • Simple to build
  • Small (easily disguised in a picture frame or paperweight)
  • Reliable (Not to many false positives)


Design

After doing some research I decided a PIR (Passive Infrared) sensor would be sufficient. I found this one (Parallax PIR Rev.B) which is widely available at your local Radio Shack.

USBEye-Diagram.png


Parts List

PIR Sensor
Catalog #: 276-135

1/8" Stereo Panel-Mount Audio Jack (2-Pack)
Catalog #: 274-249

9-Pin Female Solder D-Sub Connector
Catalog #: 276-1538

9-Position Shielded Connector Hood
Catalog #: 276-1513

Wire: I used strands of wire from CAT5 cable I had laying around for the internal wiring. I also used an old headphone cable for the link cable between the Serial port to the project box (a.k.a ALTOIDS can).

USB to Serial adapter

The USB to Serial Adapter is optional, assuming you have a serial port available on your PC. If you don't have a serial port (few laptops have serial ports any more), then you will need to use an adapter.
I use one based on the Prolific PL2303 chipset, available here
Other USB adapters should also work but I haven't tested any other adapters so your results may vary.


Pictures

USBEye-Front.jpg USBEye-Connected.jpg
USBEye-Inside.jpg USBEye-Angle.jpg
USBEye-9Pin a.jpg USBEye-9Pin b.jpg
USBEye.jpg USBEye-App.png
USBEye-TrayMenu.jpg USBEye-MoDet.jpg


.NET Code

I decided to use the DSR pin on the Serial port because VB.NET has the an Event Handler that deals with pinchanged events.
Specifically on the System.IO.Ports.SerialPort class there is the DSRHolding property that will return a True/False based on whether the DSR pin is receiving current or not.

Please keep in mind that programming is not my profession nor even a hobby of mine. I'm almost certain there are better / more efficient ways of coding this application. That said, I'm providing the code for others to use or even expand on to their liking.

USBEye-1.0-source.zip


Executable

USBEye.zip


References