Musical Chairs and Magic Carpets

Document Sample
Musical Chairs and Magic Carpets Powered By Docstoc
					MAS836 – Sensor Technologies for Interactive Environments

    Lecture 10 – Digital Sensor Processing and Modules
4/05                                                         AYB

                     The Next Steps
       • So far, we have concentrated on the use of a
         variety of sensors to measure human interaction
       • However, a measurement alone is of little value
       • Therefore, we consider the next steps:
          Conversion of the data into a computer-readable
          Processing (if desired) within the computer
          Communication of that data to other devices

4/05                                                                          AYB

                         One Approach
       • There are numerous possible data flows patterns
       • We will concentrate on one:
                  Analog      Analog to Digital     Digital         RF
                 Processing     Conversion        Processing   Transmission

       • Each step involves different technologies and a
         number of issues
       • They will be covered in data flow order
       • We will also discuss other networking protocols
         beyond RF transmission

4/05                                                           AYB

                 Analog Processing (1)
       • Most analog signal processing was covered in
         first three lectures
       • Some issues are of special importance when
         preparing data for analog to digital conversion
          Or just to get the most out of it in general
       • Three issues are quickly touched upon
          Obviously there are many more
          Just as important for looking at data using other
           techniques (e.g. oscilloscope)
4/05                                                           AYB

                Analog Processing (2)
       • Output Range
          Voltage output should fill the input range of the
           analog to digital converter (ADC)
          In general, also need to consider uni-/bipolar
       • Output Bandwidth
          Amplifier (and similar) should attenuate outside
           frequencies of interest (both high and low)
          Take both sensor and data bandwidth into account
       • Output Impedance
          Usually need to buffer data to avoid unnecessary
           loading of next portion of measurement chain
4/05                                                         AYB

           Analog to Digital Conversion:
       • Converts analog data (continuous) into digital
         values (discrete)
       • A given range is divided up into a number of
         steps, each at a discrete voltage and represented
         (in order) by an integer value

4/05                                                                     AYB

            Analog to Digital Conversion:
                  Figures of Merit
       • Number of bits: Size of the integer used to represent
         the analog value.
           N bits provide 2N different values
       • Vref: Maximum voltage of the converter
           Vref is represented by 2N-1
           Minimum voltage is almost always 0V
       • Sampling rate: Number of individual measurements
         made in a fixed time
           Limited by technique used
       • Impedance limit: Largest input impedance at which the
         ADC will still function properly
           Based on size of internal hold capacitor and sampling rate
4/05                                     AYB

         Analog to Digital Conversion:
          Successive Approximation
  • Most common form of ADC
  • Bits are calculated one at a
    time and operation can be
    stopped at any point
  • Each bit is found by
    comparing the input value to
    the value represented by all
    the bits calculated so far
        Requires a DAC
4/05                                      AYB

          Analog to Digital Conversion:
  • Simplest, fastest form of ADC
        Sometimes known as a parallel
  • Voltage ladder divides
    reference voltage into 2N steps,
    which are compared to the
    input voltage
        Requires 2N resistors and
        Limited by resistor accuracy
4/05                                       AYB

           Analog to Digital Conversion:
       • Highest accuracy
         ADCs are sigma-delta
          Will not go into too
           much detail, operation
           mostly concerns noise
       • Chart shows range of
         ADCs discussed

4/05                                                          AYB

           Analog to Digital Conversion:
                  Sampling Rate
       • Sampling rate raises issues beyond obvious
       • Aliasing is the folding over of higher frequencies
         when sampled at less than double their
       • Leads to loss of data and increase in noise
       • To avoid these problems:
          Always sample at twice the highest frequency of
           interest (known as Nyquist sampling)
          Always filter out higher frequencies before
4/05                                                              AYB

           Analog to Digital Conversion:
       • The error in an ADC can be treated as a white
         noise source
          Only if number of bits is high enough and voltage is
           in range
       • Equivalent to half of the least significant bit
          6(N+1) dB
       • Comparison of this value and the noise in the
         system allows calculation of the maximum
         accuracy (number of bits) worth considering
4/05                                                      AYB

       • A microcontroller (uC) is a small, lightweight
         CPU which is usually combined with on-board
         memory and peripherals
          Compact and low power (relatively)
       • They are often used as a simple hardware to
         software interface as well as for in-situ
          Often used as an analog to digital gateway
          Allows for real-time feedback based on data

