hardware of the sensor network -- sensors and peripheral hardware -- lin gu sept 8, 2003
Post on 18-Dec-2015
214 views
TRANSCRIPT
Outline
• Sensors and Actuators• Definition and examples
• Supporting circuit• Hardware compatibility
• Drivers• Software interface
• Put them together – Sample design• How to integrate a sensor and write a driver for it
Sensors and Actuators
• Transducer: “A device which transforms energy from one domain (magnetic, thermal, mechanical, optical, chemical, electrical) into another”
• Sensors: “devices which monitor a parameter of a system, hopefully without disturbing that parameter.”
• Actuators: “devices which impose a state on a system, hopefully independent of the load applied to them”
Sensor?
Actuator?
Sensors and Actuators• Example of sensors
– Magnetic sensors• Honeywell’s HMC/HMR magnetometers
– Photo sensors• Clairex: CL9P4L
– Temperature sensors• Panasonic ERT-J1VR103J
– Accelerometers• Analog Devices: ADXL202JE
– Motion sensors• Advantaca’s MIR sensors
• "Without disturbing that parameter" implies that the sensors must be small and low-power devices in order to reduce energy exchange.
» Sensors: “devices which monitor a parameter of a system, hopefully without disturbing that parameter.”
Sensors and Actuators
• Examples of Actuators– Motor (impose a torque)– Pumps (impose pressure or fluid velocity)
• Actuators may be powerful, large, and complicated
» Actuators: “devices which impose a state on a system, hopefully independent of the load applied to them”
Sensors and Actuators
• Properties of sensors– Range
• Example – HMC1053: +/-6 Gauss
• What decides range?– Saturated point– Noise
– Accuracy• Measure of error and uncertainty• HMC1002: 0.05% (Hysteresis)
– Repeatability• HMC1002: 0.05%
– Linearity• HMC1002: 0.1% (Best fit straight line +/- 1 Gauss)
Sensors and Actuators
• Properties of sensors– Sensitivity
• How output reflects input?• HMC1053: 1mV/V/gauss
– Efficiency• Ratio of the output power to the input power• Important for actuators
– Resolution• Determined by sensitivity and noise level• Measuring noise level
– SNR– Noise floor (High noise floor does not mean “useless”)
• HMC1002: 27uGauss
Sensors and Actuators
– Response time• How fast the output reaches a fraction of the
expected signal level
– Overshoot• How much does the output signal go beyond the
expected signal level
– Drift and stability• How the output signal varies slowly compared to
time
– Offset• The output when there is no input
Sensors and Actuators
• Properties of sensors– Packaging
• Example – HMC1053: 16-PIN LCC packaging
– Property of the circuit• Load of the circuit• Power drain
Sensors and Actuators• What’s the implication to the
application/middleware?– Select the suitable sensors for the target
application– Imposing three general requirements to the
application/middleware
Sensors and Actuators
• Requirement 1: sensor part– Application designer must be aware of the
properties of sensors• How to handle imperfect sensor devices
– Error, offset, drift, …– Repeatability– Sensors vary
• Requirement2: sensor reading– Application designers must be aware of the errors
introduced by the mote hardware?• The effect of ADC converting• The effect of signal amplification/distortion
Sensors and Actuators
• Requirement3: interaction– The application designer must be aware of the
interaction of multiple sensors and the mote hardware
• How to avoid race conditions on hardware wires and software event handlers?
• How to control the mutual interaction of various hardware components?
– Example: radio component increases the noise floor of the motion sensor
• Can we make the sensors complement with each other to achieve better sensing?
Sensors and Actuators
• Example of sensors: motion sensor using MIR– TWR-ISM-002
• Output (Advantaca’s)– Analog– Digital
• Packaging– 51-pin connector
• Fine tuned receiving gate can potentially detect moving objects at a certain distance
• Is it a typical sensor?
Sensors and Actuators
• Post-processing– Process the sensor reading to make it useful to
the application– The complexity varies from simple threshold
algorithm to full-fledged signal processing and pattern recognition
Sensors and Actuators
• Raw reading of an MIR sensor in a quiet environment– The beginning period represents some
unknown noise, possibly due to the positioning of the sensor
I ndoor test , qui et envi ronment wi thout mot i on
0
100
200
300
400
500
1 80 159 238 317 396 475 554 633 712 791 870 949 1028
7. I ndoorQui et
Sensors and Actuators
• Raw reading of an MIR sensor as a person walked by– The all-zero period is due to unreliable UART interface
used to collect the reading and can be ignored.
39. 64Hz. Mi l ton. sb. MI R. DanWal k. 3
0
20
40
60
80
100
120
1 13 25 37 49 61 73 85 97 109 121 133 145 157 169 181 193 205 217 229 241 253 265 277
39. 64Hz. Mi l ton. sb. MI R. DanWal k. 3
Sensors and Actuators
• Use a post-processing algorithm to transform the raw reading to what the application needs– The application needs to know whether
the motion of interest is detected– The post processing needs to filter out
noise whenever possible
Sensors and Actuators• Post-processing algorithms
– “Moving variance” algorithm• Adapt to the environment dynamically but requires
more computation• Designed by OSU• The basic idea is to track the changes of a statistic
variable• To avoid the complexity of moving variance
computation, another statistics variable was used for mote-based moving object detection
• If “adapting” feature is not required, offline modeling and online detection can be combined
Sensors and Actuators
• More on “Moving variance” algorithm– Calculate the variance of the samples– Example: Suppose the sensor data in a “quiet” environment is as
follows
• Mean: 3• Variance: 2.18
» This is my interpretation of OSU’s algorithm. I have not seen their code or detailed description of it.
0
1
2
3
4
5
6
1 2 3 4 5 6 7 8 9 10 11 12
Ser i es1
Sensors and Actuators
• More on “Moving variance” algorithm– Continuously calculate the variance of the recent sampling period– When the variance changes, fire a “positive detection” event
• Mean: 3• Variance: 4.9
» This is my interpretation of OSU’s algorithm. I have not seen their code or detailed description of it.
0
1
2
3
4
5
6
7
1 2 3 4 5 6 7 8 9 10 11 12
Ser i es1
Sensors and Actuators
• More on “Moving variance” algorithm– Overall, the waveform looks like
– On the right half, a “positive” detection event is fired
0
1
2
3
4
5
6
7
1 3 5 7 9 11 13 15 17 19 21 23
Seri es1
Motion!
Sensors and Actuators
• More on “Moving variance” algorithm– This technique can be applied to other statistical
variables• Mean• Standard deviation• MIN, MAX
– The main idea is to use the statistics in a recent sampling period to
• detect “phase change”• filter out burst noise reading
Sensors and Actuators• Another post-processing algorithm
– “Recently convincingly active” algorithm• Record a history of about half a second. A positive
(motion detected) event is fired when there have been more than a number of significant jumps in the waveform in the history period.
• Simple, fast, and quite reliable• Needs to be tuned in the environment. E.g., we need to
define the threshold for “significant jumps”.
Sensors and Actuators
• Other sophisticated sensors– GPS sensors– Ultrasonic transceiver
• Sensor network hardware that does not fall into the transducer category– RFID– Cots-Bots
Sensors and Actuators
• More on RFID– Typical configuration
– Application: ID based intelligent control• Such as access control, baggage ID, object tracking…
Sensors and Actuators
• More on RFID– What is RFID?
• Radio communication capability• Processing capability• Memory• Optionally, power supply
– What makes RFID unique and useful?• Flexible• Low-cost
– Compare RFID with motes• Difference? If yes, why?• Will they merge to be the same class of hardware?
Sensors and Actuators
• More on RFID– What is behind RFID, motes and many
other small intelligent devices?• We need to integrate the computation
capability into the physical world to improve the quality of life, and to facilitate applications that were not feasible before
• To make this possible, we need a large number of computing devices. This mandates that they have very low cost and consume little power
• For low-cost and low-power devices to do sophisticated work, they need communication capability
• For a large number of devices to communicate, radio communication is probably the only feasible option
• Finally, the current technology has enabled all these to happen
To incorporate intelligence in the physical world
Large number ofcomputing devices
Low-cost devices
Wireless communication
Sensors and Actuators
• More on RFID– The integration of low-cost computation and low-cost
radio communication enables not only RFID, but also other RF-* technologies. So RFID represents a broad spectrum of innovative applications. Sooner or later, people may create RF-CD (with super copyright protection), RF-liquor (which evaporates immediately when reaching an RFID indicating a non-adult), RF-book (which applies errata correction automatically), RF-map (which highlights the current location), RF-stick (which reminds a blind man about a bump ahead)…
Sensors and Actuators
• More on RFID– Challenges may include
• how to name?– For RFID, how to assign the ID?
– For RF-*, how to discover and address each other, including “master devices”?
• How to coordinate?• How to provide both security and privacy?
Supporting circuit• Sensors may need supporting circuit to
integrate with other sensors and the target application platform
• Similar to an “adaptor” on PCs– Makes the electrical features of the computer and
the I/O device compatible– Provides control and data transfer interface to the
I/O device
• This talk focus on the Berkeley mote platform
Supporting circuit
• Berkeley mote– Supports analog and digital
sensors– 10-bit ADC– Various sensor board available
• Special circuit is needed when incorporating special sensors– Sample: the power board for the
MIR sensor– Designed by OSU– Lift power voltage– Transfer the sensor output to the
mote
Drivers• Software that controls the operation of an I/O
device• In TinyOS, usually the software components
that correspond to the hardware components provide driver functions– HPLCC1000M: radio driver– ADCM: ADC driver– PhotoTempM: Photo sensor and temperature
sensor (sometimes hardware components share a driver)
Drivers• A driver usually provides some common
control interfaces and some hardware-specific interfaces
• A driver may use other components• Sample: Magnetometer – MagM
MagM
StdControl MagSetting
ADCControl PotControl (StdControl) I2CPot
Common control interface Mag-specific interface
Drivers• Sample interface definition of the magnetometer
– provides interface StdControl;• Standard control interface
– Init, start, stop
– provides interface MagSetting;– interface MagSetting {
command result_t gainAdjustX(uint8_t val);
command result_t gainAdjustY(uint8_t val);
event result_t gainAdjustXDone(bool result);
event result_t gainAdjustYDone(bool result);
}
• The operation of drivers is similar to those in traditional computers, but more resource-limited and usually simpler.
• Polling and interrupt-based I/O are used• Sample: PhotoTempM - reading
1 TOSH_CLR_TEMP_CTL_PIN();
2 TOSH_MAKE_TEMP_CTL_INPUT();
3 TOSH_SET_PHOTO_CTL_PIN();
4 TOSH_MAKE_PHOTO_CTL_OUTPUT();
5 return call InternalPhotoADC.getData();
Drivers
Shut down temperature sensor
Start photo sensor
Drive ADC to get reading
• Illustration of one of the interfaces -- ADC– How a driver uses support components/drivers?– What does the InternalPhotoADC.getData() do?
Drivers
getData()
getContinuousData()
Interface ADC
dataReady(uint16_t data)
Commands
EventsADC
Middleware/app
getData() dataReady(data)
call callback
Put them together – Sample Design
• Step by step sample of how to integrate a new type of sensor into the system
• Sample sensor: MIR motion sensor– An MIR based motion sensor
• TWR-ISM-002 made by Advantaca
– Working with a different electrical setting than the mote’s
– 51-pin connector
Sample Design
• First, we need to make the electrical settings compatible
• OSU made a power board for this purpose– 51-pin connector– Provides 5.5V and 3.6V
power supply– Transfers the output from
the MIR sensor to the motes
Sample Design• Power supply and
sensor data pins• Power supply pins
are also control pins
• Connection:– Power supply pins
to the power supply input of the sensor
– The sensor output to the sensor data pins
Sample Design• Connects to the Mica
sensor board or Mica2 board
• Connection:– Mica2 (MicaSB) power
supply pins to the power supply pins on the power board
– Sensor data output to Mica2 (MicaSB) sensor data output/input
Sample Design• Now we’ve connected
the hardware. How can we drive them by software?
• Again, we need to look at the hardware– Question: How are the
I/O devices connected to the CPU?
– Look at the connector configuration
Sample Design• Then…
– Question: How the CPU communicates with the I/O devices?
– Look at the Mica2 schematic
– From the CPU’s point of view, the pins are addressed as bits in PortC, PortE and PortF
Sample Design• Then…
– Aliasing for easy use• PW0_PIN is aliased to the 0th bit of PortC, which connects to
– Pin 29 of the connector on the Mica2 board– (optionally) pin 29/49 of the connectors on the Mica sensor board– Pin 29 of the connector on the power board– Pin 29 of the connector on the MIR sensor board
• MIR_DIN_PIN is aliased to the 2nd bit of PortE, which connects to
– pin 25 of the connector on the Mica2 board– Optionally, pin 2/25 of the connectors on the Mica sensor board– pin 25 of the connector on the power board– and pin 25 of the connector on the MIR sensor board
– We can now read/write the pins to enable/disable/read the sensor
Sample Design• Enabling/Disabling/Reading
– EnablingTOSH_SET_PW0_PIN();
TOSH_SET_PW1_PIN();
TOSH_SET_PW4_PIN();
– DisablingTOSH_CLR_PW0_PIN();
TOSH_CLR_PW1_PIN();
TOSH_CLR_PW4_PIN();
– Reading• TOSH_READ_MIR_DIN_PIN();
Sample Design• Now we’ve acquired the digital reading.
Sometimes we also hope to read analog reading from the sensors
• The analog readings are read through the ADC component
• The general procedure is similar• The enabling/disabling procedure is usually the
same as that for the digital reading• Specifics about ADC reading
– Event driven– Multiplexing and demultiplexing
Sample Design• Post-processing of the information collected
from the sensor– The raw reading is not reliable
• High noise floor, due to environment noise, hardware interaction, and sensor interference
• SNR <= 1
– Apply the “Recently convincingly active” algorithm– The analog reading is analyzed and transformed to a
binary reading: “positive detection” and “negative detection”, which can be conveniently used by higher level applications
References and acknowledgements
•Thanks to Prof. Stankovic for reviewing and commenting on the slides
•Thanks to Yingmin Li for explaining some concepts in Physics
•Reference sites
•Honeywell: www.honeywell.com
•Alien Technology: http://www.alientechnology.com/
•Phillips Semiconductor: http://www.semiconductors.philips.com/markets/identification/products/icode/
•Texas Instruments: www.ti.com
•RFID Journal: www.rfidjournal.com
•www.rfid-handbook.com
•TinyOS: http://today.cs.berkeley.edu/tos
References and acknowledgements
Reference books and papers
• Ilene J. Busch-Vishniac, Electromechanical Sensors and Actuators• Vince Stanford, Pervasive Computing Goes the Last Hundred Feet with RFID Systems• Prabal K. Dutta. Integrating Micropower Impulse Radar and Motes• Michael J. Caruso, Lucky S. Withanawasam. Vehicle Detection and Compass Applications using AMR Magnetic Sensors• Advantaca: Hardwre User’s Manual for TWR-ISM-002-I Radar