AN-000214

Chirp Microsystems
Ultrasonic Presence Detection
App Note

Chirp Microsystems reserves the right to change
specifications and information herein without notice.

Chirp Microsystems
2560 Ninth Street, Ste 200, Berkeley, CA 94710 U.S.A+1(510) 640–8155
www.chirpmicro.com

Document Number: AN-000214
Revision: 1.0
Release Date: 05/22/2020

AN-000214
Table of Contents
1

Scope and Purpose............................................................................................................................................................................. 3
1.1
1.2

Technology ................................................................................................................................................................................. 3
Benefits Over PIR ....................................................................................................................................................................... 3

2

Presence Detection Applications ....................................................................................................................................................... 4

3

Algorithm Overview ........................................................................................................................................................................... 5
3.1
3.2
3.3

4

I/Q Data and Amplitude ............................................................................................................................................................. 5
Presence Detection Library ........................................................................................................................................................ 6
Static target rejection Firmware ................................................................................................................................................ 6

Sensor configuration and positioning ................................................................................................................................................ 7
4.1
Parameter Configuration ........................................................................................................................................................... 7
Presence Detection Library ................................................................................................................................................................ 7
Static Target Rejection ....................................................................................................................................................................... 7
4.2
Horn Design Considerations....................................................................................................................................................... 7
Symmetrical 45° FoV Horn: AH-20166-045045 .................................................................................................................................. 8
Asymmetrical 160°x50° (HxV) FoV Horn: AH-20129-160050 ............................................................................................................. 8
4.3
Sensor Positions ......................................................................................................................................................................... 95

Performance .................................................................................................................................................................................... 10
5.1
Nema standard......................................................................................................................................................................... 10
Test Environment ............................................................................................................................................................................. 10
Major Motion ................................................................................................................................................................................... 10
Minor Motion................................................................................................................................................................................... 10
5.2
Detection Performance ............................................................................................................................................................ 10
Grid Coverage .................................................................................................................................................................................. 11
False Positives .................................................................................................................................................................................. 11
Presence Detection Library Performance ........................................................................................................................................ 11
Static Target Rejection Firmware Performance ............................................................................................................................... 13
5.3
Power Supply Current Consumption........................................................................................................................................ 14
5.4
Latency ..................................................................................................................................................................................... 15

6

Conclusion ........................................................................................................................................................................................ 16

7

Revision History ............................................................................................................................................................................... 17

Document Number: AN-000214
Revision: 1.0

Page 2 of 17

AN-000214
1 SCOPE AND PURPOSE
Presence and motion detectors are electrical devices that use sensors to detect nearby motion. Such devices are often integrated assystem components that automatically generate alerts when motion is detected in an area. These detectors are vital components of
security and surveillance systems, automated lighting control, energy efficient systems, and other management systems. They canalso enhance public and home safety by automatically triggering smart locks, smart doorbells, and other home and building
automation systems.

1.1

TECHNOLOGYThe Chirp CH201 long-range ultrasonic sensor has numerous advantages over other types of presence and motion sensors. It transmits
ultrasonic sound waves at frequencies that are above the human range of hearing, typically 85 kHz, and listens to the reflecting echoes.
The “Time of Flight” (ToF) of the ultrasonic echo is converted into a range measurement. Human motion in the space changes thepattern of the echoes, thus the motion will be detected. The CH201 contains a MEMS (micro-electromechanical systems) ultrasonictransducer to transmit and receive ultrasound, and an ASIC (application specific integrated circuit) to provide digital IO and to control
the MEMS device. The CH201 is an ultra-low power sensor and is not sensitive to ambient lighting conditions. The CH201 ultrasonicsensing technology provides highly accurate small-motion detection. The CH201 is extremely small, only 3.5 mm x 3.5 mm x 1.26 mm.

1.2

BENEFITS OVER PIR

