An Interactive Doorknob
For my pComp and ICM final I’m programming a door knob that generates of series of real-time interactions when you turn it. Ideally, it’s going to be fixed to your maindoor and the controls of its interaction are in a browser based dashboard.
The project is a prototype of multiple interactions that people would find positively useful when interacting with a doorknob (yes, positively). Doorknobs - there are millions of them, and we use them, why can’t we make them do more than just open a door. Phones can do more than make calls, and they’re kind of saturated and so for my project I decided to limit phone use as enablers of another interaction.
Doorknobs, which in reality act like portal activators and quite literally enable a spatial transformation by bringing about a change in environment which envoke a new feeling (comfort, warmth if you’re entering home. Relief that you’re not late, if you’re not late for Tom’s class).
Some use cases I will be working on:
- Turning on the lights in the room (adjusting intensity with a browser based slider)
- Sending an SMS reminder to yourself or loved one
- Activating the chrome or firefox.app on a Mac with the URL pointing to a Youtube playlist (or any link set from browser)
- Turning on the kettle (turning it off/on from the broswer)
Start
Here’s one of the two doorknobs I’m using,
I have to stick a sensor in it
I take apart the pot and fine file the knob according to measurements from vernier calliper
Testing
I saw off the doorknobs entrails and adjust the spring in the turn mechanism and fix the pot in
Doorknob sensor in action - yes I have hairy arms
Program1 - SMS function
I will be elaborating more on my programming process in subsequent posts.
var serialport = require('serialport'),
SerialPort = serialport.SerialPort,
portname = process.argv[2];
client = require('twilio')('<--[removed]-->', '<--[removed]-->');
//variables DOM & sketch
var h1; //header text for SMS
var setSMS; //button
var inputSMS; //input SMS text
var setPhoneNumber; // input phone number
//setup port
var myPort = new SerialPort(portname, {
baudRate: 9600,
options: false,
parser: serialport.parsers.readline("\n")
});
myPort.on('open', function(){
console.log('port is open');
});
myPort.on('close', function(){
console.log('port is closed');
});
myPort.on('error', function(){
console.log('there is an error');
});
//An IF statement saying if myPort.on('data', function(data)) is returning values, client.sendMessage should execute
myPort.on('data', function(data){
console.log(data);
myPort.write('x');
});
//DOM for SMS setup
function setup() {
h1 = createElement('h3', "Input SMS Reminder Text");
h1.position(width/2, height/2);
setSMS = createButton("set SMS");
setSMS.mousePressed(updateSMSbody);
setPhoneNumber = createInput("phone number +17185701757");
setPhoneNumber.input(updateSMSto);
inputSMS = createInput("sms text goes here...");
inputSMS.input(updateSMSbody);
}
function updateSMSto(){
client.sendMessage.to = setPhoneNumber.value(); //should it be? client.sendMessage.to(setPhoneNumber.value());
}
function updateSMSbody(){
client.sendMessage.body = inputSMS.value(); //shoud it be? client.sendMessage.body(inputSMS.value());
}
function draw() {
}
//Send an SMS text message - where in p5 does this go? works on its own "node sendsms.js"
client.sendMessage({
to:'+17185701757', // Any number Twilio can deliver to
from: '+17182159247', // A number you bought from Twilio and can use for outbound communication
body: 'Hello Osama - this is a test message.' // body of the SMS message
}, function(err, responseData) { //this function is executed when a response is received from Twilio
if (!err) { // "err" is an error received during the request, if any
// "responseData" is a JavaScript object containing data received from Twilio.
// A sample response from sending an SMS message is here (click "JSON" to see how the data appears in JavaScript):
// http://www.twilio.com/docs/api/rest/sending-sms#example-1
console.log(responseData.from); // outputs "+14506667788"
console.log(responseData.body); // outputs "word to your mother."
}
});