physical prototyping lab5-complex_sensors

25
PHYSICAL PROTOTYPING © 2011 K3 Creative Commo Lab 5: Complex Sensors With the Arduino prototyping board

Upload: tony-olsson

Post on 13-Apr-2017

197 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Physical prototyping lab5-complex_sensors

PHYSICAL PROTOTYPING

© 2011 K3 Creative Commons v3.0 SA-NC

Lab 5: Complex Sensors

With the Arduino prototyping board

Page 2: Physical prototyping lab5-complex_sensors

SENSOR• Device measuring information from the environment (the world)

and translating the values into data understandable by our computers

• We can classify the sensors into two different groups, according to how they send information back to the microprocessors:

– ANALOG SENSORS: those that interface microprocessors through the analog inputs, offering signals varying between 0 and 5Volts

– COMPLEX SENSORS: those that communicate using either digital pins with PWM, serial communication, I2C or SPI (FYI: the last two methods are special types of serial communication)

Page 3: Physical prototyping lab5-complex_sensors

ANALOG SENSORS• ANALOG SENSORS: within this group we distinguish two modalities:

– RESISTIVE/CAPACITIVE SENSORS: those that contain a resistive/capacitive component that varies its value with light, temperature, etc.

• LDR – Light Dependant Resistors• Potentiometer: angle/stretch sensor• NTC – Negative Temperature Coefficient (Temp. var. resistor)• Flex-sensors• Pressure sensors• Piezo Elements: can act as knock sensors

– SIMULATED ANALOG SENSORS: complex sensors offering a simple interface to microcontrollers.

• ACCELEROMETERS: to measure tilt, and movement• InfraRed: to measure distances from 1mm to 80cm• Humidity

Page 4: Physical prototyping lab5-complex_sensors

COMPLEX SENSORSTheir main characteristic are that they communicate using either digital pins with PWM, serial communication, I2C or SPI (FYI: the last two methods are special types of serial communication)

There are many sensors within this group of complex sensors:

– ACCELEROMETERS: the classic is the MEMSIC2125 broadly used in prototypes, lately people are hacking Wii controllers

– GPS: sends strings over a Serial connection

– PING, SRF04/05: ultrasound devices measuring the distance to objects using sonar technology

– Precise Temperature sensors

Page 5: Physical prototyping lab5-complex_sensors

SENSOR vs. ACTUATORKeep in mind the following statement:

EVERY ANALOG SENSOR CAN BE USED AS AN ACTUATOR AND VICEVERSA

•For instance the piezo element that will also act as knock sensor

•This can be applied at low level only (simple sensors), so this does NOT apply for complex sensors and simulated analog sensors

•Actuators will also act as sensors, e.g. a DC motor is also a dynamo, what makes it into an analog sensor to detect movement

Page 6: Physical prototyping lab5-complex_sensors

A COUPLE OF TRICKSIf, after connecting your components to an Arduino board...

•you lack some digital inputs for your buttons, you can always use analog inputs and detect values over/under 512 instead of HIGH or LOW

•you lack some analog inputs for an analog sensor that you only use with a threshold, you can put it into a digital input, knowing that you will only read HIGH or LOW and that the threshold will be at 2,5 Volts, to change it, you can use a potentiometer instead of a pull-up resistor for your sensor

•you lack pins in general, to use as inputs, you can always use multiplexer circuits to add extra inputs. A recommended circuit to use is the 4051, which is broadly documented, or the tlc5940 which has some very nice libraries and is also well documented

Page 7: Physical prototyping lab5-complex_sensors

PRESENCE vs. DISTANCE• Many projects aim to determine whether there are people or not in a

space

• Other projects try to determine the distance of people to objects

• Different types of sensors allow to measure both presence and distance

• However we have to keep in mind that:

– presence implies to distinguish animated from inanimate objects: THIS IS VERY COMPLICATED

– distance implies multi-resolutive systems: THIS IS VERY COMPLICATED

• As designers we just make prototypes and we look into some features from sensors that allow us to simulate the desired functionality ... BUT WE WON'T MAKE IT WORK FOR REAL!

Page 8: Physical prototyping lab5-complex_sensors

DISTANCEThere are different types of sensors that act very well depending on the distance (range) we want to measure:

– InfraRed is very precise under 1m, there are some sensors that concentrate in just 3cm!!

– Ultrasound is very precise up to 10m, but it is a slow technology, we can only measure 5 samples/second with the kind of technology we use for prototyping (empirical values when using the sensor data in software programs)

– LDRs can be used for rough measuring of touch (many use it in their projects to simulate touch sensors) or distances smaller than 5cm, but it has very low accuracy

Page 9: Physical prototyping lab5-complex_sensors

ACCELEROMETER• Accelerometers are sensors that can measure different things,

among others they can measure the tilt of an object carrying the sensor, if the object moves, how quick it moves, etc.

• Accelerometers are very noisy sensors, therefore their data is not very accurate, however with a correction it is possible to make them very useful for 3-D positioning

• An example of a corrected sensor is the Wiimote, or basic Wii's game controller. It contains a 3-D accelerometer with an infrared camera that will measure the position of the screen correcting the possible errors made by the accelerometer

• Even if noisy, accelerometers can be very useful for quick prototypes within interaction design