Today, passive infrared (PIR) sensors are widely used to detect people indoors. However, PIR sensors have several weaknesses: thelens integration makes them physically large, they typically are made up of multiple higher power components, and they are sensitive
to heat and light sources (see Figure 1). The placement of PIR sensors is constrained to avoid heat and light sources. PIR sensors cannot
report range information, only moving objects can be detected, and PIR sensors are often not sensitive to minor motion.

Figure 1. Left: PIR sensors detect motion from zone-to-zone (indicated by colored bands) and cannot detect minor motion within a zone. Right:
PIR sensors are sensitive to heat and light sources so they must be placed in areas away from heaters, direct sunlight, and lamps.

Document Number: AN-000214
Revision: 1.0

Page 3 of 17

AN-000214
2 PRESENCE DETECTION APPLICATIONS
Chirp Presence solutions can be used in various always-on applications:
•
•
•
•
•

Smart locks
Smart doorbells
Room occupancy detectors
Motion detectors of security and surveillance systems
Home and Building automation and IoT equipment

Document Number: AN-000214
Revision: 1.0

Page 4 of 17

AN-000214
3 ALGORITHM OVERVIEW
Chirp provides two presence sensing algorithms that can be used in different scenarios: Presence Detection and Static Target Rejection(also known by its acronym, STR). Each algorithm has specific strengths. The STR algorithm has lower power and latency compared tothe presence algorithm, while the presence algorithm has very low false positives in various environments. STR can detect humanpresence to a maximum range of 3m, whereas the Presence Detection algorithm can detect human presence at ranges up to 4m. The
STR algorithm is provided as a firmware binary that runs on the CH201’s ASIC, while the Presence Detection algorithm is provided asa library that is executed on a sensor hub processor. This enables the Output data rate (ODR) of STR to be higher than the Presence
Detection algorithm. Table 1 summarizes the differences of these two presence sensing algorithms.
The presence detection algorithm can be found on the Chirp Microsystems website. The presence detection library can be compiled
and run on a user’s MCU as well as on the SmartSonic development kit board. Chirp Microsystems’ M0 Module Reference Design
implements the presence detection algorithm. For more details, please reference AN-000226 M0 Module Reference Design Users
Guide. For information on the SmartSonic development kit implementation, please reference AN-000227 SmartSonic
PresenceDetection Users Guide.
The STR algorithm is an embedded firmware binary file that runs on the CH201 sensor. The associated software package with release
notes, “smartsonic-str-example,” is available on the Chirp Microsystems website.
The table below summarizes the differences of these two presence sensing algorithms.

MAXIMUM RANGELATENCYPOWER
FALSE POSITIVESODR (HZ)PRESENCE DETECTION LIBRARYSTR FIRMWARE

Up to 4m
higherhigherlow
1, 2, 5 and 10

Up to 3m
lower
lower
higher1 to 40

Table 1. Comparison between the Presence Detection library and the STR firmware

3.1

I/Q DATA AND AMPLITUDE

Both algorithms use returning ultrasonic ToF data to detect human motion. The ToF data, referred to as an Amplitude-Scan (A-Scan),contains the time-of-flight and amplitude of each returning echo. A reflecting object will send back a high amplitude echo signal to thesensor (an example A-Scan is shown in Figure 2). The A-Scan data from the sensor can be read by an external host system via the I²C
connection. This data describes the (up to) 300 samples that make up a full A-Scan measurement cycle. Each individual sample isreported as a pair of values, I and Q, in a quadrature format.
To convert any given I/Q pair to the amplitude of that sample, square both I and Q, and take the square root of the sum:

Amplitude = √(𝐼𝐼 2 + 𝑄𝑄2 )Amplitude values in the CH201 are expressed only in internal ADC counts (least-significant bits, LSBs) and are not calibrated to any
standard units.
Each sample I/Q pair consists of two signed 16-bit integers. So, a complete CH201 A-Scan will contain up to 1200 bytes of data (300
samples x 4 bytes per sample). When the I/Q data is read from the sensor, the additional time required to transfer the I/Q data overthe I²C bus must be taken into account when planning how often the sensor can be read (output data rate, ODR).
Note: A complete CH201 A-Scan of Static Target Rejection (STR) firmware contains 1160 bytes of data (290 samples x 4 bytes per sample).

