Showcase your project! - UC Berkeley School of...

Post on 08-Aug-2020

2 views 0 download

Transcript of Showcase your project! - UC Berkeley School of...

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

1

Potentiometers

Showcase your project!

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

2

Sensor 2: Photocells and Force Sensors

Analog input and Processing

week

05

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

3

Force Sensitive Resistor

Photocell

PhotocellForce Sensitive Resistor

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

4

Force Sensitive Resistor

Photocell

PhotocellForce Sensitive Resistor

$0.01$5.50

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

5

Potentiometers

• Variable resistor (a type of “resistive sensor”)

• Pot for short

• When you need a “ranged” input

• Measures rotational position (knob for volume, light dimmer, etc.)

pot resistor

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

6

turned anti-clockwise

turned clockwise

somewhere in the middle

Potentiometers

• It’s like a faucet (if current is analog to water flow)

• Like any other resistor, but you can vary the amount of resistance

• Generally used for making a varying voltage (remember, Arduino measures voltage differences, not resistance differences)

Illustration adapted from Tod Kurt’s Spooky Projects with Arduino

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

7

Voltage Divider

Potentiometer is a type of voltage divider.

Illustration adapted from Tod Kurt’s Spooky Projects with Arduino

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

8

Photocells (aka photoresistor)

Brighter light == lower resistance

Photocell

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

9

Force Sensitive Resistors

More pressure == lower resistance

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

10

Force Sensitive Resistors

Experiment with different pressure objects, sponge, plates, etc.

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

11

Working with ProcessingArduino as an interface board

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

12

Arduino to Computer

USB to serial chip

Arduino microcontroller

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

13

Arduino to Computer

Arduino microcontroller

USB to serial chip

USB to serial driver

Arduino programmer

Processing sketch

Java program

Laptop Arduino board

USBRX

TX

Program of your choice!

RX

TX

or

or

or

Illustration adapted from Tod Kurt’s Spooky Projects with Arduino

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

14

Processing

Open source programming language and environment for images, animation, and interactions.

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

15

Processing

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

16

Processing and Serial

Processing has a “Serial” library to talk to Arduino.

1. load library2. set portname3. open port4. read/write port

adapted from Tod Kurt’s Spooky Projects with Arduino

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

17

In Class Exercise

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

18

Photocell and LED

SinglePotControlsBrightness.txt

SinglePotControlsBlinking.txt

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

19

FSR and LED

SinglePotControlsBrightness.txt

SinglePotControlsBlinking.txt

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

20

Processing

Download and install Processing from processing.org

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

21

Processing and Arduino

arduino_ball_paint

Every time a number is received via the serial port, it draws a ball that size.

Project adapted from Tod Kurt’s Spooky Projects with Arduino

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

22

Assignment this week

Programming

Create an interesting visualization on your computer that could be influenced by the input from the sensors you have (pot, photocell, FSR, or combination of them). You can use Processing (or any other language you like) in writing the program. Post your results on the course website.

Mechanical

Create a mechanical construction for your FSR that distributes or focuses physical force that is applied. Think about everyday objects (toothpaste tube, entrance mat, paintbrush, pipette, etc.) and how you measure the pressure or force applied to them.

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

23

Supplement Readings

Force sensitive resistors: Chapter 11 of Physical Computing

Voltage divider: Chapter 6, pp. 102-108 of Physical Computing

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

24

Photocell and LED

SinglePotControlsBrightness.txt

SinglePotControlsBlinking.txt

Tuesday Week 5: Ambient Media Theory and Practice of Tangible User Interfaces

25

LumiTouch[Chang, Resner et al., 2001]

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

26

Homework

Programming

Create an interesting visualization on your computer that could be influenced by the input from the sensors you have (pot, photocell, FSR, or combination of them). You can use Processing (or any other language you like) in writing the program. Post your results on the course website.

Mechanical

Create a mechanical construction for your FSR that distributes or focuses physical force that is applied. Think about everyday objects (toothpaste tube, entrance mat, paintbrush, pipette, etc.) and how you measure the pressure or force applied to them.

Tuesday Week 5: Sensing Theory and Practice of Tangible User Interfaces

27

Thanks!