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.

Friday, June 12, 2020

Final Prank Documentation

Surprise Tickle Prank
I decided to try to use Arduino to surprise tickle people when they sit at their desk. How diabolical!

Circuit
I had a couple of ideas for how to sense the pranked person when they sat at their desk, such as light fluctuations and motion detection, but eventually I settled on using light for simplicity's sake. Thus, I began this project by setting up the servo motor and then integrating the photoresistor into the circuit.




Initial Code

#include <Servo.h>

Servo servo1;

void setup() {

  // set the servo pin, pin 9, as a servo output pin
  servo1.attach(9);
}

void loop() {
  //Read the light value from the photoresistor
  int lightValue = analogRead(A0);

  // map the light readings to the angle possible by the servo motor
  lightValue = map (lightValue, 0, 1023, 0, 180);

  // control the servo motor based on the light value read, adjust linearly by angles
  servo1.write(lightValue);

}


Progress!
I was able to successfully use the light values detected by the photoresistor to determine the angle of the servo rotation.



Refinement
I realized that to simulate tickling, the movement of the servo had to be erratic rather than simple and fixed like the above motions (which were determined by the detected light values). Thus, I had to simplify the code further and use the photoresistor solely to determine whether the light detected had dropped below a specified value (instead of reporting back each value). If the photoresistor detected darkness (a person sitting in front of the resistor, blocking light), then the Arduino would actuate servo rotation of a random value until the person got up from the seat (allowed light to be detected again).



In the above video, I taped a bundle of fluffed up q-tips to the servo since I didn't have feathers, but ideally one would use feathers for tickling. I also did not have the means to put together the whole prank set up, but I have included a diagram of what it would look like below. The servo and feathers would have to be positioned in a spot that is inconspicuous but also open enough to easily reach the pranked person. This would likely be at the bottom of the desk leg. Additionally, I would tape a paper towel roll to the photoresistor to point it at where the pranked person would sit so that it would not be affected by nearby light changes. 




Refined Code
#include <Servo.h>

Servo servo1;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  // set the servo pin, pin 9, as a servo output pin
  servo1.attach(9);
}

void loop() {
  //Read the light value from the photoresistor
  int lightValue = analogRead(A0);
  Serial.println(lightValue);
  // map the light readings to the angle possible by the servo motor
  // lightValue = map (lightValue, 0, 1023, 0, 180);
  
  if (lightValue < 500) {
    servo1.write(random(30, 360));
    delay(random(10,300));
  }

}


Next Steps?
Rather than using the photoresistor to detect when someone has sat down at their desk, it would be more effective to use a capacitive touch sensor that can discern a person's proximity to the desk. That way, the set up would be unaffected by uncontrolled variables such as ambient light changes due to the time of day. To use the capacitive touch sensor, though, I would have to make sure that the pranked person touched the sensor material in some way. Perhaps I could put a discrete piece of aluminum foil on the desk chair..? This is something that I would look into if I was to continue developing this project.

Thanks for reading!


No comments:

Post a Comment