4/05                                                          AYB

                      Features (1)
       • Processor speed: Fundamental measure of
         processing rate of device
          Value of interest is in MIPS, not MHz
       • Supply voltage/current: Measure of the amount
         of power required to run the device
          Multiple modes (sleep, idle, etc)
       • It is possible to adjust the voltage and frequency
         of some devices in real time, thereby trading off
         speed and power usage
4/05                                                              AYB

                      Features (2)
       • Internal memory: Sometimes divided between
         program and data memory, the amount of
         information that can be stored on board
          Can sometimes be supplemented by external memory
       • I/O Pins: Individual points for communication
         between the uC and the rest of the world
          Can be digital or analog, general or special purpose
       • Interrupts: Non-linear program flow based on
         event triggers from peripheral or pins
4/05                                                          AYB

                     Peripherals (1)
       • Timers: Internal registers (any size) in the uC
         that increment at the clock rate
          May have prescaler
          May be combined with range testing for interrupt
          Watchdog timers reset processor if it hangs.
       • Comparators: Input that effectively functions as
         a 1-bit ADC with a variable threshold set by an
         internal register
          Often used for real-time data monitoring
4/05                                                                AYB

                     Peripherals (2)
   • ADC: Most ADCs used in sensor data collection
     are integrated with uC and are controlled via
     special registers
          Watch for number of channels vs number of inputs
          Sampling speed will not take input switch into account
          Clock internally via timers (benefits?)
          Very fast ADCs often combined with DMA
   • DAC: Digital to analog converters are also
     include in some data collection driven uC
        Mostly used for feedback and control
4/05                                                                                     AYB

                        Communication (1)
       • UART: Basic hardware module which mediates serial
         communication (RS232)
           Simplest form of communication between uC and computer, but limited
            by speed
           Most modules are full duplex, but need to watch out for data registers and
       • USB: High Bandwidth Serial Communication between uC and a
         computer or an embedded host
           Usually requires chips with specialized hardware and firmware
           Requires custom driver on the host side or conforming to a standard
            device class
       • SPI: Full duplex master-slave 4-wire protocol for data transfer
         between uCs
           Mbit transfer rates
           Somewhat quirky protocol
           Unlimted (almost) nodes, can change master
4/05                                                     AYB

                   Communication (2)
       • I2C: Half duplex master-slave 2-wire protocol
         for data transfer between uCs
          kbit transfer rates
          Tx/Rx based on slave addressing
          Can invert protocol with sensors as masters
       • RF: Radio frequency (>100 MHz) EM
         transmission of data
          Built in to some newer special-purpose uC
          Wireless spherical transmission
          Much (much) more later
4/05                                                       AYB

              Silicon Labs (FKA Cygnal)
       • 8051 derivate uC with high reconfigurability
          Many programming environments available
          Vary from 3mm2 to 100 pin packages
       • General specs
            Medium power
            Max 100 MHz / 100 MIPS
            Max 128K program space / 8K RAM
            Max 16 bit ADC
            UART/USB/SPI/CAN/PWM/Comparators
4/05                                                             AYB

                       TI MSP430
       • Proprietary TI low-power low-cost RISC chips
          Highly supported by TI with great program chain
          Designed for intermittent sampling and fast startup
       • General specs
            Very low power (flexible)
            Max 32KHz / 8 MIPS
            Max 50K program space / 10K RAM
            Max 16 bit ADC
            UART/SPI/DAC/LCD/PWM/Comparators
4/05                                                                     AYB

                         Atmel AVR
       • 8-bit RISC series of microcontroller chips
           Large range of available devices covering many interfaces,
            speeds, memory sizes, and package sizes
           Large hobbyist development community with many available
            toolchains and sample applications
       • General specs
             One MIPS per MHz
             Models available up to 20MHz
             Max 128K program space / 8K RAM
             ADC/LCD Driver/Motor Control
             UART/CAN/USB/IIC/SPI/DAC/LCD/PWM/Comparators
4/05                                                         AYB

        Atmel ARM7 (AT91SAM7S series)
       • 32-bit ARM microcontroller
          Low power (for 32-bit machines)
          Can run in 16-bit mode if needed
       • General specs
            Lots of memory (8-64KB RAM, 32-256KB flash)
            Variable speed up to 55MHz
            Packed with peripherals (USB, ADC, SPI, etc.)
            Comes in LQFP 48 and 64 packages
            Not suitable for beginners
4/05                                                                          AYB

       • Analog Devices ADUC8xx:
          More of an ADC with a uC attached
          Some models include 24 bit sigma-delta converter
          Useful with IEEE 1451 (see later)

       • Chipcon CC1xxx:
          More of an RF transceiver with a uC attached
          Variety of frequency ranges and modulation schemes

