Interfacing sensors and motors to the Arduino board Physical Computing 2009 By Farshid Jafari Harandi Input/Output Interfacing Input : Getting data from environment Input processor Output Interacting with the environment 1 Output Inputs Introduced so far: Buttons Potentiometers Piezo Serial data from PC Pictures from : http://ctheds.wordpress.com/2007/10/30/connecting-a-potentiometer-to-the-arduino-analog-in/ http://www.plantautomation-technology.com/contractors/sensing/oen/ More Inputs How to extend number of inputs RFID QR codes Advanced sensors (SC2 next week) Definition and pictures from 2 Extending number of inputs Read more than one input in parallel Convert it to serial Read the serial data in Arduino and translate it to parallel Picture from: http://www.tpub.com/content/neets/14185/css/14185_151.htm Radio Frequency IDentification, RFID Dedicated ID Transmitted wirelessly Types of tags: Passive Powered with RF electromagnetic waves Active Powered with battery/line Pictures and references from: http://en.wikipedia.org/wiki/Radio-frequency_identification 3 Quick Response Codes, QR codes A two dimensional code Developed to be read quickly Maximum 2,953 bytes Error correction possibility Pictures and references from: http://en.wikipedia.org/wiki/Barcode http://en.wikipedia.org/wiki/Radio-frequency_identification Outputs Introduced so far: LEDs Piezo/Speaker Pictures from: http://www.arduino.cc/ 4 More outputs Relays Transistors Lamps DC motors Servo motors Stepper motors Serial to parallel shift-out Picture from: http://www.psartus.com/products/actuators.htm Need for current! How to know the current needed ? Arduino sinks/sources a max. of 40mA Some loads need higher currents Picture from : http://www.electronics-radio.com/articles/test-methods/meters/how-to-measure-current.php 5 Current amplification Relays Transistors: BJT or MOSFET Drivers Pictures from: http://en.wikipedia.org/wiki/Relay http://en.wikipedia.org/wiki/H-bridge http://en.wikipedia.org/wiki/Transistor Back EMF Generated while driving inductive loads like motors and relays Is damped with a diode or more Picture from: http://worldtechnical.blogspot.com/2008_10_01_archive.html 6 Lamps Produce light Are way less efficient than LEDs Draw much more currents compared to LEDs Do not need any resistor in series! Picture from: http://www.diytrade.com/china/4/products/4935803/MINIATURE_LAMP_PILOT.html Brushed DC motors Work with DC current Are capable of drawing lots of current Can be easily reversed by changing polarity Are relatively cheap Need driver circuitry Run continuously Have two wires Picture from: http://www.optms.net/China_DC_motor.html 7 Servo motors Work with DC current Are relatively cheap Do NOT need driver circuitry Run continuously or are position controlled Draw tolerable amounts of current Are capable of holding/braking Have three wires Picture from: http://www.parallax.com/ Stepper motors Work with DC current Are capable of drawing lots of current Can be easily reversed by giving different steps to follow Are relatively expensive Need driver circuitry Move in very precise steps Have more than three wires Picture from: http://www.ecmarsh.com/cnc/electronics.htm 8 More about motors Electric motors and generators : http://www.animations.physics.unsw.edu.au/jw/electricmotors.html Extending number of outputs Translate the data to a byte and send it serially from Arduino Convert it to parallel Output data in parallel Picture from: http://www.tpub.com/content/neets/14185/css/14185_151.htm 9 Questions ? THE END 10