Document Number: AN-000214
Revision: 1.0

Page 5 of 17

AN-000214
Received echo

d2

700

Reflecting
objects

CH-201

600

500

d3
amplitude

400

d1

300

200

100

0
0

100

200

300

400

500

600

range in cm

Figure 2. A reflecting object will send back a high amplitude signal to the sensor.
Left: sensor with three targets at different distances; Right: A-Scan plot showing the three echoes and their corresponding time-of-flight ranges.

3.2

PRESENCE DETECTION LIBRARY

The presence detection algorithm is provided in a library that runs on processor external to the ultrasonic sensor. The first step of thepresence algorithm is to use a high-pass filter to ignore the echoes from static objects to extract motion. Detection is adjusted
automatically and adapts to a changing environment.

Figure 3. Block diagram of Presence detection algorithm

3.3

STATIC TARGET REJECTION FIRMWARE

STR is an algorithm that is provided in a firmware binary that runs on the CH201 sensor and ignores static objects when determining
the range to the nearest moving target. The algorithm works by calculating the running time-average (first order infinite impulse
response (IIR) filter) of the echo amplitude returned from each distance. A configurable threshold value is added to the running average
and used as a detection threshold. When the user approaches, the running average does not change fast enough to cover the echo of
the user, and the user will be detected.

Document Number: AN-000214
Revision: 1.0

Page 6 of 17

AN-000214
4 SENSOR CONFIGURATION AND POSITIONING
4.1

PARAMETER CONFIGURATION

There are 3 configuration parameters for each algorithm.

Presence Detection Library
Output data rate (ODR):Defines the sampling rate in Hz. Possible values are 1, 2, 5 and 10 Hz. A higher ODR results in lower latency but increases power
consumption.
Maximum range:
Sets the maximum range for the presence sensing feature to detect human motion. It can be any value in the range of 100 to 400 cm.
Reducing the range will decrease power consumption.
Sensitivity:
Defines the sensitivity of the motion detection. Increasing the sensitivity level will increase the detection probability (true positiverate); however, setting the sensitivity too high will result in a high number of false positive detections. The sensitivity value is an integer
from 0 to 8, where 8 is the highest sensitivity. The default sensitivity value is 4.

Static Target Rejection
Output data rate (ODR):Defines the sampling rate in Hz. Possible values range from 1 to 40 Hz. As STR is an on-chip sensor algorithm, there is no transfer of
the I/Q data over the I²C bus. Therefore, the ODR can be higher than when using the presence algorithm. A higher ODR results in lower
latency but increases power consumption.
Maximum range:
Sets the maximum range for the presence sensing feature to detect human motion. It can be any value in the range of 100 to 300 cm.
Reducing the range will decrease power consumption.
Threshold:Defines the detection threshold of STR, which is the amount added to the running average of the echo amplitude. By changing thethreshold, a user can tune the balance between true positives and false positives: lowering the threshold will increase the true positive
rate but setting the threshold too low will result in a high number of false positive detections. The threshold value is an integer in LSBs
from 50 to 1000. 50 is very sensitive and 1000 is less sensitive. The default threshold value is 100.
For more information about adjusting parameter and detection performance, please refer to Section 5.2 Detection Performance.

4.2

HORN DESIGN CONSIDERATIONS

For the presence detection evaluation results reported in this document, Chirp used two types of horns: a 45° FoV symmetrical horn,
AH-20166-045045, and an asymmetrical 160° by 50° (horizontal x vertical) FoV horn, AH-20129-160050. The AH-20166-045045 horn
is good for applications using both the presence and the STR algorithm. The AH-20129-160050 horn is good for applications using
the presence algorithm.
Product briefs and associated CAD design files of other horn designs are available on Chirp’s website. For assembly guideline, pleasereference AN-000221 CH201 Mechanical Integration Guide.

Document Number: AN-000214
Revision: 1.0

Page 7 of 17

