As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Tuesday, May 7, 2013

Houston, We Have Detection

There's something truly exciting about testing ideas and discovering they actually work. Shoot, it's also exciting to test your idea and find out it doesn't work. The beauty lies in the act of trying. We've been muttering about using a PIR Motion Sensor (by Parallax) for a few weeks now, so when we actually took the little bugger out of its packaging, it was our moment of truth.
Being that we are two individuals with little experience (none, actually) when it comes to coding, Arduinos and sensors, this is an extremely intimidating realm to enter into. Thankfully, once again, the internet is our friend, this time in the form of Dave Giancaspro's article on Wired.com. He was creating some kind of motion-triggered, heart-attack-giving halloween decoration. I bet he would be disappointed that we are using his code to take pretty pictures of Hummingbirds.

Anyway.

Thanks to him we had this code:

int motion_1 = 2;int light_1 = 13;void setup(){ pinMode (motion_1,INPUT); pinMode (light_1, OUTPUT);}void loop (){ digitalWrite (light_1,LOW); delay(1000); //this delay is to let the sensor settle down before taking a reading int sensor_1 = digitalRead(motion_1);\ if (sensor_1 == HIGH){ digitalWrite(light_1,HIGH); delay(500); digitalWrite(light_1,LOW); delay(500); }}

Next, plug in a few wires, the sensor, and an LED, and BLAMMO! We now have an LED light that flashes when the motion sensor has been tripped.


=


For our next step, we intend to replace the flashing LED with a remote that trips the camera. Here's to majestic animal imagery in our future!

No comments:

Post a Comment