220 likes | 363 Views
Knowledge Seminar 3 Sensor Input. www.ubcomechatronics.com. House Keeping. Invite your friends to UBCO Mechatronics Facebook Group to get the latest updates, or ask questions to club members. Free Advanced Tutorials. www.udacity.com Filters (maybe not really applicable)
E N D
Knowledge Seminar 3Sensor Input www.ubcomechatronics.com
House Keeping • Invite your friends to UBCO Mechatronics Facebook Group to get the latest updates, or ask questions to club members
Free Advanced Tutorials • www.udacity.com • Filters (maybe not really applicable) • Motion Planning (very useful) • PID control
Protecting your Electronic Devices Ground Yourself! • Winter time = dry air = static build-up • any bare metal on something plugged in will work Sources: http://www.how-to-draw-cartoons-online.com/cartoon-fire.html http://www.istockphoto.com/stock-illustration-10458945-cartoon-pointing-finger.php
Sensor Input • Sensor Input measured by Voltage
Sensor Output Range vs. Measurement Range 5 V 0 V AnalogRead() Arduino
Sensor Output Range vs. Measurement Range 5 V 1024 divisions = 0.0049V/division 0 V AnalogRead() Arduino
Sensor Output Range vs. Measurement Range 5 V 1024 divisions = 0.0049V/division 4 V Will only have 2V / 0.0049 V = 410 divisions on the sensor output 2 V 0 V Sensor Output Range (Analog) AnalogRead() Arduino
Sensor Output Range vs. Measurement Range 6 V 5 V Will have full 1024 divisions -anything above 5V sensor output will show 1023 -anything below 0V will show 0 =>You are not using some of your sensor range 1024 divisions = 0.0049V/division 0 V -1 V Sensor Output Range (Analog) AnalogRead() Arduino
Sensor Output Range vs. Measurement Range 5 V 5 V Prefered case 1024 divisions = 0.0049V/division 0 V 0 V Sensor Output Range (Analog) AnalogRead() Arduino
Sensor Calibration • Offsets and Multiplication • analogRead gives output on range [0,1023] • use map(value, fromLow, fromHigh, toLow, toHigh) map(512, 0,1023, 0, 100) = 50 //Conversion to percent map(500, 200,900, 0, 100)
Sensor Noise Integration vs. Differentiation
Sensor Noise Integration vs. Differentiation Integration
Sensor Noise Integration vs. Differentiation Integration
Quick and Dirty Solution: Moving Average • n- point moving average first 5 data points symmetrically Source: http://www.dspguide.com/ch15/2.htm
Sensor Noise - Filter Methods • Low-pass filter • Kalman filter for 1-D • advanced method that uses a system model
Potentiometer • Variable Length Resistor Source: http://fddrsn.net/pcomp/examples/potentiometers.html
Potentiometer • Variable Length Resistor Source: http://fddrsn.net/pcomp/examples/potentiometers.html
Switch Debouncing Source: http://www.labbookpages.co.uk/electronics/debounce.html https://dlnmh9ip6v2uc.cloudfront.net/images/products/9/7/00097-03-L.jpg
Projects • Get Arduino to display button state • Get Arduino to display state of potentiometer