4/05                                                                   AYB

                Digital Signal Processing:
                         x[n]     Digital Filter h[n]   y[n]

       • A discrete time (and often discrete value) stream
         x[n] is convolved with a discrete time impulse
         response h[n] to produce an output y[n]
          x[n] is usually acquired from a continuous time
           signal x(t) using an ADC
          h[n] is the response to a single input of 1 at time 0
            >   Can be finite (FIR) or infinite (IIR)
            >   Can be described as a difference equation and easily
4/05                                                              AYB

               Digital Signal Processing:
       • Why would I want to do this?
            Trivially reconfigurable in real-time
            Off-line processing
            Power savings
            Ease of implementation (for some impulse response)
       • What are the drawbacks?
          Non-parallel
          Memory intensive
          Stability issues can be complex
4/05                                                             AYB

                Digital Signal Processing:
                      Algorithms (1)
       • Simplest and most common DSP algorithm is
         the running average:

          Acts as a smoothing filter
            >   Pseudo-lowpass
          This is the N-point version
          Can you implement this in two operations per cycle?

4/05                                                      AYB

             Digital Signal Processing:
                   Algorithms (2)
       • A wide variety of frequency filters (HP/LP/BP)
         can be constructed as both FIR and IIR filters
          FIR more stable
          IIR require fewer data point
          See MATLAB for more details
       • Fast Fourier Transform allows quick (       )
         conversion from time domain to frequency
         domain (for N = power of two)
4/05                                                       AYB

          Radio Frequency Transmission:
                    Basics (1)
       • Radio frequency (RF) electromagnetic
         transmission is the use of high frequency
         radiation to transmit data wirelessly between
          Can be very high speed (50 Mbits+)
          Can have enormous range (10 km+)
          Does not require line-of-sight
       • The system which we will use will tend to be
         <1Mbit and have a range of <100m, but all of
         the same principles apply (ex power management)
4/05                                                                AYB

          Radio Frequency Transmission:
                    Basics (2)
       • Data is transmitted on a carrier wave of a fixed
          The center frequency of this transmission is known
           as the carrier frequency
          Data is introduced into the carrier through means of a
           modulation scheme
       • Often, multiple transmitters want (need) to share
         the channel, requiring channel access schemes
       • Transmissions are made more robust to (non-flat)
         interference through spread spectrum techniques
4/05                                                             AYB

         Radio Frequency Transmission:
                 Figures of Merit
       • Transmitter power: Measured in dBm (dB
         referenced to 1 mW), the fundamental
         measurement of the power in a signal
          Most unlicensed transmitters are ~0dBm
       • Receiver sensitivity: The smallest signal which
         can be adequately detected
          Usually around –90dBm
       • BER: Bit error rate, the frequency with which
         data is received incorrectly
          Can be in 10-9 range for simple short transmissions
4/05                                                                       AYB

          Radio Frequency Transmission:
              Modulation – OOK/ASK
       • On-Off Keying (OOK) is the most trivial of all
         modulation schemes.
       • The transmitter is turned on to full power to send 1 and
         off to send 0
           Can therefore be driven directly with a UART
           Most power efficient since transmitter is only on 50% of the
            time (on average)
       • Amplitude Shift Keying (ASK) is similar to the above,
         except the transmitter power is merely lowered for a 0
           Necessary for faster transmission
4/05                                                          AYB

          Radio Frequency Transmission:
                Modulation - BPSK
       • Binary phase shift keying (BPSK) uses a carrier
         continuously broadcast at the same amplitude
       • A 1 is indicated if there is a 180 phase shift in
         the bit window, otherwise the bit is 0
       • Allows for better carrier lock at receiver
       • We see at right that
         OOK is equivalent to
         multiplying the
         carrier by the data,
         while BPSK is XOR                                    33
4/05                                                                      AYB

                RF Channel Sharing Protocols

       •   Time Division Multiple Access (TDMA)
       •   Frequency Division Multiple Access (FDMA)
       •   Carrier Sense Multiple Access (CSMA)
       •   Frequency Hopping Spread Spectrum (FHSS)
       •   Direct Sequence Spread Spectrum (DSSS)

            Laibowitz and Paradiso, “Embedded Wireless Transceivers
           and Applications in Lightweight Wearable Platforms,” Circuit
                               Cellar, February 2004

4/05                                              AYB

         Radio Frequency Transmission:
         Channel Access – TDMA/FDMA
       • Time division multiple access
         (TDMA) divides the channel up into
         chunks of time, with a different
         transmitter for each chunk
          Requires master receiver to allocate
           chunks and keep synchronization
       • Frequency division multiple access
         (FDMA) divides the channel up into
         chunks of frequency, with a
         different transmitter for each chunk
          Master not necessarily required
