|
1 |
| -SparkFun XM125 A121 Arduino Library |
2 |
| -======================================== |
3 | 1 |
|
4 |
| -[](https://www.sparkfun.com/products/24540) |
| 2 | + |
5 | 3 |
|
6 |
| -[*SparkFun Pulsed Coherent Radar Sensor – Acconeer XM125 (Qwiic) (SEN-24540)*](https://www.sparkfun.com/products/24540) |
| 4 | +# SparkFun Pulsed Coherent Radar Sensor – Acconeer XM125 |
7 | 5 |
|
8 |
| -This is the SparkFun library for the Acconeer Entry+ Module XM125 with the A121 60GHz Pulsed Coherent Radar sensor and I<sup>2</sup>C interface. |
| 6 | +Arduino Library for the SparkFun Pulsed Coherent Radar Sensor |
9 | 7 |
|
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
10 | 14 |
|
11 |
| -Repository Contents |
12 |
| -------------------- |
| 15 | +The [SparkFun Pulsed Coherent Radar Sensor - Acconeer XM125 (SEN-24540)](https://www.sparkfun.com/sparkfun-pulsed-coherent-radar-sensor-acconeer-xm125-qwiic.html) brings powerful 60 GHz radar technology to your projects. This sensor isn't limited to surface detection; it can see through walls, cabinets, and even pockets (depending on the material), making it perfect for unique applications. Measure distances with millimeter precision, detect motion, the speed of an object, or even gestures! |
13 | 16 |
|
14 |
| -* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE. |
15 |
| -* **/src** - Source files for the library (.cpp, .h). |
16 |
| -* **/docs** - Datasheet and application note for the XM125 and A121. |
17 |
| -* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE. |
18 |
| -* **library.properties** - General library properties for the Arduino package manager. |
19 |
| -* **[CONTRIBUTING.md](./CONTRIBUTING.md)** - guidance on how to contribute to this library. |
| 17 | +The XM125 boasts an impressive range of up to 20 meters, allowing you to create long-range sensing projects. The actual measurable distance is dependent on the object size, shape, dielectric properties, and lens (e.g. water level measurements up to 20 meters with lens utilization, human presence detection up to 7 meters with lens-free utilization). Despite its power, the sensor has remarkably low in power consumption, which is ideal for battery-powered applications. The real magic lies in the sensor's ability to do more than measure distance; the XM125 can differentiate between stationary objects and moving targets using pulsed coherent radar. This means you can sense an object's presence and how fast something is moving! |
20 | 18 |
|
| 19 | +Looking for the board that matches this library - pick up a [SparkFun Pulsed Coherent Radar Sensor - Acconeer XM125 (Qwiic)](https://www.sparkfun.com/sparkfun-pulsed-coherent-radar-sensor-acconeer-xm125-qwiic.html) at <www.sparkfun.com>. |
21 | 20 |
|
22 |
| -Documentation |
23 |
| --------------- |
| 21 | +> [!NOTE] |
| 22 | +> |
| 23 | +> If upgrading from **Version 1** of this library, some changes are required before moving to **Version 2.0+**. The detals of this are outlined in the section titled [Upgrading to Version 2 from Version 1](#upgrading-to-version-2-from-version-1) later in this document. |
24 | 24 |
|
25 |
| -* **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library. |
26 |
| -* **[Hookup Guide](https://docs.sparkfun.com/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125)** - Basic hookup guide for the SparkFUn Qwiic Pulsed Coherent Radar Sensor - XM125. |
27 |
| -* **[Product Repository](https://github.com/sparkfun/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125)** - Main repository for the SparkFun Qwiic XM125 (including hardware files) |
| 25 | +## Functionality |
28 | 26 |
|
| 27 | +The SparkFun Pulsed Coherent Radar sensor can run as an I2C client device, or as a standalone development board. This library is used when the sensor is operating as a standalone I2C device. |
29 | 28 |
|
30 |
| -Products that use this Library |
31 |
| ---------------------------------- |
| 29 | +When running as a I2C client device, the Acconeer XM125 is loaded with a specific firmware application from Acconeer. |
32 | 30 |
|
33 |
| -* [*SEN-24540*](https://www.sparkfun.com/products/24540) |
| 31 | +The *SparkFun Pulsed Coherent Radar Sensor - Acconeer XM125* comes with the ***Presence Detector*** firmware loaded, which is accessible using the ***Presence*** focused methods in this library. |
34 | 32 |
|
| 33 | +This library also supports the ***Distance Detection*** application firmware from Acconeer. To enable this functionally, the ***Distance Detection*** firmware must be loaded onto the *SparkFun Pulsed Coherent Radar Sensor - Acconeer XM125* board. The firmware is available from [Acconeer](https://developer.acconeer.com/home/a121-docs-software/xm125-xe125/) as part of the XM125/A121 SDK. The files are located in the `out/` folder - with naming patter of `i2c_*_detector.bin`. Install instructions are noted in our [Hook Up Guide](https://docs.sparkfun.com/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125/introduction/) for the product. |
35 | 34 |
|
36 |
| -License Information |
37 |
| -------------------- |
| 35 | +This library provides a extensive interface that enables the following functionality/interaction with the SparkFun Pulsed Coherent Radar Sensor when the sensor is operating as an I2C sensor device: |
38 | 36 |
|
39 |
| -This product is _**open source**_! |
| 37 | +|Function|Firmware| Library Class To Use| |
| 38 | +|---|---|--| |
| 39 | +|Distance Detection | `i2c_distance_detector` | `SparkFunXM125Distance`| |
| 40 | +|Presence Detection | `i2c_presence_detector` | `SparkFunXM125Presence`| |
40 | 41 |
|
41 |
| -Please review the LICENSE.md file for license information. |
| 42 | +## Documentation |
42 | 43 |
|
43 |
| -If you have any questions or concerns on licensing, please contact technical support on our [SparkFun forums](https://forum.sparkfun.com/viewforum.php?f=152). |
| 44 | +|Reference | Description | |
| 45 | +|---|---| |
| 46 | +|[Quick Reference](https://docs.sparkfun.com/SparkFun_Qwiic_XM125_Arduino_Library/class_qw_dev_x_m125.html)| A quick reference API for the the main library object ```QwDevXM125```| |
| 47 | +|[Full Documentation](https://docs.sparkfun.com/SparkFun_Qwiic_XM125_Arduino_Library/)| The full documentation and API for this Arduino library| |
| 48 | +|[SparkFun Pulsed Coherent Radar Sensor](https://github.com/sparkfun/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125)| Hardware GitHub Repository| |
| 49 | +|[Hook Up Guide](https://docs.sparkfun.com/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125/introduction/) | Hardware Overview and Quick Start for the XM125 Qwiic Development Board | |
44 | 50 |
|
45 |
| -Distributed as-is; no warranty is given. |
| 51 | +## Examples |
46 | 52 |
|
47 |
| -- Your friends at SparkFun. |
| 53 | +The following examples are provided with the library |
48 | 54 |
|
49 |
| -_<COLLABORATION CREDIT>_ |
| 55 | +| Example | Description | |
| 56 | +|---|---| |
| 57 | +|[Presence Basic Readings](examples/Example01_PresenceBasicReadings/Example01_PresenceBasicReadings.ino)| The sensor is initialized, then the presence distance values will print out to the terminal.| |
| 58 | +| [Presence GPIO 0 Usage](examples/Example02_PresenceGPIO0Usage/Example02_PresenceGPIO0Usage.ino)|The sensor is initialized, then the presence values will print out to the terminal and trigger the GPIO0 pin high when there is a presence detected. | |
| 59 | +|[Presence Serial Plotter](examples/Example03_PresenceSerialPlotter/Example03_PresenceSerialPlotter.ino)|The sensor is initialized, then the presence values will print out to the terminal and the serial monitor.| |
| 60 | +|[Presence Advanced Readings](examples/Example04_PresenceAdvancedReadings/Example04_PresenceAdvancedReadings.ino)|The sensor is initialized, then the presence distance, intra-presence, and inter-presence values will be printed to the terminal.| |
| 61 | +|[Presence Advanced Settings](examples/Example05_PresenceAdvancedSettings/Example05_PresenceAdvancedSettings.ino)|The sensor is initialized, then the presence distance values will print out to the terminal just as they do in example one. If you wish to change the settings of the device, do so before applying the configuration.| |
| 62 | +|[Distance Basic Readings](examples/Example06_DistanceBasicReadings/Example06_DistanceBasicReadings.ino)|The sensor is initialized, then the distance values will print out to the terminal in mm. | |
| 63 | +|[Distance Threshold Settings](examples/Example07_DistanceThresholdSettings/Example07_DistanceThresholdSettings.ino)|The sensor is initialized, then the distance amplitude, and strength , fixed amplitude, and sensitivity thresholds are set. | |
| 64 | +|[Distance Serial Plotter](examples/Example08_DistanceSerialPlotter/Example08_DistanceSerialPlotter.ino)|This example prints out the distance values of the 0 distance channels to the serial plotter tool in Arduino.| |
| 65 | +|[Distance Advanced Settings](examples/Example09_DistanceAdvancedSettings/Example09_DistanceAdvancedSettings.ino)|The sensor is initialized, then the distance (mm) and advanced values are output to the terminal. | |
| 66 | + |
| 67 | +## Documentation |
| 68 | + |
| 69 | +The full API and use documentation for this library is provided [here](https://docs.sparkfun.com/SparkFun_Qwiic_XM125_Arduino_Library/). For a quick reference, the main methods available in the library are listed [here](https://docs.sparkfun.com/SparkFun_Qwiic_XM125_Arduino_Library/class_qw_dev_x_m125.html). |
| 70 | + |
| 71 | +Curious about the hardware this board works with - visit the SparkFun Pulsed Coherent Radar Sensor [hardware repository](https://github.com/sparkfun/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125). |
| 72 | + |
| 73 | +The Hookup Guide for the SparkFun Qwiic Soil Moisture Sensor is available [here](https://docs.sparkfun.com/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125/introduction/). |
| 74 | + |
| 75 | +## License Information |
| 76 | + |
| 77 | +This product is ***open source***! |
| 78 | + |
| 79 | +This product is licensed using the [MIT Open Source License](https://opensource.org/license/mit). |
| 80 | + |
| 81 | +## Upgrading to Version 2 from Version 1 |
| 82 | + |
| 83 | +Version 2.0+ of this library is not compatible with Version 1.* implementations/use. For Version 2.0, the single class defined by the library, `SfeXM125`, was divided into two distinct classes for schemantic clarity and code simplification. |
| 84 | + |
| 85 | +### Version 2.0 Changes |
| 86 | + |
| 87 | +#### Classes |
| 88 | + |
| 89 | +The device single class was devided into two classes - one for each specific I2C application that the Acconeer XM125 can run. These classes are: |
| 90 | + |
| 91 | +* SparkFunXM125Distance - Used when the XM125 is running the ***Distance*** application |
| 92 | +* SparkFunXM125Presence - Used when the XM125 is running the ***Presence*** application |
| 93 | + |
| 94 | +#### Method Names |
| 95 | + |
| 96 | +Additionally, the method naming pattern for each application was simplified - removing *Distance* and *Presence* from method names. |
| 97 | + |
| 98 | +### Supporting Version 1.* Implementations |
| 99 | + |
| 100 | +To simplify the transition from an application written using the Version 1.* library, two compatiblity classes are provided: |
| 101 | + |
| 102 | +* SparkFunXM125DistanceV1 - Used when the XM125 is running the ***Distance*** application |
| 103 | +* SparkFunXM125PresenceV1 - Used when the XM125 is running the ***Presence*** application |
| 104 | + |
| 105 | +These classes implement the version 1.*method names for the library, to minimize the porting requirements when upgrading to Version 2.*. |
| 106 | + |
| 107 | +To upgrade to Version 2.0 of the library, perform one of the following: |
| 108 | + |
| 109 | +* If the Acconeer XM125 is running the I2C Distance Application: Rename the device class from `SfeXM125` to `SparkFunXM125DistanceV1` |
| 110 | +* If the Acconeer XM125 is running the I2C Presence Application: Rename the device class from `SfeXM125` to `SparkFunXM125PresenceV1` |
| 111 | + |
| 112 | +Once the class name is changed, your application is ready to use version 2.* of this library. |
0 commit comments