You are hereHome / Arduino Projects / Project Page: Skype IN/OUT

Project Page: Skype IN/OUT


Skype IN/OUT

MTT project #4 is called “A Networked Cat” and involves placing force-sensing resistors under the bed of an unsuspecting pet.  When the feline reclines a PC turns on a webcam and begins uploading photos to a web site and an email is sent to inform you that there are adorable photos to see.

I faced a couple obstacles, namely not having a cat or a webcam.  That is to say not a webcam that is programmatically accessible, since I have a Mac.  I could have bought a cheap webcam, but a cat would have been too big a commitment so I improvised my own version of the project.

In my version, two FSRs are placed on a desk chair.  The PC on the desk has Skype running and when a person sits at the desk their Skype status is set to “Available”.  When nobody is in the chair the status is set to “Away”  In keeping with the spirit of the Networked Cat project an email is also sent when the status is changed.

FSRI taped the FSRs to a Micro Center catalog and placed a small blanket over it to make a faux cushion.  The FSR terminals are wire wrapped and run to the project case (a pencil box from Target).  Admittedly, the wiring is a bit cumbersome, especially with a rolly chair.   

 

Sending email

In the book Igoe uses PHP to send email.  When I was working on the project the only web space that I had access to was the most basic of all web space provided by my ISP and PHP was not an option, so I had to find another method.  It took some digging through the ISP docs, but I discovered that I did have access to some CGI scripts and one of them would send the contents of a form via email.  I modified the code from the book to use the CGI script instead of PHP.

Changing Skype status

ChairWith some testing I determined a sensor reading threshold that would indicate someone sitting in the chair.  The Processing program keeps track of the sensor readings and takes action when the a state change lasts for over five seconds to allow for shifting in the chair or sitting for a few seconds before realizing that your coffee is in the other room.

The actual status change is easily accomplished with Applescript..  For simplicity, there are two applications called skypeIN and skypeOUT. The code for each script follows.

tell application "Skype"

            send command "SET USERSTATUS ONLINE" script name "AppleScript status setter"

end tell

 

tell application "Skype"

            send command "SET USERSTATUS AWAY" script name "AppleScript status setter"

end tell

The scripts only need to be saved as applications in the  Applescript editor to make executable files.  In the Processing code open("skypeIN.app"); will set the Skype state to “Available”.

Possible uses

I could see this project being useful in a SOHO environment where one depends on electronic communication to interact with coworkers.  There would have to be some design work to integrate the wiring with the chair so the wires would not get trod on.  There could also, of course, be a wireless solution.  This technique could also be useful in a call center routing system to avoid ringing phones at unoccupied desks.

 

Parts Bin

Parts Bin

Force-Sensitive Resistor

from Adafruit Industries