Dashboard v0.1

InfoInfo
Search:    

[WWW]http://www.ambientdevices.com/cat/orb/orborder.html
New Life?
This version is now closed. See Dashboard v0.2, Dashboard v0.3, Dashboard v0.4 for Spring 2009 developments.

This is a wall-mounted display in a busy corridor that provides a constantly updated overview of the research activities of NiCHE.

Distance Sensor.jpgThe project runs on a small tablet computer that does not have a keyboard or mouse attached to it. When not being used, the monitor displays ambient imagery; this could be a basic screensaver. In our case, we intend to apply a program that turns data regarding NiCHE activities into a geographic formation. A busy day might display rugged mountains, whereas quieter days may show soft rolling hills. This aspect of the dashboard is still in development.

You operate the dashboard by approaching it. An infrared sensor similar to the one in your television remote control triggers as you approach. This sensor then sends a message to the computer to change the display on the monitor from the ambient imagery to a news page about current NiCHE activities. This news page would be constantly updated on the NiCHE server so that viewers would always be able to see the latest developments.

NiCHE members would have further options for interaction. Small plastic discs known as RFID tags, each containing a unique identity could be used to sign into a personal research page. By swiping your RFID tag over the sensor pad, the computer would know who was currently using it and would display the appropriate information. When the person walks away, the monitor would revert back to its ambient display.RFID.jpg

The Infrared Sensor and the RFID Sensor are both "Phidgets" which are physical widgets that perform a specific task, that have been designed to work easily with computers. They connect to the computer using a USB cord. The "Phidgets" company has provided code that can be installed on any machine that allows users to get the phidget to perform the desired task. For instance, if you were using an RFID sensor, you could use this code to check and let you know when someone swipes an RFID past the sensor. You could then tell the computer to do any number of things. In this case, it might say, "Hello Devon."

The computer program that controls the device is custom written using the Python programming language. The code can be seen below.

In non-technical terms, the phidgets are being constantly monitored by the computer, which looks for changes to the environment being sensed. Infrared Sensors can only monitor changes in distance. If someone approaches, this will register as a change and the code will tell the computer to change the monitor display. Likewise, if someone moves farther away, a change is registered. By monitoring for changes only, the program runs silently using little memory.

The RFID sensor checks for changes too. In our case, it checks if someone has swiped an RFID past the sensor. If they have, the code tells the program to do something. If someone else has already swiped a different RFID, then program tells the user to first sign out before signing in with another user. This is known as a flag in computer programming terms.

This program could have been written in a number of computer programming languages so if you know another language, feel free to make your own dashboard using our code as a rough guide.

Our Code:

#Common imports
from ctypes import *
import sys
from time import sleep

#Device Imports
from Phidgets.PhidgetException import *
from Phidgets.Events.Events import *
from Phidgets.Devices.InterfaceKit import *
from Phidgets.Devices.RFID import RFID
from Phidgets.Devices.TextLCD import TextLCD

#Error Checking Functions
def rfidError(e):
    print "RFID Reader Error %i: %s" % (e.eCode, e.description)
    return 0

def interfaceKitError(e):
    print "InterfaceKit Error %i: %s" % (e.eCode, e.description)
    return 0

def textLCDError(e):
    print "LCD screen Error %i: %s" % (e.eCode, e.description)
    return 0

def rfidTagGained(e):
    global currentUser
    tagID = e.tag
    print "Tag Read: %s" % (e.tag)
    if currentUser == '0':
        print "Hello " + idList[tagID]
        textLCD.setDisplayString(1, "Hello " + idList[tagID])
        currentUser = str(idList[tagID])
        print currentUser
        sleep(2)
        textLCD.setDisplayString(1, currentUser + " signed in")
    elif currentUser == str(idList[tagID]):
        print "Bye " + currentUser
        textLCD.setDisplayString(1, "Bye " + currentUser)
        currentUser = '0'
        sleep(2)
        textLCD.setDisplayString(1, "swipe to sign in")
    else:
        print currentUser + " already here"
        textLCD.setDisplayString(1, currentUser + " got here 1st")
        sleep(2)
        textLCD.setDisplayString(1, currentUser + " signed in")
    return 0

def interfaceKitSensorChanged(e):
    print "Sensor %i: %i" % (e.index, e.value)
    distance = str(4800/(e.value-20))
    distanceInt = int(distance)
    if distanceInt < 100:
        if distanceInt > 0:
            textLCD.setDisplayString(0, "You are " + distance + " cm away")
    elif distanceInt > 100:
        textLCD.setDisplayString(0, "Too far;" + distance + " cm away")
    return 0

idList= {'010238a1ab':"Bill", '0102388d34':"Devon", '0102389e4f':"Adam", '0102388982':"Alan"}
currentUser = '0'
workingStatus = 0

#Create phidget objects
rfid = RFID()
textLCD = TextLCD()
interfaceKit = InterfaceKit()

#Start Distance Sensor
print currentUser
print "Opening phidget object...."

try:
    interfaceKit.openPhidget()
    interfaceKit.waitForAttach(10000)
    workingStatus += 1
except PhidgetException, e:
    workingStatus -= 1
    print "InterfaceKit Exception %i: %s" % (e.code, e.message)
    #exit(1)

try:
    rfid.openPhidget()
    rfid.waitForAttach(10000)
    rfid.setAntennaOn(True)
    workingStatus += 1
    print "RFID Opened Successfully"
except PhidgetException, e:
    workingStatus -= 1
    print "RFID Exception %i: %s" % (e.code, e.message)
    #exit(1)

try:
    textLCD.openPhidget()
    workingStatus += 1
except PhidgetException, e:
    workingStatus -= 1
    print "LCD Exception %i: %s" % (e.code, e.message)
    #exit(1)

#Main Program Code
try:
    interfaceKit.setOnSensorChangeHandler(interfaceKitSensorChanged)
    rfid.setOnTagHandler(rfidTagGained)
except PhidgetException, e:
    print "Phidget Exception %i: %s" % (e.code, e.message)
    #exit(1)

while workingStatus == 3:
    continue

Project Status:

working prototype; awaiting software to run on it (processing).

This is a Wiki Spot wiki. Wiki Spot is a non-profit organization that helps communities collaborate via wikis.