AN-000214
Symmetrical 45° FoV Horn: AH-20166-045045
DESIGN

AH-20166-045045

DIAMETER (MM)VERTICALHORIZONTAL

66

LENGTH(MM)
2.9

FIELD OF VIEW (FOV)VERTICALHORIZONTAL

45°

45°

Table 2. AH-20166-045045 properties

Figure 4. Illustration of AH-20166-045045 3-D printed horn.

Figure 5. Measured beam pattern for AH-20166-045045

Asymmetrical 160°x50° (HxV) FoV Horn: AH-20129-160050
DESIGN

AH-20129-160050

DIAMETER (MM)VERTICAL
9HORIZONTAL
2

LENGTH (MM)5

Table 3. AH-20129-160050 properties

Document Number: AN-000214
Revision: 1.0

Page 8 of 17

FIELD OF VIEW (FOV)VERTICAL
50°

HORIZONTAL
160°

AN-000214

Figure 6. Illustration of AH-20129-160050 3-D printed horn.

The AH-20129-160050 horn has 40% less on axis intensity compared to AH-20166-045045 horn. Its vertical axis FoV is 50° andhorizontal FoV is 160° which makes it suitable for the applications where it is desired to detect objects over a wide horizontal field-ofview while reducing sensitivity to objects that are below the plane of the sensor (such as pets). AH-20129-160050 horn covers larger
area/volume compared to AH-20166-045045 horn in the horizontal axis, therefore it has lower on-axis intensity. Figure 7 is a plot of
measured data for CH201 with AH-20129-160050 FoV in vertical and horizontal axis.

Figure 7. Measured beam pattern for AH-20129-160050.
Left plot illustrates the vertical beam pattern; right plot illustrates the horizontal beam pattern.

4.3

SENSOR POSITIONSThere is no special restriction for either presence sensing solution. Users may choose positions that are best suited for theirapplications.

Document Number: AN-000214
Revision: 1.0

Page 9 of 17

AN-000214
5 PERFORMANCE
The presence detection algorithm was evaluated on M0 module reference board, and the STR algorithm was evaluated on the
SmartSonic development kit platform.

5.1

NEMA STANDARD

The performance of the presence and the STR algorithms is verified to the NEMA standard publication WD 7-2011 (R2016). The NEMA
standard publication covers the definition and measurement of field of view (FoV) and coverage characteristics relevant to the use
and application of vacancy and occupancy sensors using individual or any combination of passive infrared, ultrasonic, or microwave
technology. These sensors are used in systems for control of lighting, heating, ventilating, and air conditioning (HVAC), and many
home/building automation equipment.

Test Environment••••

The room is divided into a square grid with cell dimensions of 1m × 1m (3 ft × 3 ft).
The room is larger than the test area such that the tester can walk into the FOV of the sensor.
The temperature of the room is maintained at 70 ±5°F throughout the test and is measured at the sensor.
The standard method tests the sensor in a room that is slightly greater in size than the specified coverage area of the sensor.
If the coverage area exceeds the size of the test room, an alternate test method may be followed. The alternate method shalltest one half of the field of view, then, by re-positioning the sensor, test the other half of the field of view.

Major Motion••••

The person is moving at a velocity of 4 ±0.5 ft./s
The test person methodically walks in the direction parallel to the x-axis or parallel to the y-axis, or both, at the test velocity.
The test person starts from a point outside the coverage area at the center of the outer edge of the first cell.
The test person walks from cell to cell with a 2s stop at the edge of each cell. If either of the movements parallel to the x-axis
or parallel to the y-axis is detected by the sensor being tested, the test is positive for this cell. If the result is positive, the cellis crosshatched on the template drawing. If the result is not positive, the cell is left open on the template drawing.

Minor Motion
Minor motion is tested using a robotic arm with dimensions 3 in. × 3 in. × 15 in., mounted at a height of 36 ±1 in. above the ground.
The arm moves at a velocity of 90°/s.

Figure 8. Setup of minor motion tests

5.2

