SLAAE30 July   2021 MSP430FR2355

 

  1.   Abstract
  2.   Trademarks
  3. 1PIR Design Description
    1. 1.1 PIR Sensor
    2. 1.2 PIR Signal Chain
      1. 1.2.1 Traditional Motion Detection Signal Chain Design
      2. 1.2.2 Capacitor-Free Signal Chain Design
  4. 2Software
    1. 2.1 Software Architecture
    2. 2.2 Software Flow Chart
    3. 2.3 Power Profile
    4. 2.4 Data Processing
      1. 2.4.1 Digital Signal Conditioning
      2. 2.4.2 Low-Pass Filter for Temperature Drift
      3. 2.4.3 Spikes and Noise
      4. 2.4.4 Motion Detection Function
  5. 3Hardware and Schematic
    1. 3.1 MSP430FR2355
    2. 3.2 Schematic
  6. 4Results
    1. 4.1 Distance: 15 ft (4.5 m)
    2. 4.2 Distance: 22.5 ft (6.9 m)
    3. 4.3 Distance: 36.5 ft (11.1 m)
  7. 5Summary
  8. 6References

PIR Sensor

There are several different types of sensors that can be used to detect basic motion, but the most common solution for the last decade has probably been using PIR sensors. PIR sensors are based on Wien’s displacement law, which states that black-body radiation curve for different temperature will peak at different wavelengths that are inversely proportional to the temperature. Basically, if you monitor the infrared spectrum, objects of different temperature will radiate different levels of energy. Figure 1-1 shows what you see in images taken with infrared camera.

GUID-3B798EE4-A238-4A7E-AFB2-1A46ACF13775-low.png Figure 1-1 Infrared Photos

PIR motion detectors are passive sensors that used to detect general motion of people or animals. Instead of all the pixels seen in the IR images above, the PIR motion detectors typically generally only have only two sensing elements, as seen in Figure 1-2. These two sensing elements will be physically offset from each other, giving each of them slightly different fields of view (FOV). Each sensor will respond to general changes in temperature in its FOV. Only two sensors may sound limiting, but analyzing the combined signal from both sensor elements can provide a decent amount of information to be captured.

GUID-84551956-1A3E-4693-B89A-CE39F3632DD8-low.png Figure 1-2 PIR Motion Sensor Illustration

As a person moves across both fields of view, the sensor will output a wave form from the sensing elements as the person passes from one sensor elements FOV through the next one. This waveform can be seen in Figure 1-3. As seen in Figure 1-3(a), The direction of this signal can tell us the direction of motion. In Figure 1-3(b). The amplitude of the signal can indicate the distance of the object or possibly the size of the individual/animal. Finally, in 3C, the speed of motion will also affect the speed of the waveform seen. In a given hallway, a walking person will have a different signature than a running person. An adult will have a different signature than that of a child or pet.

GUID-39A57C84-641E-4E0E-B852-F2FE59BFA7A6-low.png Figure 1-3 PIR Sensor Output Signal

There are usually two main specifications that are chosen when designing a motion detector for a specific application, maximum range and minimum motion speed. Generally, PIR motion detectors try to detect up to 10-12 meters and the motion frequency range is usually .7 Hz to 30 Hz. The exact performance needed for the application will affect how sensitive the system will need to be, from signal conditioning but also in software thresholding. The further away you want to monitor, the smaller the amplitude of the signals and the lower the signal to noise ratio. Typical signal levels at the output of a PIR sensor are in the micro-volt range for motion of distant objects, so it is necessary to amplify and filter the signal. The lower the minimum speed, the harder it will be to slowly slip past the monitor but the system will be more susceptible it to false triggers from environmental variation.

False detections are very undesirable, especially in battery powered applications. Typically the PIR Motion detection is monitoring while an application is in a low power mode. False detections will wake the rest of the system or trigger false alarms. This risk vs the sensitivity stated above must be weighed when designing a system. Traditionally a PIR’s signal chain was designed with a specific use case in mind and designed with a fixed gain and bandwith in hardware, which means it had a fixed detection distance and speed. Fortunately, using the MSP430FR2355 with integrated SACs, the signal chain can actually be configured via software offering much greater flexibility without changing anything in hardware.

Finally, there are both analog and digital PIR sensors on the market. The digital sensors have the signal chain and detection algorithms integrated in them. They are easier to integrate into applications, but usually come with a significant added cost that makes them unsuitable for low cost applications. This document focuses on analog PIR sensors as they reduce overall system cost and can easily be integrated with the built-in SAC signal chain.