acconeer a121-v1.3.0 Presence Detector User Guide
- June 1, 2024
- acconeer
Table of Contents
acconeer a121-v1.3.0 Presence Detector
Product Information
Specifications:
- Product Name: I2C Presence Detector
- Manufacturer: Acconeer AB
- Version: a121-v1.3.0
- Date: October 6, 2023
FAQs
- Q: How to troubleshoot if the detector is not responding?
A: If the detector is not responding, try the following steps:
1. Check the connections.
2. Verify power supply.
3. Refer to the troubleshooting section in the user manual.
- Q: Can the detector be used outdoors?
A: The detector is designed for indoor use only and may not function correctly outdoors due to environmental factors.
Acconeer SDK Documentation Overview
To better understand what SDK document to use, a summary of the documents are shown in the table below.
Table 1: SDK document overview.
Name | Description | When to use |
---|
RSS API documentation (html)
rss api| The complete C API documentation.| – RSS application implementation
– Understanding RSS API functions
User guides (PDF)
A121 Assembly Test| Describes the Acconeer assembly test functionality.| –
Bring-up of HW/SW – Production test implementation
A121 Breathing Reference Application| Describes the functionality of the
Breathing Reference Application.| – Working with the Breathing Reference
Application
A121 Distance Detector| Describes usage and algorithms of the Distance
Detector.| – Working with the Distance Detector
A121 SW Integration| Describes how to implement each integration function
needed to use the Acconeer sensor.| – SW implementation of custom HW
integration
A121 Presence Detector| Describes usage and algorithms of the Presence
Detector.| – Working with the Presence Detector
A121 Smart Presence Reference Application| Describes the functionality of the
Smart Presence Reference Application.| – Working with the Smart Presence
Reference Application
A121 Sparse IQ Service| Describes usage of the Sparse IQ Service.| – Working
with the Sparse IQ Service
A121 Tank Level Reference Application| Describes the functionality of the Tank
Level Reference Application.| – Working with the Tank Level Reference
Application
A121 STM32CubeIDE| Describes the flow of taking an Acconeer SDK and integrate
into STM32CubeIDE.| – Using STM32CubeIDE
A121 Raspberry Pi Software| Describes how to develop for Raspberry Pi.| –
Working with Raspberry Pi
A121 Ripple| Describes how to develop for Ripple.| – Working with Ripple on
Raspberry Pi
XM125 Software| Describes how to develop for XM125.| – Working with XM125
I2C Distance Detector| Describes the functionality of the I2C Distance
Detector Application.| – Working with the I2C Distance Detector Application
I2C Presence Detector| Describes the functionality of the I2C Presence
Detector Application.| – Working with the I2C Presence Detector Application
Handbook (PDF)
Handbook| Describes different aspects of the Acconeer offer, for example radar
principles and how to configure| – To understand the Acconeer sensor
– Use case evaluation
Readme (txt)
[README| Various target specific information and links| – After SDK download
I2C Presence Detector Application
The I2C Presence Detector is an application that implements the Acconeer Presence Detector with a register based I2C interface.
The functionality of the presence detector is described in A121 Presence
Detector User Guide.pdf or in Acconeer Docs.
Note: Some of the registers like start and end have a different unit in
the I2C Presence Detector, millimeters instead of meters, to make it easier to
handle the register values as integers.
Usage
The module must be ready before the host starts I2C communication.
- The module will enter ready state by following this procedure.
- Set WAKE UP pin of the module HIGH.
- Wait for module to be ready, this is indicated by the MCU INT pin being HIGH.
- Start I2C communication.
- The module will enter a low power state by following this procedure.
- Wait for module to be ready, this is indicated by the MCU INT pin being HIGH.
- Set the WAKE UP pin of the module LOW.
- Wait for ready signal, the MCU INT pin, to become LOW.
-
Read Detector Status
The status of the module can be acquired by reading the Detector Status register, The most important bits are the Busy and Error bits.
The Busy bit must not be set when a new command is written. If any of the Error bits are set the module will not accept any commands except the RESET MODULE command. -
Writing a command
A command is written to the Command register. When a command is written the Busy bit in the Detector Status register is set and it will be cleared automatically when the command has finished. -
Setup and Start Detector
Before the module can perform presence detection it must be configured. The following steps is an example of how this can be achieved.
Note: The configuration parameters can not be changed after a APPLY CONFIGURATION command. If reconfiguration is needed the module must be restarted by writing RESET MODULE to the Command register.- Power on module
- Read Detector Status register and verify that neither Busy nor Error bits are set.
- Write configuration to configuration registers, for example Start register and End register.
- Write APPLY CONFIGURATION to Command register.
- Poll Detector Status until Busy bit is cleared.
- Verify that no Error bits are set in the Detector Status register.
- Write START DETECTOR to Command register.
- Poll Detector Status until Busy bit is cleared.
- Verify that no Error bits are set in the Detector Status register.
- Read Detector Result register
- If PRESENCE DETECTED is set presence is currently detected.
- If PRESENCE DETECTED STICKY is set presence has been detected since last read.
- If DETECTOR ERROR is set an error has occurred, restart module with the RESET MODULE command.
- If presence was detected, the presence distance can be read in the Presence Distance register.
-
Stop and Restart Detector
The detector can be stopped and restarted.- The following steps is an example of how to stop the detector.
- Read Detector Status register and verify that neither Busy nor Error bits are set.
- Write STOP DETECTOR to Command register.
- Poll Detector Status until Busy bit is cleared.
- Verify that no Error bits are set in the Detector Status register.
- The following steps is an example of how to re-start the detector.
- Read Detector Status register and verify that neither Busy nor Error bits are set.
- Write START DETECTOR to Command register.
- Poll Detector Status until Busy bit is cleared.
- Verify that no Error bits are set in the Detector Status register.
Advanced Usage
-
Debug UART logs
UART logging can be enabled on the DEBUG UART by writing ENABLE UART LOGS to the Command register.
The detector configuration can be logged on the UART by writing LOG CONFIGURATION to the Command register.
UART logging can be disabled by writing DISABLE UART LOGS to the Command register. -
Reset Module
The module can be restarted by writing RESET MODULE to the Command register.
After the restart the detector must be configured again. -
Presence Detection on GPIO
The I2C Presence Detector can be configured to set MISC GPIO0 pin HIGH when presence is detected, and LOW when presence is not detected. To enable presence detection on GPIO, write 1 to the Detection On Gpio register. To disable presence detection on GPIO, write 0 to the Detection On Gpio register.
Register Protocol
I2C Slave Address
The default slave address is 0x52.
Protocol Byte Order
Both register address, 16-bit, and register data, 32-bit, are sent in big
endian byte order.
-
I2C Write Register(s)
A write register operation consists of an I2C write of two address bytes and four data bytes for each register to write. Several registers can be written in the same I2C transaction, the register address will be incremented by one for each four data bytes.- Example 1: Writing six bytes will write one register, two address bytes and four data bytes.
- Example 2: Writing 18 bytes will write four registers, two address bytes and 16 data bytes.
Example operation, write 0x11223344 to address 0x0025.Description| Data
---|---
I2C Start Condition|
Slave Address + Write| 0x52 + W
Address to slave [15:8]| 0x00
Address to slave [7:0]| 0x25
Data to slave [31:24]| 0x11
Data to slave [23:16]| 0x22
Data to slave [15:8]| 0x33
Data to slave [7:0]| 0x44
I2C Stop Condition|
-
I2C Read Register(s)
A read register operation consists of an I2C write of two address bytes followed by an I2C read of four data bytes for each register to read. Several registers can be read in the same I2C transaction, the register address will be incremented by one for each four data bytes.- Example 1: Writing two bytes and reading four bytes will read one register.
- Example 2: Writing two bytes and reading 16 bytes will read four registers.
Example operation, read 0x12345678 from address 0x0003. Description| Data
---|---
I2C Start Condition|
Slave Address + Write| 0x52 + W
Address to slave [15:8]| 0x00
Address to slave [7:0]| 0x03
I2C Stop Condition|
I2C Start Condition|
Slave Address + Read| 0x52 + R
Data from slave [31:24]| 0x12
Data from slave [23:16]| 0x34
Data from slave [15:8]| 0x56
Data from slave [7:0]| 0x78
I2C Stop Condition|
Register Protocol – Low Power Mode
- I2C Communication with Low Power Mode
- Low power example
File Structure
The I2C Presence Detector application consists of the following files.
- acc reg protocol.c A generic protocol handler implementation.
- presence reg protocol.c The specific register protocol setup for the I2C Presence Detector.
- presence reg protocol access.c The register read and write access functions for the I2C Presence Detector.
- i2c application system stm32.c System functions, such as I2C handling, GPIO control and low-power state
- i2c presence detector.c The I2C Presence Detector application.
Embedded Host Example
This is an example implementation of the host read and write register functions using the STM32 SDK.
Register Read/Write functions
Detector setup functions
Registers
- Register Map**
Address| Register Name| Type**
---|---|---
0x0000| Version| Read Only
0x0001| Protocol Status| Read Only
0x0002| Measure Counter| Read Only
0x0003| Detector Status| Read Only
0x0010| Presence Result| Read Only
0x0011| Presence Distance| Read Only
0x0012| Intra Presence Score| Read Only
0x0013| Inter Presence Score| Read Only
0x0040| Sweeps Per Frame| Read / Write
0x0041| Inter Frame Presence Timeout| Read / Write
0x0042| Inter Phase Boost Enabled| Read / Write
0x0043| Intra Detection Enabled| Read / Write
0x0044| Inter Detection Enabled| Read / Write
0x0045| Frame Rate| Read / Write
0x0046| Intra Detection Threshold| Read / Write
0x0047| Inter Detection Threshold| Read / Write
0x0048| Inter Frame Deviation Time Const| Read / Write
0x0049| Inter Frame Fast Cutoff| Read / Write
0x004a| Inter Frame Slow Cutoff| Read / Write
0x004b| Intra Frame Time Const| Read / Write
0x004c| Intra Output Time Const| Read / Write
0x004d| Inter Output Time Const| Read / Write
0x004e| Auto Profile Enabled| Read / Write
0x004f| Auto Step Length Enabled| Read / Write
0x0050| Manual Profile| Read / Write
0x0051| Manual Step Length| Read / Write
0x0052| Start| Read / Write
0x0053| End| Read / Write
0x0054| Reset Filters On Prepare| Read / Write
0x0055| Hwaas| Read / Write
0x0080| Detection On Gpio| Read / Write
0x0100| Command| Write Only
Register Descriptions
- Version**
Address| 0x0000
---|---
Access| Read Only
Register Type| field
Description| Get the RSS version.
Bitfield| Pos| Width| Mask**
---|---|---|---
MAJOR| 16| 16| 0xffff0000
MINOR| 8| 8| 0x0000ff00
PATCH| 0| 8| 0x000000ff- MAJOR – Major version number
- MINOR – Minor version number
- PATCH – Patch version number
- Protocol Status**
Address| 0x0001
---|---
Access| Read Only
Register Type| field
Description| Get protocol error flags.
Bitfield| Pos| Width| Mask**
---|---|---|---
PROTOCOL STATE ERROR| 0| 1| 0x00000001
PACKET LENGTH ERROR| 1| 1| 0x00000002
ADDRESS ERROR| 2| 1| 0x00000004
WRITE FAILED| 3| 1| 0x00000008
WRITE TO READ ONLY| 4| 1| 0x00000010- PROTOCOL STATE ERROR – Protocol state error
- PACKET LENGTH ERROR – Packet length error ADDRESS ERROR – Register address error
- WRITE FAILED – Write register failed
- WRITE TO READ ONLY – Write to read only register
- Measure Counter**
Address| 0x0002
---|---
Access| Read Only
Register Type| uint
Description**| Get the measure counter, the number of measurements performed since restart. - Detector Status**
Address| 0x0003
---|---
Access| Read Only
Register Type| field
Description| Get detector status flags.
Bitfield| Pos| Width| Mask**
---|---|---|---
RSS REGISTER OK| 0| 1| 0x00000001
CONFIG CREATE OK| 1| 1| 0x00000002
SENSOR CREATE OK| 2| 1| 0x00000004
SENSOR CALIBRATE OK| 3| 1| 0x00000008
DETECTOR CREATE OK| 4| 1| 0x00000010
DETECTOR BUFFER OK| 5| 1| 0x00000020
SENSOR BUFFER OK| 6| 1| 0x00000040
CONFIG APPLY OK| 7| 1| 0x00000080
RSS REGISTER ERROR| 16| 1| 0x00010000
CONFIG CREATE ERROR| 17| 1| 0x00020000
SENSOR CREATE ERROR| 18| 1| 0x00040000
SENSOR CALIBRATE ERROR| 19| 1| 0x00080000
DETECTOR CREATE ERROR| 20| 1| 0x00100000
DETECTOR BUFFER ERROR| 21| 1| 0x00200000
SENSOR BUFFER ERROR| 22| 1| 0x00400000
CONFIG APPLY ERROR| 23| 1| 0x00800000
DETECTOR ERROR| 28| 1| 0x10000000
BUSY| 31| 1| 0x80000000- RSS REGISTER OK – RSS register OK
- CONFIG CREATE OK – Configuration create OK
- SENSOR CREATE OK – Sensor create OK
- SENSOR CALIBRATE OK – Sensor calibrate OK
- DETECTOR CREATE OK – Detector create OK
- DETECTOR BUFFER OK – Detector get buffer size OK
- SENSOR BUFFER OK – Memory allocation of sensor buffer OK
- CONFIG APPLY OK – Detector configuration apply OK
- RSS REGISTER ERROR – RSS register error
- CONFIG CREATE ERROR – Configuration create error
- SENSOR CREATE ERROR – Sensor create error
- SENSOR CALIBRATE ERROR – Sensor calibrate error
- DETECTOR CREATE ERROR – Detector create error
- DETECTOR BUFFER ERROR – Detector get buffer size error
- SENSOR BUFFER ERROR – Memory allocation of sensor buffer error
- CONFIG APPLY ERROR – Detector configuration apply error
- DETECTOR ERROR – Detector error occured, restart necessary
- BUSY – Detector busy
- Presence Result**
Address| 0x0010
---|---
Access| Read Only
Register Type| field
Description| The result from the presence detector.
Bitfield| Pos| Width| Mask**
---|---|---|---
PRESENCE DETECTED| 0| 1| 0x00000001
PRESENCE DETECTED STICKY| 1| 1| 0x00000002
DETECTOR ERROR| 15| 1| 0x00008000
TEMPERATURE| 16| 16| 0xffff0000- PRESENCE DETECTED – Presence detected
- PRESENCE DETECTED STICKY – Presence detected, sticky bit with clear on read
- DETECTOR ERROR – The presence detector failed
- TEMPERATURE – Temperature in sensor during measurement (in degree Celsius). Note that it has poor absolute accuracy and should only be used for relative temperature measurements.
- Presence Distance**
Address| 0x0011
---|---
Access| Read Only
Register Type| uint
Unit| mm
Description**| The distance, in millimeters, for the detected presence - Intra Presence Score**
Address| 0x0012
---|---
Access| Read Only
Register Type| uint
Description**| A measure of the amount of fast motion detected. - Inter Presence Score**
Address| 0x0013
---|---
Access| Read Only
Register Type| uint
Description**| A measure of the amount of slow motion detected. - Sweeps Per Frame**
Address| 0x0040
---|---
Access| Read / Write
Register Type| uint
Description| The number of sweeps that will be captured in each frame (measurement).
Default Value**| 16 - Inter Frame Presence Timeout**
Address| 0x0041
---|---
Access| Read / Write
Register Type| uint
Description| Number of seconds the inter-frame presence score needs to decrease before exponential scaling starts for faster decline. Should be between 0 and 30 where 0 means no timeout.
Default Value**| 3 - Inter Phase Boost Enabled**
Address| 0x0042
---|---
Access| Read / Write
Register Type| bool
Description| Enable to increase detection of slow motions by utilizing the phase information in the Sparse IQ data.
Default Value**| False - Intra Detection Enabled**
Address| 0x0043
---|---
Access| Read / Write
Register Type| bool
Description| Enable to detect faster movements inside frames.
Default Value**| True - Inter Detection Enabled**
Address| 0x0044
---|---
Access| Read / Write
Register Type| bool
Description| Enable to detect slower movements between frames.
Default Value**| True - Frame Rate**
Address| 0x0045
---|---
Access| Read / Write
Register Type| uint
Unit| mHz
Description| The presence detector frame rate. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 12000 - Intra Detection Threshold**
Address| 0x0046
---|---
Access| Read / Write
Register Type| uint
Description| The threshold for detecting faster movements inside frames. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 1300 - Inter Detection Threshold**
Address| 0x0047
---|---
Access| Read / Write
Register Type| uint
Description| This is the threshold for detecting slower movements between frames. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 1000 - Inter Frame Deviation Time Const**
Address| 0x0048
---|---
Access| Read / Write
Register Type| uint
Unit| ms
Description| The time constant of the low pass filter for the inter- frame deviation between fast and slow. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 500 - Inter Frame Fast Cutoff**
Address| 0x0049
---|---
Access| Read / Write
Register Type| uint
Unit| mHz
Description| The cutoff frequency of the low pass filter for the fast filtered absolute sweep mean. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 6000 - Inter Frame Slow Cutoff**
Address| 0x004a
---|---
Access| Read / Write
Register Type| uint
Unit| mHz
Description| The cutoff frequency of the low pass filter for the slow filtered absolute sweep mean. Note: This value is a factor 1000 larger than the RSS value.
---|---
Default Value**| 200 - Intra Frame Time Const**
Address| 0x004b
---|---
Access| Read / Write
Register Type| uint
Unit| ms
Description| The time constant for the depthwise filtering in the intra- frame part. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 150 - Intra Output Time Const**
Address| 0x004c
---|---
Access| Read / Write
Register Type| uint
Unit| ms
Description| The time constant for the output in the intra-frame part. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 300 - Inter Output Time Const**
Address| 0x004d
---|---
Access| Read / Write
Register Type| uint
Unit| ms
Description| The time constant for the output in the inter-frame part. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 2000 - Auto Profile Enabled**
Address| 0x004e
---|---
Access| Read / Write
Register Type| bool
Description| Enable/Disable automatic selection of profile based on start point of measurement.
Default Value**| True - Auto Step Length Enabled**
Address| 0x004f
---|---
Access| Read / Write
Register Type| bool
Description| Enable/Disable automatic selection of step length based on the profile.
Default Value**| True - Manual Profile**
Address| 0x0050
---|---
Access| Read / Write
Register Type| enum
---|---
Description| The profile to use. The profile will only be used if profile auto selection was disabled.
Default Value| PROFILE4
Enum| Value**
---|---
PROFILE1| 1
PROFILE2| 2
PROFILE3| 3
PROFILE4| 4
PROFILE5| 5- PROFILE1 – Profile 1
- PROFILE2 – Profile 2
- PROFILE3 – Profile 3
- PROFILE4 – Profile 4
- PROFILE5 – Profile 5
- Manual Step Length**
Address| 0x0051
---|---
Access| Read / Write
Register Type| uint
Description| The number of steps between each data point. The manual step length will only be used if step length auto selection was disabled.
Default Value**| 72 - Start**
Address| 0x0052
---|---
Access| Read / Write
Register Type| uint
Unit| mm
Description| The start point of measurement interval in millimeters. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 300 - End**
Address| 0x0053
---|---
Access| Read / Write
Register Type| uint
Unit| mm
Description| The end point of measurement interval in millimeters. Note: This value is a factor 1000 larger than the RSS value.
Default Value**| 2500 - Reset Filters On Prepare**
Address| 0x0054
---|---
Access| Read / Write
Register Type| bool
Description| Enable/Disable reset of the presence filters during start/restart.
Default Value**| True - Hwaas**
Address| 0x0055
---|---
Access| Read / Write
Register Type| uint
Description| The hardware accelerated average samples (HWAAS).
Default Value**| 32 - Detection On Gpio**
Address| 0x0080
---|---
Access| Read / Write
Register Type| bool
Description| Output presence detection on generic gpio
Default Value**| False - Command**
Address| 0x0100
---|---
Access| Write Only
Register Type| enum
Description| Execute command.
Enum| Value**
---|---
APPLY CONFIGURATION| 1
START DETECTOR| 2
STOP DETECTOR| 3
ENABLE UART LOGS| 32
DISABLE UART LOGS| 33
LOG CONFIGURATION| 34
RESET MODULE| 1381192737- APPLY CONFIGURATION – Apply the configuration
- START DETECTOR – Start the presence detector
- STOP DETECTOR – Stop the presence detector
- ENABLE UART LOGS – DEBUG: Enable UART Logs
- DISABLE UART LOGS – DEBUG: Disable UART Logs
- LOG CONFIGURATION – DEBUG: Print detector configuration to
- UART RESET MODULE – Reset module, needed to make a new configuration
Disclaimer
The information herein is believed to be correct as of the date issued.
Acconeer AB (“Acconeer”) will not be responsible for damages of any nature
resulting from the use or reliance upon the information contained herein.
Acconeer makes no warranties, expressed or implied, of merchantability or
fitness for a particular purpose or course of performance or usage of trade.
Therefore, it is the user’s responsibility to thoroughly test the product in
their particular application to determine its performance, efficacy and
safety. Users should obtain the latest relevant information before placing
orders. Unless Acconeer has explicitly designated an individual Acconeer
product as meeting the requirement of a particular industry standard, Acconeer
is not responsible for any failure to meet such industry standard
requirements. Unless explicitly stated herein this document Acconeer has not
performed any regulatory conformity test. It is the user’s responsibility to
assure that necessary regulatory conditions are met and approvals have been
obtained when using the product. Regardless of whether the product has passed
any conformity test, this document does not constitute any regulatory approval
of the user’s product or application using Acconeer’s product. Nothing
contained herein is to be considered as permission or a recommendation to
infringe any patent or any other intellectual property right. No license,
express or implied, to any intellectual property right is granted by Acconeer
herein. Acconeer reserves the right to at any time correct, change, amend,
enhance, modify, and improve this document and/or Acconeer products without
notice.
This document supersedes and replaces all information supplied prior to the
publication hereof.
© 2023 by Acconeer AB – All rights reserved
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>