Pavlov Yourself

Pavlov Yourself

Can you hack your subconscious to motivate yourself to complete tasks? What if you got a physical reward every time you answered a support ticket, finished a draft, or reviewed a diff? This talk shows you how to use funky hardware, like candy dispensers, to program your own reward cycle. We'll hook up the hardware machines to some cloud-based APIs to trigger a pleasant experience every time you complete a task. Who knows -- you may find yourself buying dozens of candy machines for everyone at your office, just to hear the pleasant clink of productivity all day long as all your developers earn their Skittles. (First presented at That Conference 2016.)

D11a463ad16864b2b7d14db6d09001c0?s=128

Alexandra Feldman

August 11, 2016
Tweet

Transcript

  1. HELLO, CAMPERS! Let’s Pavlov ourselves!

  2. Alex @amfelds 10 0

  3. who are you?

  4. None
  5. Inspiration

  6. things that can go wrong You have no idea what

    to google
  7. –urban dictionary To move quickly. Short for haul a$$ motor

    noun mo·tor \ˈmō-tər\
  8. None
  9. Building the MVP (minimally viable product)

  10. None
  11. Steps to M(inimally)VP 1. Get the motor to move from

    computer command (software MVP) 2. Take apart the jelly bean machine 3. Hardware MVP: Externally attach the motor to the knob 4. Get the motor to turn the knob from the computer and dispense candy!
  12. 1. Get the motor to move from computer command (software

    MVP) + ?
  13. 1. Get the motor to move from computer command (software

    MVP) https://github.com/FRC4564/Maestro ? using python? File "/Users/alexf/Documents/code-projects/ pavlov_yourself/lib/python2.7/site-packages/serial/ serialposix.py", line 537, in write raise SerialException('write failed: {}'.format(v)) serial.serialutil.SerialException: write failed: [Errno 6] Device not configured
  14. 1. Get the motor to move from computer command (software

    MVP) using bash script? (pavlov_yourself)alexf-mbp:pavlov_yourself alexf$ bash maestro-set-target.sh /dev/ cu.usbmodem00160671 0 5000 (pavlov_yourself)alexf-mbp:pavlov_yourself alexf$ bash maestro-set-target.sh /dev/ cu.usbmodem00160671 0 3000 maestro-set-target.sh: line 27: /dev/ cu.usbmodem00160671: Permission denied
  15. things that can go wrong usb connection to the controller

    is flaky You have no idea what to google
  16. –Pololu SDK README (emphasis mine) “an example graphical application that

    uses native USB to send commands and receive feedback from the Maestro and automatically recover from disconnection”
  17. 1. Get the motor to move from computer command (software

    MVP) +
  18. things that can go wrong You have no idea what

    to google The servo is plugged in backwards (pins and wires!) usb connection to the controller is flaky
  19. 1. Get the motor to move from computer command (software

    MVP) (video link)
  20. 2. Take apart the jelly bean machine

  21. Minimal viable product: things Maestro servo controller $19.95 Zipties $1

    Usb mini cable $2.95 6.0 V battery pack $15.15 Servo motor and horns $19.95 Jelly bean candy dispenser (with 3.5 oz of jelly beans) $17.95
  22. TOOLS ZOMG Minimally

  23. Steps to M(inimally)VP 1. Get the motor to move from

    computer command (software MVP) 2. Take apart the jelly bean machine 3. Hardware MVP: Externally attach the motor to the knob 4. Get the motor to turn the knob from the computer and dispense candy!
  24. None
  25. things that can go wrong the servo doesn’t actually turn

    far enough to make the gears reliably dispense jelly beans You have no idea what to google The servo is plugged in backwards (pins and wires!) usb connection to the controller is flaky
  26. None
  27. None
  28. –Servo datasheet “Limit angle: 180 ± 10"

  29. None
  30. Control system: Pulse Width Modification

  31. –Ohm “The current (I) through a conductor between two points

    is directly proportional to the voltage (V) across the two points. … The resistance (R) is the constant of proportionality. Ergo, V = IR.”
  32. Control system: Pulse Width Modification https://www.arduino.cc/en/Tutorial/PWM http://www.jameco.com/jameco/workshop/howitworks/how-servo-motors-work.html https://learn.sparkfun.com/tutorials/pulse-width-modulation

  33. –Servo datasheet “Limit angle: 180 ± 10" “Be careful when

    going past the normal 90- degree range to avoid damaging your servo … Once you reach the limit, immediately move back from it to avoid damaging the servo.” –Maestro FAQ
  34. None
  35. things that can go wrong the servo doesn’t actually turn

    far enough to make the gears reliably dispense jelly beans You have no idea what to google The servo is plugged in backwards (pins and wires!) grinding the gears, overheating by supply current outside of the safety zone usb connection to the controller is flaky
  36. None
  37. Building the other MVP (more viable product)

  38. More viable product: things Maestro servo controller $19.95 Zipties $1

    Usb mini cable $2.95 6.0 V battery pack $15.15 Servo motor and horns $19.95 Jelly bean candy dispenser (with 3.5 oz of jelly beans) $17.95 8x32 1” fastener $1.69
  39. TOOLS ZOMG Minimally More

  40. Steps to M(ore)VP 1. Drill hole behind gear 2. Modify

    servo so that it fits in the body of the jelly bean machine 3. Glue the screw fastener to the servo attachment 4. Stabilize motor in the body 5. Write servo commands 6. Write web integration (trigger servo commands)
  41. Steps to M(ore)VP 1. Drill hole behind gear 2. Modify

    servo so that it fits in the body of the jelly bean machine 3. Glue the screw fastener to the servo attachment 4. Stabilize motor in the body 5. Write servo commands 6. Write web integration (trigger servo commands)
  42. things that can go wrong the servo doesn’t actually turn

    far enough to make the gears reliably dispense jelly beans You have no idea what to google The servo is plugged in backwards (pins and wires!) the dispenser body cracks when drilling into it grinding the gears, overheating by supply current outside of the safety zone usb connection to the controller is flaky
  43. None
  44. things that can go wrong the servo doesn’t actually turn

    far enough to make the gears reliably dispense jelly beans You have no idea what to google The servo is plugged in backwards (pins and wires!) the dispenser body cracks when drilling into it grinding the gears, overheating by supply current outside of the safety zone usb connection to the controller is flaky
  45. 2. Modify servo so that it fits in the body

    of the jelly bean machine
  46. 3. Glue the screw fastener to the servo attachment

  47. things that can go wrong the servo doesn’t actually turn

    far enough to make the gears reliably dispense jelly beans You have no idea what to google The servo is plugged in backwards (pins and wires!) the servo is so powerful, it turns itself instead of the gears grinding the gears, overheating by supply current outside of the safety zone usb connection to the controller is flaky
  48. 4. Stabilize motor in the body

  49. things that can go wrong the servo doesn’t actually turn

    far enough to make the gears reliably dispense jelly beans You have no idea what to google The servo is plugged in backwards (pins and wires!) the wires get fatigued from being bent to fit in the body the servo is so powerful, it turns itself instead of the gears grinding the gears, overheating by supply current outside of the safety zone usb connection to the controller is flaky
  50. 5. Write servo commands

  51. things that can go wrong the servo doesn’t actually turn

    far enough to make the gears reliably dispense jelly beans You have no idea what to google The servo is plugged in backwards (pins and wires!) the wires get fatigued from being bent to fit in the body the servo is so powerful, it turns itself instead of the gears grinding the gears, overheating by supply current outside of the safety zone sending a “hold” signal to the servo for too long causes damage usb connection to the controller is flaky
  52. 6. Write web integration (trigger servo commands)

  53. 6. Write web integration (trigger servo commands)

  54. DEMO TIME!

  55. None
  56. http://feedalex.site44.com/

  57. MORE IDEAS!

  58. pager duty -> move hand (simone giertz’s “the wake up

    machine”)
  59. zendesk ticket solved -> strum a chord

  60. reply to a tweet -> make a nice smell drill

    holes in a tupperware + install a fan = programmable aromatherapy!
  61. • Just like software, designing hardware is all about the

    interfaces • Vocab is an accelerator • Hardware makes it so obvious how important tools are (and when in doubt, zipties fix everything) lessons learned
  62. things that can go wrong the servo doesn’t actually turn

    far enough to make the gears reliably dispense jelly beans You have no idea what to google The servo is plugged in backwards (pins and wires!) the wires get fatigued from being bent to fit in the body the servo is so powerful, it turns itself instead of the gears grinding the gears, overheating by supply current outside of the safety zone sending a “hold” signal to the servo for too long causes damage usb connection to the controller is flaky
  63. Try hard, get results The true Pavlovian experience — because

    nothing is a better reward than the feeling of success.
  64. Go forth and be productive! @amfelds