DETECTION PERFORMANCEThis section discusses the grid coverage and false positives of the presence and the STR algorithms.
Document Number: AN-000214
Revision: 1.0

Page 10 of 17

AN-000214
Grid Coverage
The test follows NEMA standard and has been run on several sensors in the same conditions. The sensors are at (0,0) coordinates on
the grid. A value of x/y indicates that x sensors out of y total units pass the test (see Figure 9).
Major Motion

Figure 9. Example of major motion grid coverage (subset of Figure 10)

False Positives
Static records of empty closed rooms were recorded for 21 hours to observe false positives.
Note: The false positive rate was recorded for 21 hours, averaged and scaled for 24 hours. The NEMA standard does not specify any methodology fortesting false positives.

Presence Detection Library Performance
The algorithm has a sensitivity parameter to adjust the balance between the grid coverage and false positive rate. The following figures(Figure 10 to Figure 13) and Table 4 show the effects of the sensitivity on the performances at 4m maximum range. The NEMA gridswith sensitivity value set to 4 show good detection rates with 0 false positives; the NEMA grids with sensitivity value set to 8
demonstrate a better detection rate at the cost of few false positives.
FALSE POSITIVES PER 24 HOURSSENSITIVITY

AH-20166-045045

AH-20129-160050

4

0

0

8

7.5

4.2

Table 4. False positives per 24 hours at different sensitivity settings with the symmetrical 45 FoV horn (AH-20166-045045) and asymmetrical 160
FoV by 50 FoV horn (AH-20129-160050) at 4m

Document Number: AN-000214
Revision: 1.0

Page 11 of 17

AN-000214
Minor Motion

Major Motion

0 False positive/24 hours
Figure 10. Grid of detection with symmetrical 45 FoV horn (AH-20166-045045). Sensitivity is set to 4.
Major Motion

Minor Motion

7.5 False positives/24 hours
Figure 11. Grid of detection with symmetrical 45 FoV horn (AH-20166-045045) and maximum sensitivity 8
Major Motion

Minor Motion

0 False positive/24 hours
Figure 12. Grid of detection with asymmetrical 160 FoV by 50 FoV horn (AH-20129-160050). Sensitivity is set to 4.

Document Number: AN-000214
Revision: 1.0

Page 12 of 17

AN-000214
Minor Motion

Major Motion

4.2 False positives/24 hours
Figure 13. Grid of detection with asymmetrical 160 FoV by 50 FoV horn (AH-20129-160050) and maximum sensitivity 8

Static Target Rejection Firmware Performance
The STR algorithm has a threshold parameter to adjust the balance between the grid coverage and false positive rate. The following
figures (Figure 14 to Figure 17) and Table 4 show the effect of the threshold on the performances at 3m and 2m maximum range,
respectively. For example, at 2m maximum range, the NEMA grids with threshold value set to 75 show a good detection with 0 false
positives; the NEMA grids with threshold value set to 50 show a better detection at the cost of 27 false positives per 24 hours.
Threshold (LSBs)

False positives/24h

75

5

125

0
(a)

Threshold (LSBs)

False positives/24h

50

27

75

0
(b)

Table 5. False positives per 24 hours at different threshold settings with symmetrical 45 FoV horn (AH-20166-045045) at (a) 3m and (b)2m
Minor Motion

Major Motion

0 False positive/24 hours
Figure 14. Grid of detection with symmetrical 45 FoV horn (AH-20166-045045) and threshold 125 at 3m

Document Number: AN-000214
Revision: 1.0

Page 13 of 17

AN-000214
Major Motion

Minor Motion

5 False positives/24 hours
Figure 15. Grid of detection with symmetrical 45 FoV horn (AH-20166-045045) and threshold 75 at 3m

Major Motion

Minor Motion

0 False positive/24 hours
Figure 16. Grid of detection with symmetrical 45 FoV horn (AH-20166-045045) and threshold 75 at 2m

Major Motion

Minor Motion

27 False positives/24 hours
Figure 17. Grid of detection with symmetrical 45 FoV horn (AH-20166-045045) and threshold 50 at 2m

