SLAA351A April   2007  – November 2018 MSP430F2232 , MSP430F2232 , MSP430F2234 , MSP430F2234 , MSP430F2252 , MSP430F2252 , MSP430F2254 , MSP430F2254 , MSP430F2272 , MSP430F2272 , MSP430F2274 , MSP430F2274

 

  1.   A Simple Glass-Breakage Detector Using an MSP430™ MCU
    1.     Trademarks
    2. 1 Introduction
    3. 2 Hardware Description
      1. 2.1 Device Specifications
      2. 2.2 Power Supply
      3. 2.3 Microphone
      4. 2.4 LED and Buzzer Alert
      5. 2.5 Interface to CC1100 or CC2500 Devices
      6. 2.6 Operational Amplifiers (OAs)
      7. 2.7 Internal Very-Low-Power Oscillator (VLO)
      8. 2.8 JTAG Interface
      9. 2.9 Current Consumption
    4. 3 Software Description
      1. 3.1 Initialization Routine
      2. 3.2 Timer_A
      3. 3.3 ADC10
      4. 3.4 Signal Analysis
        1. 3.4.1 First Stage of Processing
          1. 3.4.1.1 Signal Averaging, Peak Detection, and Zero Crossings
          2. 3.4.1.2 High-Pass Filtering
        2. 3.4.2 Second Stage of Processing
          1. 3.4.2.1 Frequency Composition Ratio
          2. 3.4.2.2 Peak and Zero-Crossing Count
          3. 3.4.2.3 Glass-Breakage Detect
    5. 4 Hardware Schematic
    6. 5 Test Setup
    7. 6 References
  2.   Revision History

Frequency Composition Ratio

During the first stage of processing, the incoming signal was accumulated for the entire period of 60 ms. This is termed "Signal integration" in Figure 8. Also, the filtered signal (i.e., the output of the LWDF) was correspondingly accumulated. This was termed "Filtered signal integration" in Figure 8. A ratio of these accumulated values compared to a fixed threshold is done in the detection of a glass breakage. To obtain a ratio of these runtime values, integer-integer division must be performed. An optimized 16-bit integer division routine has been implemented to do this.[6] The routine is separated into two parts: one that calculates the integer part of the quotient and one that calculates the fractional. To calculate the approximate fractional part, the divisor is simply divided by four and the result subtracted from the remainder of the integer. A counter is used to store how many times one-fourth of the divider fits into the remainder, thus calculating an approximation of the fractional part in increments of 0.25. If the ratio of the "Signal integration" to the "Filtered Signal integration" fails to fall in the range of 1.75 to 7, a false flag is set, halting further processing. These fixed threshold values vary with different types of glass, and it is left to the end users to set these thresholds based on the spectrum analysis of their glass-breakage signal.