Arduino. AS220 Workshop. Part II Interactive Design with advanced Transducers Lutz Hamel

Similar documents
Learning Objectives. References 10/26/11. Using servos with an Arduino. EAS 199A Fall 2011

Using Servos with an Arduino

100UF CAPACITOR POTENTIOMETER SERVO MOTOR MOTOR ARM. MALE HEADER PIN (3 pins) INGREDIENTS

Lecture 6. Interfacing Digital and Analog Devices to Arduino. Intro to Arduino

Assignments from last week

Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators

Arduino Digital Out_QUICK RECAP

HAW-Arduino. Sensors and Arduino F. Schubert HAW - Arduino 1

Design with Microprocessors Year III Computer Science 1-st Semester

Using Transistors and Driving Motors

Disclaimer. Arduino Hands-On 2 CS5968 / ART4455 9/1/10. ! Many of these slides are mine. ! But, some are stolen from various places on the web

Programming a Servo. Servo. Red Wire. Black Wire. White Wire

ABCs of Arduino. Kurt Turchan -

LED + Servo 2 devices, 1 Arduino

Servo Sweep. Learn to make a regular Servo move in a sweeping motion.

Yihao Qian Team A: Aware Teammates: Amit Agarwal Harry Golash Menghan Zhang Zihao (Theo) Zhang ILR01 Oct.14, 2016

DC motor control using arduino

Operating Mode: Serial; (PWM) passive control mode; Autonomous Mode; On/OFF Mode

Project 27 Joystick Servo Control

Analog Feedback Servos

Arduino Application: Speed control of small DC Motors

Robotic Arm Assembly Instructions

URM37 V3.2 Ultrasonic Sensor (SKU:SEN0001)

Lab 06: Ohm s Law and Servo Motor Control

Computational Crafting with Arduino. Christopher Michaud Marist School ECEP Programs, Georgia Tech

Basics before Migtrating to Arduino

Programming 2 Servos. Learn to connect and write code to control two servos.

keyestudio keyestudio Mini Tank Robot

Coding with Arduino to operate the prosthetic arm

Introduction: Components used:

FABO ACADEMY X ELECTRONIC DESIGN

Experiment#6: Speaker Control

Sidekick Basic Kit for Arduino V2 Introduction

CONSTRUCTION GUIDE Robotic Arm. Robobox. Level II

4WD Mobile Platform SKU:ROB0022

Motors and Servos Part 2: DC Motors

Arduino: Sensors for Fun and Non Profit

About Arduino: About keyestudio:

Assembly Language. Topic 14 Motion Control. Stepper and Servo Motors

Arduino Control of Tetrix Prizm Robotics. Motors and Servos Introduction to Robotics and Engineering Marist School

Arduino and Servo Motor

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

Controlling motors with Arduino and Processing

Lesson4 Obstacle avoidance car

Parts List. Robotic Arm segments ¼ inch screws Cable XBEE module or Wifi module

SMART Funded by The National Science Foundation

Understanding RC Servos and DC Motors

PWM CONTROL USING ARDUINO. Learn to Control DC Motor Speed and LED Brightness

.:Twisting:..:Potentiometers:.

Training Schedule. Robotic System Design using Arduino Platform

Advanced Mechatronics 1 st Mini Project. Remote Control Car. Jose Antonio De Gracia Gómez, Amartya Barua March, 25 th 2014

Lab Exercise 9: Stepper and Servo Motors

Arduino Advanced Projects

EE 314 Spring 2003 Microprocessor Systems

Analog Servo Drive 25A20DD

.:Getting Started:..:(Blinking LED):.

NAMASKAR ROBOT-WHICH PROVIDES SERVICE

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Introduction to. An Open-Source Prototyping Platform. Hans-Petter Halvorsen

THE IMPORTANCE OF PLANNING AND DRAWING IN DESIGN

Total Hours Registration through Website or for further details please visit (Refer Upcoming Events Section)

arduino experimentation kit Arduino Experimenter s Kit SketchBoard Edition

Figure 1. Digilent DC Motor

