PHYSICAL PROTOTYPING




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




   © 2008 K3 Malmö University, Creative Commons v3.0 SA-NC
SENSOR
•   Device messuring information from the environment (the world) and
    translating the values into data understa...
ANALOG SENSORS
•   ANALOG SENSORS: wihtin this group we distinguish two modalities:
     – RESITIVE/CAPACITIVE SENSORS: th...
COMPLEX SENSORS
•   Their main characteristic is that they communicate using either digital
    pins with PWM, serial comm...
SENSOR vs. ACTUATOR
•   Remember the statement:



EVERY SENSOR CAN BE USED AS
 AN ACTUATOR AND VICEVERSA
•   This can be ...
A COUPLE OF TRICKS
•   If, after plugging all your gear to an Arduino board...
      – you lack some digital inputs for yo...
TO WARM UP: TILT SENSOR
•   Just to get started, we are going to hook up a TILT sensor. These
    sensors are of two diffe...
TILT SENSOR



                                    TILT sensor in a pull-up
                                    configurat...
PRESENCE vs. DISTANCE
•   Many projects aim to determine whether there is people or not in a
    space
•   Some other will...
DISTANCE
•   There are different types of sensors that act very well depending on
    the distance range we messure into:
...
ULTRASOUND
•   Ultrasound is a technology used for submarines, accurate messuring
    of forms through human tissue, etc.
...
ULTRASOUND
•   The signals look like in the following diagram (PING sensor):
ULTRASOUND
•   The signals look like in the following diagram (SRF05 sensor):
ULTRASOUND
•   The difference between the PING and the SRF05 sensor is in the
    amount of pins:
     – the PING sensor o...
EXERCISE --> ULTRASOUND




              PICTURE © 2008 Nicholas Bauer
EXERCISE --> ULTRASOUND
• Connect one of the Ultrasound sensors to
  your Arduino board using the code
  available for it:...
ULTRASOUND: COVERAGE
•   The concept of coverage of a sensor is used to determine the
    physical range where it will gat...
ULTRASOUND: COVERAGE
•   The following diagram represents the typical coverage of an
    Ultrasound sensor
•   You can see...
ACCELEROMETER
•   Accelerometers are sensors that can messure different things, among
    others they can messure the tilt...
ACCELEROMETER
•   The accelerometer we are using (MEMSIC 2125) can messure only 2
    dimensions of the movement that we c...
PICTURE © 2005 ParallaxInc
ACCELEROMETER
•   The MEMSIC 2125 has one extra pin where it is possible to get the
    value of temperature as an analog ...
EXERCISE --> ACCELEROMETER
• Connect one of the Accelerometer sensor
  to your Arduino board using the code
  available fo...
Upcoming SlideShare
Loading in …5
×

Complex Sensors

3,641 views

Published on

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,641
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
150
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Complex Sensors

  1. 1. PHYSICAL PROTOTYPING © 2008 K3 Malmö University, Creative Commons v3.0 SA-NC
  2. 2. COMPLEX SENSORS © 2008 K3 Malmö University, Creative Commons v3.0 SA-NC
  3. 3. 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)
  4. 4. 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
  5. 5. 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 – ...
  6. 6. 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
  7. 7. 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
  8. 8. 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
  9. 9. TILT SENSOR TILT sensor in a pull-up configuration • We call the resistor a “pull up” resistor • it is usually 10K • you can use exactly the same code as in BUTTON example
  10. 10. 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!
  11. 11. 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
  12. 12. 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
  13. 13. ULTRASOUND • The signals look like in the following diagram (PING sensor):
  14. 14. ULTRASOUND • The signals look like in the following diagram (SRF05 sensor):
  15. 15. 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
  16. 16. EXERCISE --> ULTRASOUND PICTURE © 2008 Nicholas Bauer
  17. 17. 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
  18. 18. 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
  19. 19. 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
  20. 20. 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
  21. 21. 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 1g IMAGES © 2005 machinegrid.com
  22. 22. PICTURE © 2005 ParallaxInc
  23. 23. 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
  24. 24. 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

×