4/05                                                                       AYB

       Radio Frequency Transmission:
       Channel Access – Hybrid/CSMA
   • Hybrid schemes divide the spectrum in
     both time and frequency
        Because of startup energies and guard
         zones, this can actually be more energy
         efficient, though somewhat cumbersome
   • For low duty cycle transmitters, we can avoid
     masters and complicated schemes by using
     carrier sense multiple access (CSMA)
        Listen before you talk
        Hidden node problem      Tx1               Rx               Tx2

                                        Tx2 Range        Tx1 Range         36
4/05                                                                        AYB

          Radio Frequency Transmission:
             Spread Spectrum - DSSS
       • Direct sequence spread
         spectrum (DSSS)
         expands the frequency
         range of a signal by
         modulating (xor) it
         with a much faster
         sequence known as a chip
          Chips must be orthogonal to each other
          Receiver must have same noise (chip) generator
          Processing gain is the SNR gain from the modulation and
           counteracts the SNR drop from spreading the transmitter energy
          Provides immunity to localized (in frequency) noise
4/05                                   AYB

       Radio Frequency Transmission:
         Walsh Codes (Orthogonal)

4/05                                                                AYB

        Radio Frequency Transmission:
           Spread Spectrum - FHSS
  • While DSSS spreads at greater
    than the data rate, frequency
    hopping spread spectrum
    (FHSS) spreads at a much
    lower rate
        Shifts happen ~ 10 bits (or so)
        Again, receiver must know
        Originally invented during WWII by Hedy Lamar and George
         Antheil to avoid jamming of radio-controlled torpedoes
          >   Player piano rolls used to synchronize
  • Overall, in both spread spectrum techniques, all other
    sequences appear to be noise at the receiver