Arduino Programming Part 3

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

FlareBot. Analysis of an Autonomous Robot. By: Sanat S. Sahasrabudhe Advisor: Professor John Seng

BEYOND TOYS. Wireless sensor extension pack. Tom Frissen s

Illustration 1: Wiper Motor Controller, Sensor, and optional programmer. DC Wiper Motor H-Bridge Servo / Speed Controller

Citrus Circuits Fall Workshop Series. Roborio and Sensors. Paul Ngo and Ellie Hass

Module: Arduino as Signal Generator

The plan... CSE 6324 From control to actuators Michael Jenkin Office Hours: Sherman 1028 Wed 3-4. From the bottom up...

Control Robotics Arm with EduCake

Name & SID 1 : Name & SID 2:

Interfacing dspace to the Quanser Rotary Series of Experiments (SRV02ET)

Experimenter s Guide for Arduino

HOW TO BUILD A CAR PARK WITH INTEL GALILEO!

Sensor and. Motor Control Lab. Abhishek Bhatia. Individual Lab Report #1

ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK

DC Motor and Servo motor Control with ARM and Arduino. Created by:

Programming Design. ROBOTC Software

CONSTRUCTION GUIDE IR Alarm. Robobox. Level I

Project Proposal. Underwater Fish 02/16/2007 Nathan Smith,

B RoboClaw 2 Channel 30A Motor Controller Data Sheet

Haptic Feedback Technology

Intro to Engineering II for ECE: Lab 3 Controlling Servo Motors Erin Webster and Dr. Jay Weitzen, c 2012 All rights reserved

Lecture 4: Basic Electronics. Lecture 4 Brief Introduction to Electronics and the Arduino

UNIVERSAL INPUT RESISTANCE OUTPUT

E11 Lecture 11: Sensors & Actuators. Profs. David Money Harris & Sarah Harris Fall 2011

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

ARDUINO BASED GREETING CONTROLLED ROBOT

1. Controlling the DC Motors

A Model Based Approach for Human Recognition and Reception by Robot

Setup Download the Arduino library (link) for Processing and the Lab 12 sketches (link).

Introduction to the VEX Robotics Platform and ROBOTC Software

Feed-back loop. open-loop. closed-loop

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

Counter/Timers in the Mega8

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 11 Motor Control

Sensors and Sensing Motors, Encoders and Motor Control

1. Introduction to Analog I/O

Transcription:

AS220 Workshop Part II Interactive Design with advanced Transducers Lutz Hamel hamel@cs.uri.edu www.cs.uri.edu/~hamel/as220

How we see the computer Image source: Considering the Body, Kate Hartman, 2008.

How the computer sees us Image source: Physical Computing, O'Sullivan and Igoe, Thomson, 2004.

Principles of Interactive Design The Conversation Loop Listening (Sensing) Thinking (Processing) Speaking (Acting)

Principles of Interactive Design Examples of the Loop Sensing read photoresistor value read potentiometer value Processing convert to sound wave period compute PWM duty cycle Acting output sound wave to speaker output PWM signal to LED

Principles of Interactive Design Sensing Intensity peak detection threshold setting Peak Detection Duration edge detection Threshold Setting Edge Detection Note: Pulse edge detection is achieved on the with the 'pulsein(pin, value)' function.

Principles of Interactive Design Sensing Presence foot switches beam breaking motion detection ultrasonic sensors Attention pushbuttons potentiometers flexsensors

Principles of Interactive Design Kelly Dobson Expressive Interfaces

Image source: Blendie, Kelly Dobson Principles of Interactive Design Expressive Interfaces

Image source: turn signal biking jacket, Leah Buechley Principles of Interactive Design Expressive Interfaces

Image source: turn signal biking jacket, Leah Buechley Principles of Interactive Design Expressive Interfaces

Acting - Motors The actuators we have seen so far provided us with information Motors allow us to act on the world in a more immediate fashion by creating movement Motors come in many different sizes and functionalities, we discuss two types of motors: RC servos and DC motors

