New Human Computer Interfaces Class ? May 30 2007 Amnon Dekel HUJI – CSE, Spring 2007 On the Menu • • • • • Project Idea Presentations and Discussion Serial Communications: Some more sensors Changing the world: Actuators Milestones for the rest of the semester New Human Computer Interfaces - HUJI - Spring 2006 2 Serial Communications • The Ardiono can communicated with other devices in the world using the Serial Communications Protocol • You can use this to have a board Send data to another board and receive data from another board. • You can also use this to have the board communicate with a workstation (Why?) New Human Computer Interfaces - HUJI - Spring 2006 3 Serial Communications • This communication happens via the Arduino board's serial or USB connection and on digital pins 0 (RX) and 1 (TX). Thus, if you use these functions, you cannot also use pins 0 and 1 for digital i/o. – – – – – – Serial.begin(speed) int Serial.available() int Serial.read() Serial.flush() Serial.print(data) Serial.println(data) • WORKSHOP: http://itp.nyu.edu/physcomp/Labs/Serial New Human Computer Interfaces - HUJI - Spring 2006 4 Some More About Sensors Types of Input Switches Rocker switch Push button Slide switch New Human Computer Interfaces - HUJI - Spring 2006 Toggle switch 6 Sensitive Switches Roller switch Hair trigger/whisker switch Mercury/Tilt switch New Human Computer Interfaces - HUJI - Spring 2006 Magnetic/Reed switch 7 Analog Sensors Force Sensitive Resistor (FSR) Pressure sensors New Human Computer Interfaces - HUJI - Spring 2006 8 Analog Sensors Photocell Temperature Sensor/Thermistor New Human Computer Interfaces - HUJI - Spring 2006 9 And more … And more: Capacitance sensors Piezoelectric sensors Accelerometers Flex Sensor More info: ITP Sensor Workshop Report New Human Computer Interfaces - HUJI - Spring 2006 10 Changing the World: Actuators Examples New Human Computer Interfaces - HUJI - Spring 2006 12 Actuators • Pneumatic – Air Pressure causing movement • Hydraulic – Liquid Pressure causing movement • Electronic – Electro-magnetic movement • Motors (Kinetic) • Speakers (Audio) • Lights (Visual) More Info New Human Computer Interfaces - HUJI - Spring 2006 13 Motors • Linear vs. Rotary movement • Torque • Gear New Human Computer Interfaces - HUJI - Spring 2006 14 Selecting a Motors • • • • • • • • Speed (RPM) Movement – mechanics Controlling the Position Feedback about the position How much weight can it carry Torque How much power does it need Price New Human Computer Interfaces - HUJI - Spring 2006 15 Selecting a Motors • • • • • • • • Speed (RPM) Movement – mechanics Controlling the Position Feedback about the position How much weight can it carry 1. The moment of a force; the measure of a force's tendency to torsion and rotation about an axis, equal to the vector Torque produce product of the radius vector from the axis of rotation to the point of application of the force and the force vector. How much power does it need 2. A turning or twisting force. Price New Human Computer Interfaces - HUJI - Spring 2006 16 Types of Motors DC Stepper DC servo New Human Computer Interfaces - HUJI - Spring 2006 17 Motors DC Motor: • • • • • Cheap. Very easy to connect Minimum control Turns 360 degrees. Can add components for more control: – Speed: change the voltage using a POT – Direction: change the polarity – Position: can’t! Add an H-Bridge circuit New Human Computer Interfaces - HUJI - Spring 2006 18 Motors DC Servo: • Expensive • Very easy to connect • Includes all components • Turns 90 degrees to each side • Full control: – Speed: change the voltage – Position: Needs CHECKING New Human Computer Interfaces - HUJI - Spring 2006 19 Controlling a Servo DC Servo - Controlling the position: • They rotate 0 to 180 degrees depending on the pulsewidth. About 1.5 sec to move 180 degrees. • The DC Servo takes a pulse of between 1-2 ms every 20 ms. • A pulse of 1 ms will turn the motor to 0 degrees; 1.5 MS will turn to 90 degrees, 2 ms will turn it to 180 degrees • To keep a servo in its current position pulse it with the same pulse width every 18-20 ms to keep it there. New Human Computer Interfaces - HUJI - Spring 2006 20 Motors Stepper: • • • • • • • Cheap Usually 12V Hard to connect Need extra components Turns 360 degrees. Can stay still in one position Full control: – Position – Speed New Human Computer Interfaces - HUJI - Spring 2006 21 Controlling Motors We want to control a few elements: • Speed • Strength • Direction • Position New Human Computer Interfaces - HUJI - Spring 2006 22 Controlling Motors We want to control a few elements: • Speed power • Strength Current • Direction current direction/Pulse • Position Pulse New Human Computer Interfaces - HUJI - Spring 2006 23 Where to get motors? חנויות טיסנים חנויות רובוטיקה חנויות אלקטרוניקה New Human Computer Interfaces - HUJI - Spring 2006 26 PAUSE What have we been dealing with so far? Sensing the world Controlling the world Vision SOUND Video Pressure Controlling 220V world Analog Output Digital Input Computing Change Output to the PC Analog INPUT Digital Output Position Communications MOVEMENT (Motors) Movement Audio Temperature New Human Computer Interfaces - HUJI - Spring 2006 28 Projects • • • • What’s a good project? Process Milestones Presentations New Human Computer Interfaces - HUJI - Spring 2006 29 What’s a Good Project • Explores interesting, and preferably, novel scenarios • Shows interesting use of the technology • Exhibits a working prototype for at least one main part of the scenario. • Explains how it fits into the wider scenario. • Includes good documentation – Project explanation, process, problems, code, possible improvements – Project Poster New Human Computer Interfaces - HUJI - Spring 2006 30 Project • If we have time: – Class Discussion of Projects • Home Work: – Prepare a Project Proposal: • • • • • Intro – What problem am I trying to solve Research (what exists…) Concept Technology Milestones (7 weeks) New Human Computer Interfaces - HUJI - Spring 2006 31