Page 10: Physical prototyping lab5-complex_sensors

ACCELEROMETER• The accelerometer we are using (MMA7260QT XYZ-axis

accelerometer) can measure 3 dimensions of the movement that we call axis X, Y and Z

• The information comes in three analog pins which can be measured with a microcontroller

• The device operates at 2.2 V to 3.6 V, which can make interfacing difficult for microcontrollers operating at 5 V.

• Pololu

IMAGES © 2009 http://www.pololu.com

Page 11: Physical prototyping lab5-complex_sensors

ACCELEROMETER• Each of the three outputs is an analog voltage that ranges from 0

to Vcc. For 5 V applications, the outputs will range from 0 to 3.3 V

• The 3.3 V output can be used as a reference for analog-to-digital converters to gain full resolution samples.

• The way how this particular sensor works is through a moving bubble of gas inside the chip. Other types of accelerometers use other micro and nano techniques to measure the sensor's tilt and acceleration

PICTURE © 2005 ParallaxInc

Page 12: Physical prototyping lab5-complex_sensors

Both jumpers on selects a range of +/-1.5g;

GS1 jumper on and GS2 jumper off selects: +/-2g;

GS1 jumper off and GS2 jumper on selects: +/-4g;

both jumpers off selects a range of +/-6g.

ACCELEROMETER

Page 13: Physical prototyping lab5-complex_sensors

EXERCISE ►ACCELEROMETER• Connect one of the Accelerometer sensors to

your Arduino board

• Test to see if it works

• Modify the code so that it sends the following strings to the computer:

“LEFT”, “RIGHT”, “UP”, “DOWN” ... basically you should transform your Arduino into

a tilt-pad

Page 14: Physical prototyping lab5-complex_sensors

ULTRASOUND • Ultrasound is a technology used for submarines, accurate measuring

of forms through human tissue, etc.

• Technically it is called SONAR• We will use a cheap sensor (either PING or SRF05) to measure the

distance to objects

• The basic functionality works like this:– the sensor emits a burst (signal)– it enters listening mode– the burst bounces on any objects and the signal travels back– the sensor estimates the time it takes for the signal to come back– it sends a pulse to the microprocessor which width is in relation to the

signals flying time and therefore to the distance to the object

Page 15: Physical prototyping lab5-complex_sensors

ULTRASOUNDThe signals of the SRF05 sensor look like this:

Page 16: Physical prototyping lab5-complex_sensors

ULTRASOUNDThe signals of the PING sensor look like this:

Page 17: Physical prototyping lab5-complex_sensors

The difference between the SRF05 and the PING))) sensor is in the amount of pins they have:

– the SRF02 sensor has one input and one output pin, as well as a mode pin that allows to use it as the PING sensor

– the PING sensor only has three pins: 5V, GND, signal and therefore it requires to use a pin both as input and as output

ULTRASOUND

Page 18: Physical prototyping lab5-complex_sensors

EXERCISE ►ULTRASOUND

Page 19: Physical prototyping lab5-complex_sensors

ULTRASOUND: COVERAGE• The concept of coverage of a sensor is used to determine the

physical range where it will gather data

• E.g. a remote control will only communicate if it is pointing towards the TV, this means that the coverage area of the remote is only in front of it.

• Each sensor has a characteristic (unique) coverage range

• The coverage area of ultrasound sensors is not very narrow. They have an opening angle of 20-60 degrees depending on the type. The ones we use in class have an angle of about 50 degrees

• This means that we have to be careful when mounting the sensor. It has to be almost sticking out of the object we mount it on

Page 20: Physical prototyping lab5-complex_sensors

ULTRASOUND: COVERAGE• The following diagram represents the typical

coverage of an Ultrasound sensor

• You can see how it reaches furthest in front of the sensor while it goes less far on the sides

PICTURE © 2006 Devantech

Page 21: Physical prototyping lab5-complex_sensors

A matrix is used in LED displays to control many outputs (LED’s) with few pins

Showing something on the LED display is done by using a special pattern

This pattern makes use of the LEDs polarity (Its ability to only conduct electricity in one direction)

LED displays are expandable by linking them to each other

Instructables has a good instruction on how to do this

MULTIPLE OUTPUTS

Page 22: Physical prototyping lab5-complex_sensors

MULTIPLE OUTPUTS

Page 23: Physical prototyping lab5-complex_sensors

Turning one row of LED’s HIGH and one column LOW will light up one LED

Switch between the rows really fast and the human eye will think all of them are on all the time.

MULTIPLE OUTPUTS

Source: http://letsmakerobots.com/node/23980 Source: http://tacticaldesign.mit.edu/page/2

Page 24: Physical prototyping lab5-complex_sensors

Multiple outputs• You can create an LED display and interact with

it using an accelerometer.• This can be done with either The Dawn board

or a Matrix board

Page 25: Physical prototyping lab5-complex_sensors

USEFUL RESOURCES• Shops:

– Sparkfun– Electrokit– Elfa– Adafruit

• Information:– Arduino– Arduino playground– Led wizard– Instructables– Resistor Calculator– Analog Circuits– Educypedia

• Inspiration:– Youtube– Flickr– Google– Yanko design– We make money not art– FFFFF– Graffiti Research Lab