+ All Categories
Home > Technology > Complex Sensors

Complex Sensors

Date post: 14-May-2015
Category:
Upload: elliando-dias
View: 2,650 times
Download: 0 times
Share this document with a friend
Popular Tags:
24
PHYSICAL PROTOTYPING © 2008 K3 Malmö University, Creative Commons v3.0 SA-NC
Transcript
Page 1: Complex Sensors

PHYSICAL PROTOTYPING

© 2008 K3 Malmö University, Creative Commons v3.0 SA-NC

Page 2: Complex Sensors

COMPLEX SENSORS

© 2008 K3 Malmö University, Creative Commons v3.0 SA-NC

Page 3: Complex Sensors

SENSOR• Device messuring 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 iterface 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 4: Complex Sensors

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

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

• LDR – Light Dependant Resistors

• Potentiometer: angle/strech 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 messure tilt, and movement

• InfraRed: to messure distances from 1mm to 80cm

• Humidity

Page 5: Complex Sensors

COMPLEX SENSORS• Their main characteristic is 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)

• They require a careful reading of the datasheet which explains the procedure of connection, ways to gather and parse data, etc.

• We find many sensors within this group:

– 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 messuring the distance to objects using sonar technology

– Precise Temperature sensors

– ...

Page 6: Complex Sensors

SENSOR vs. ACTUATOR• Remember the statement:

EVERY SENSOR CAN BE USED AS AN ACTUATOR AND VICEVERSA

• This can be applied at low level, thus complex sensors and simulated analog sensors will NOT follow the statement

• Resistive sensors will, the best example is the piezo element that will also act as knock sensor

• 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 7: Complex Sensors

A COUPLE OF TRICKS• If, after plugging all your gear 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,5Volts, 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

Page 8: Complex Sensors

TO WARM UP: TILT SENSOR• Just to get started, we are going to hook up a TILT sensor. These

sensors are of two different types:

– TYPE 1: angle messuring sensor

– TYPE 2: vibration messuring sensor

• We are going to experiment with TYPE 1.

• These sensors are, in essence, digital sensors. You can connect them making use of the typical button circuit using a pull-up resistor. The TILT sensor is nothing but a small metallic ball inside a metallic cone where the ball will make the two external contacts shortcircuit depending on the angle

• Using the same code we used for the button, when hooking up the sensor to the board, we will light up the LED when tilting the board

Page 9: Complex Sensors

TILT SENSOR

• We call the resistor a “pull up” resistor• it is usually 10K• you can use exactly the same code as in BUTTON example

TILT sensor in a pull-up configuration

Page 10: Complex Sensors

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

space

• Some other will try to determine the distance to objects

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

• However we have to keep in mind that:

– presence implies to distinguish animated from inanimated 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 simulating the desired functionality ... BUT WE WON'T MAKE IT FOR REAL!

Page 11: Complex Sensors

DISTANCE• There are different types of sensors that act very well depending on

the distance range we messure into:

– 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 messure 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 messuring of touch (many use it in their projects to simulate touch sensors) or distances smaller than 5cm, but it has very low accuracy

• We have seen LDRs before, we will study Ultrasound as an example, IR is similar

Page 12: Complex Sensors

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

of forms through human tissue, etc.

• Technically it is also called SONAR

• We will use a cheap sensor (either PING or SRF05) to messure the distance to objects

• The basic functionality is:

– 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 13: Complex Sensors

ULTRASOUND• The signals look like in the following diagram (PING sensor):

Page 14: Complex Sensors

ULTRASOUND• The signals look like in the following diagram (SRF05 sensor):

Page 15: Complex Sensors

ULTRASOUND• The difference between the PING and the SRF05 sensor is in the

amount of pins:

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

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

Images © 2005-08 Devantech

Page 16: Complex Sensors

EXERCISE --> ULTRASOUND

PICTURE © 2008 Nicholas Bauer

Page 17: Complex Sensors

EXERCISE --> ULTRASOUND

• Connect one of the Ultrasound sensors to your Arduino board using the code available for it:– UltrasoundSensor_PING_v1.pde , or– UltrasoundSensor_SRF05_v1.pde

• Test that it works• Modify the code so that it sends data to the

computer only if the messurements are smaller than 1m

Page 18: 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 and Ultrasound sensors are not very pointy. They have an opening angle of 20-60 degrees depending on the type

• The ones we use in class are having an angle of about 50 degrees

• This means that we have to be carefull when mounting the sensor. It has to be almost sticking out of our object

Page 19: 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 20: Complex Sensors

ACCELEROMETER• Accelerometers are sensors that can messure different things, among

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

• Accelermeters 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 messure 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 21: Complex Sensors

ACCELEROMETER• The accelerometer we are using (MEMSIC 2125) can messure only 2

dimensions of the movement that we call axis X and Y

• The information comes in two digital pins that offer a PWM signal which pulse-width can be messured with a microcontroller

• The signal's shape for each axis depends on the acceleration

-1g 0g 1gIMAGES © 2005 machinegrid.com

Page 22: Complex Sensors

PICTURE © 2005 ParallaxInc

Page 23: Complex Sensors

ACCELEROMETER• The MEMSIC 2125 has one extra pin where it is possible to get the

value of temperature as an analog signal. This value can be used for correcting messuring errors and achieve the sensor's optimal accuracy

• 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 messure the sensor's tilt and acceleration

PICTURE © 2005 ParallaxInc

Page 24: Complex Sensors

EXERCISE --> ACCELEROMETER

• Connect one of the Accelerometer sensor to your Arduino board using the code available for it:– AccelerometerSensor_MEMSIC_v1.pde

• Test that it works• Modify the code so that it sends the follwing

strings to the computer: “LEFT”, “RIGHT”, “UP”, “DOWN” ... basically you should transform your Arduino into a tilt-pad


Recommended