4/05                                                          AYB

          Radio Frequency Transmission:
       • Low frequency unlicensed bands at 433 and 915
         MHz are often used by low power ASK devices
         (such as those from RFM)
          Can only transmit for 36 seconds each hour (1%)
       • The high frequency unlicensed bands at 2.4
         GHZ and 5.8 GHz are used by high speed spread
         spectrum devices
          Eg. Wireless LAN
       • Both bands known as ISM (industrial scientific and
4/05                                                            AYB

        Radio Frequency Transmission:
                 Usage Notes
  • RF components are enormously sensitive to:
        Placement
          >   ground plane and traces
        Power supply
  • Antenna can also have huge effect:
        Quarter-wave whip best, but large for lower
         frequencies (c=f)
        Helical antennae attenuate by 5dB, printed whip by
        Need to match impendence to transmitter output (50)
Available RF Modules
            The RFRAIN Card

• Made by Mat Laibowitz for the UbeR-Badge
• GP RF card based on the Chipcon CC1010
   Circa 70 kbps
   CSMA Scheme
4/05                                                         AYB

              The CC2500 Daughtercard

       • Made by Mat Laibowitz for the Plug and other
       • GP RF card based on the Chipcon CC2500
          Circa 500 kbps
          CSMA Scheme, but can be used with other methods
4/05                                                         AYB

           Sensor Networking Protocols:
       • Allow for easier creation of sensor networks,
         including central node which understands and
         processes the data
       • Increase user acceptance of modules by
         trivializing their setup
       • Allow for remote collaboration through
         searching protocols and shared open sensors
       • Decentralize the processing of the data to reduce
         communication costs
4/05                                                              AYB

           Sensor Networking Protocols:
       • Our previous discussion considered sensor
         modules which did not talk to each other or have
         any response more complicated than continuous
         collection, processing and transmission of data
       • Sensor networking protocols allow:
          Modules to describe their own data
          To establish clusters on the fly
          To be remotely interrogated and controlled by master
           devices over a variety of communication systems

             Some Sensor Net Architectures
•Berkeley Motes
    – Current version favors size and integration over modularity
    – Commercial Version from Crossbow (also Kris Pister’s “Blue Motes”)
    –Concentrates on ad-hoc networking application
    – Only single attachment possible to main board
    – Not mechanically strong
    – Individual boards are quite large, unsuitable for compact apps
    – Mostly a pedagogical tool.
•Millenial Net
    – MIT ME Spinoff (lower-end)
    – Media Lab Spinoff (higher-end)
 Intelligence at the Extremities
                       Star Topology
                    • Local processor detects,
                    processes or compresses
                    local features
                    • High data rates possible
                    with limited node densities
                    Wearable, medical applications

                     • Feature extraction via local
                     • Results routed out node-
Local Processor
Sensors              • Potentially scalable to very
                     high density
                     Electronic skins, sensate media
4/05                                                        AYB

           Sensor Networking Protocols:
       • IEEE 802.15 standard defines specifications for
         wireless personal-area network (PAN)
          Defined as a number of devices communicating
           solely amongst themselves in a 10m radius
          Transmission is in the 2.4 GHz band
          Master-slave protocol with automatic discovery
          TDMA or CSMA channel sharing
       • Number of sub-standards based on transmission
         speed, number of nodes, and packet size
4/05                                                                                       AYB

             Sensor Networking Protocols:
                 802.15.1 – Bluetooth
 •     Designed for cable replacement for peripherals communicating with a single master
         7 nodes with 720 kbps total bandwidth
         Overhead of 250kB
         Power can be carefully managed (battery life on week scale)
            > Max data rate of 1Mb/s and power consumption at 0.3mA in standby, 30mA
              maximum while transferring at full speed
         Some issues
            > 7 Slaves, 1 Master (although can nest subnets with shared node)
            > Takes 100’s of msec(!) to shift between nodes in Bluetooth 1
         Single-Chip manufacturers
            > Cambridge Silicon Radio ( )
            > SiliconWaves ( )
            > Zeevo ( )
         Modules
            > BlueRadios (
            > Infineon BlueMoon (
            > National Semiconductor SimplyBlue (
4/05                                                                                                AYB

          Sensor Networking Protocols:
               802.15.4 – Zigbee
 • Designed for monitoring of large network of very low duty
   cycle sensors
     255 nodes with 200 kbps total bandwidth
     Overhead of 32kB
     Battery life on year scale
     Motorola NeuRFon Series of single-chip Zigbee transceivers
       > Coming out soon (maybe)
     Zigbee System-On-Chip
          >   Chipcon CC2431
          >   Ember EM250
"Using Low-Cost Low-Power Wireless Sensor Devices to Monitor the Health of Structures", Anthony Allen,
  Ralph D'Souze, Oleg Andric, Minh Pham, Wayne Chiou, and Lance Hester (Motorola), 4th International
               Workshop on Structural Health Monitoring, Stanford CA, September 2003.                51
4/05                                                             AYB

           Sensor Networking Protocols:
                IEEE 1451 - Goals
       • Develop network independent and vendor independent
         transducer interfaces.
       • Allow transducers to be replaced/moved with minimum
       • Eliminate error prone, manual system configuration
       • Support a general transducer data, control, timing,
         configuration and calibration model.
       • Develop Transducer Electronic Data Sheets that remain
         together with the transducer during normal operation.
4/05                                                        AYB

            Sensor Networking Protocols:
                IEEE 1451 - Standard
       • IEEE 1451 is actually a family of standards
         which define various portions of the interface
         between sensor modules and a network
        X.1: Define NCAP block
         to isolate sensing and
        X.2: Define TEDS to store
         data about sensor with
        X.3: Define multidrop bus
         protocol for sensors
        X.4: Separate TEDS and data source/communication   53
4/05                                          AYB

           Sensor Networking Protocols:
                IEEE 1451 - TEDS
       • Transducer Electronic Data
         Sheets (TEDS) allow for
         sensors to contain their own
         calibration data and other
         fundamental characteristics
          Number of different templates
          Simplifies integration of sensor
           into larger system and
           replacement if necessary
          Standardizes interface
4/05                                                                      AYB

              Sensor Networking Protocols:
       • Sensor Model Language (SensorML) is an XML based
         description language for web-resident devices
       • These devices are self-describing and provide
         information necessary for discovery, processing, and
         location of sensor observations
       • System allows for:
             Search and discovery of available public sensors
             Dynamic request and fusion of data from disparate sources
             Control and handling of remote data sources
             Direct transmission of data and processing information to
              remote sites
4/05                                                     AYB

           Sensor Networking Protocols:
               SensorML - Format
       • The SensorML format allow sensor to identify
         themselves, give their security limitations,
         describe their measurements and specify their

4/05                                                      AYB

           Sensor Networking Protocols:
       • Controller Area Network (CAN) was designed
         for automotive use to enable robust serial
         communications while simplifying wiring
       • Nodes share a common bus (using CSMA) and
         can send messages:
          Only on sensor/device failure
          Continuously to update parameters
          When instructed by master or another node
       • Message format is fairly complex, but system
         could be useful if integrated with sensors and
         processor of interest