RC Servo Motors Remote Control (RC) Motors are DC motors that have control circuitry builtin These motors can be controlled in such a way that you can rotate the spindle between 0 and 180 You guessed it, we use pulse widths to do so

RC Servo Motors A pulse every 20msec Pulse width of 1msec 0 Pulse width of 2msec 180 Good News: we have a library that does that for us! Rotation = 0 Rotation = 180

RC Servo Motors Idea: Write a sketch that sweeps the motor back and forth through its 180 degrees of rotation.

RC Servo Motors Notes: You will need an external power supply. The servo library only supports servos on D9 and D10 (see documentation) External Power

RC Servo Motors // Sweep // by BARRAGAN <http://barraganstudio.com> #include <Servo.h> Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created int pos = 0; // variable to store the servo position void setup() { myservo.attach(9); } // attaches the servo on digital pin 9 to the servo object void loop() { for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } }

RC Servo Motors Idea: Use a flex sensor to control the rotation of the servo. Resistance ~9KΩ Image source: ITP/NYU Resistance ~15KΩ

RC Servo Motors

RC Servo Motors // Controlling a servo position using a flex sensor // based on a sketch by Michal Rinott #include <Servo.h> Servo myservo; int flexpin = 0; int val; void setup() { myservo.attach(9); } void loop() { // reads value between 0 and 1023 val = analogread(flexpin); // scale it to a value between 0 and 180 val = map(val, 500, 400, 0, 180); myservo.write(val); delay(15); }

DC Motors A DC motor works by converting electric power into mechanical work This is accomplished by forcing current through a coil and producing a magnetic field that spins the motor Able to run forward and backwards, depending of the orientation of the voltage source

DC Motors Idea: Control the speed of the rotation of a DC motor using PWM We read an analog signal from a pot and output the appropriate PWM signal to the motor Caveat: DC motors draw too much current to directly hook up to an IO port Use transistor circuitry to drive the motor

Transistors Transistors act like switches: IB Ic If IB= 0 then Ic= 0 If IB 0 then Ic 0

DC Motors

DC Motors // PWM control of a DC motor int motorpin = 9; int potpin = 0; int val = 0; // motor connected to digital pin 9 (PWM) // pot connected to analog pin 0 void setup() { pinmode(motorpin, OUTPUT); } void loop() { val = analogread(potpin); val = map(val,0,1023,0,254); analogwrite(motorpin,val); delay(100); } // sets the pin as output

H-Bridge Idea: Use a digital control signal to let a motor spin forwards and backwards We use an H-bridge to accomplish this An H-bridge is an integrated circuit (IC) that is able to interpret digital commands and spin the motor in the appropriate direction

H-Bridge SN754410 Motor spins in one direction Command Interpretation Inputs 1A High Low Outputs 2A Low High 1Y High Low 2Y Low High Motor spins in the other direction

H-Bridge

H-Bridge // digital directional control of a DC motor // using an H-bridge int int int int inputpin = 7; // read digital pin 7 outputpin1 = 8; // output pin 1a to bridge digital pin 8 outputpin2 = 9; // output pin 2a to bridge digital pin 9 val = 0; void setup() { pinmode(inputpin, INPUT); pinmode(outputpin1, OUTPUT); pinmode(outputpin2, OUTPUT); } void loop() { val = digitalread(inputpin); } if (val == HIGH) { digitalwrite(outputpin1, digitalwrite(outputpin2, } else { digitalwrite(outputpin1, digitalwrite(outputpin2, } delay(100); // wait 100ms HIGH); LOW); LOW); HIGH);

Driving AC Loads We can drive 120V AC loads using relays Relays are mechanical switches that can be switch by applying power to a secondary circuit WARNING : 120V AC current can kill! If you have not done this before consult with somebody who has experience!

Building Your Objects A great way to explore the mechanical side of your objects are construction sets like LEGO Erector/Meccano sets Another way is to hack old toys Ebay is a great place to shop for these things

Things to do for next Week Design your interactive Object(s) Briefly describe the behavior input/output Conversation Loop Sketch your overall design Layout the hardware Design the Sketch Bring this all to the next Workshop