5.3

POWER SUPPLY CURRENT CONSUMPTION

Table 6 shows the 1.8V power supply current of the presence and the STR algorithms. The supply current of the presence algorithm
has been computed for various output data rates, with maximum range 400 cm and sensitivity parameter 4. The supply current of theCH201 sensor using the STR firmware has been computed for various output data rate, with threshold parameter 100 and maximum
range of 300 cm and 200 cm, respectively.
Document Number: AN-000214
Revision: 1.0

Page 14 of 17

AN-000214
CURRENT CONSUMPTION (MA)OUTPUT DATA RATE (HZ)

PRESENCE LIBRARYSTR FIRMWARE

400 CM

300 CM

200 CM

10

0.245

0.065

0.046

5

0.145

0.034

0.025

2
1

0.086
0.048*

0.017
0.012

0.014
0.010

Table 6. Power supply current consumption versus range and ODR of the presence and the STR algorithms
Note: Numbers in italics are estimated.

5.4

LATENCY

The detection latency of the presence algorithm and STR (Table 7) have been computed with minor motion for various output data
rates.
OUTPUT DATA RATE (HZ)

LATENCY (S)PRESENCE LIBRARYSTR FIRMWARE

10

0.48

0.1*

5

1.30

0.2*

2

2.05

0.5*

1

5.15

1.0*

Table 7. The latency of Presence detection and STR
Note: Numbers in italics are estimated.

Document Number: AN-000214
Revision: 1.0

Page 15 of 17

AN-000214
6 CONCLUSION
Chirp provides two presence sensing algorithms for presence and motion detectors, each with its own strengths. The STR algorithm
has lower power consumption, lower detection latency, but has a reduced range compared to the presence algorithm. While thepresence algorithm has a greater detection range. Depending on the application requirements and usage case, either or bothalgorithms can provide good performance with benefits over PIR sensors: reduced size, eliminated lens integration complexity, no
sensitivity to heat and light sources, greater sensitivity to minor motion and providing range information.

Document Number: AN-000214
Revision: 1.0

Page 16 of 17

AN-000214
7 REVISION HISTORYREVISION DATE
5/22/2020

REVISION
1.0

DESCRIPTION
Initial Release

This information furnished by Chirp Microsystems, Inc. (“Chirp Microsystems”) is believed to be accurate and reliable. However, no responsibility is assumed by Chirp
Microsystems for its use, or for any infringements of patents or other rights of third parties that may result from its use. Specifications are subject to change without
notice. Chirp Microsystems reserves the right to make changes to this product, including its circuits and software, in order to improve its design and/or performance,
without prior notice. Chirp Microsystems makes no warranties, neither expressed nor implied, regarding the information and specifications contained in this document.
Chirp Microsystems assumes no responsibility for any claims or damages arising from information contained in this document, or from the use of products and services
detailed therein. This includes, but is not limited to, claims or damages based on the infringement of patents, copyrights, mask work and/or other intellectual property
rights.
Certain intellectual property owned by Chirp Microsystems and described in this document is patent protected. No license is granted by implication or otherwise under
any patent or patent rights of Chirp Microsystems. This publication supersedes and replaces all information previously supplied. Trademarks that are registeredtrademarks are the property of their respective companies. Chirp Microsystems sensors should not be used or sold in the development, storage, production or utilizationof any conventional or mass-destructive weapons or for any other weapons or life threatening applications, as well as in any other life critical applications such as
medical equipment, transportation, aerospace and nuclear instruments, undersea equipment, power plant equipment, disaster prevention and crime prevention
equipment.
©2020 Chirp Microsystems. All rights reserved. Chirp Microsystems and the Chirp Microsystems logo are trademarks of Chirp Microsystems, Inc. The TDK logo is atrademark of TDK Corporation. Other company and product names may be trademarks of the respective companies with which they are associated.

©2020 Chirp Microsystems. All rights reserved.

Document Number: AN-000214
Revision: 1.0

Page 17 of 17