Skip to content

Commit f859b40

Browse files
authored
Merge pull request #8 from sparkfun/feature/sf-toolkit-v1
Pull down the changes made to support the SparkFun_Toolkit v1
2 parents 2331f77 + e741557 commit f859b40

File tree

19 files changed

+2050
-1862
lines changed

19 files changed

+2050
-1862
lines changed

LICENSE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
MIT License
22

3-
Copyright (c) 2025 SparkFun Electronics
3+
4+
Copyright (c) 2024-2025 SparkFun Electronics
5+
46

57
Permission is hereby granted, free of charge, to any person obtaining a copy
68
of this software and associated documentation files (the "Software"), to deal
@@ -19,3 +21,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1921
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2022
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2123
SOFTWARE.
24+

README.md

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,77 @@
1-
SparkFun XM125 A121 Arduino Library
2-
========================================
31

4-
[![SparkFun Pulsed Coherent Radar Sensor – Acconeer XM125 (Qwiic)](https://cdn.sparkfun.com/r/600-600/assets/parts/2/4/8/6/5/SEN-24540-Pulsed-Coherent-Radar-Sensor-Feature.jpg)](https://www.sparkfun.com/products/24540)
2+
![SparkFun Pulsed Coherent Radar Sensor – Acconeer XM125 (Qwiic)](docs/images/gh-banner-2025-xm125.png "SparkFun Pulsed Coherent Radar Sensor")
53

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
75

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
97

8+
![License](https://img.shields.io/github/license/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library)
9+
![Release](https://img.shields.io/github/v/release/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library)
10+
![Release Date](https://img.shields.io/github/release-date/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library)
11+
![Documentation - build](https://img.shields.io/github/actions/workflow/status/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library/build-deploy-ghpages.yml?label=doc%20build)
12+
![Compile - Test](https://img.shields.io/github/actions/workflow/status/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library/test-compile-sketch.yml?label=compile%20test)
13+
![GitHub issues](https://img.shields.io/github/issues/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library)
1014

11-
Repository Contents
12-
-------------------
1315

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.
2016

17+
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!
2118

22-
Documentation
23-
--------------
19+
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!
2420

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)
21+
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.
2822

23+
## Functionality
2924

30-
Products that use this Library
31-
---------------------------------
25+
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.
3226

33-
* [*SEN-24540*](https://www.sparkfun.com/products/24540)
27+
When running as a I2C client device, the Acconeer XM125 is loaded with a specific firmware application from Acconeer.
3428

29+
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.
3530

36-
License Information
37-
-------------------
31+
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.
3832

39-
This product is _**open source**_!
4033

41-
Please review the LICENSE.md file for license information.
34+
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:
4235

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).
36+
|Function|Firmware|
37+
|---|---|
38+
|Distance Detection | `i2c_distance_detector` |
39+
|Presence Detection | `i2c_presence_detector` |
4440

45-
Distributed as-is; no warranty is given.
41+
## General Use
42+
43+
### TO DO
44+
45+
46+
## Examples
47+
48+
The following examples are provided with the library
49+
50+
| Example | Description |
51+
|---|---|
52+
|[Presence Basic Readings](examples/Example01_PresenceBasicReadings/Example01_PresenceBasicReadings.ino)| The sensor is initialized, then the presence distance values will print out to the terminal.|
53+
| [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. |
54+
|[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.|
55+
|[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.|
56+
|[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.|
57+
|[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. |
58+
|[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. |
59+
|[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.|
60+
|[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. |
61+
62+
63+
## Documentation
64+
65+
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).
66+
67+
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).
68+
69+
The Hookup Guide for the SparkFun Qwiic Soil Moisture Sensor is available [here](https://docs.sparkfun.com/SparkFun_Qwiic_Pulsed_Radar_Sensor_XM125/introduction/).
70+
71+
## License Information
72+
73+
This product is ***open source***!
74+
75+
This product is licensed using the [MIT Open Source License](https://opensource.org/license/mit).
4676

47-
- Your friends at SparkFun.
4877

49-
_<COLLABORATION CREDIT>_

docs/images/gh-banner-2025-xm125.png

425 KB
Loading

examples/Example01_PresenceBasicReadings/Example01_PresenceBasicReadings.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <Arduino.h>
2525
#include "SparkFun_Qwiic_XM125_Arduino_Library.h"
2626

27-
SfeXM125 radarSensor;
27+
SparkFunXM125 radarSensor;
2828

2929
// I2C default address
3030
uint8_t i2cAddress = SFE_XM125_I2C_ADDRESS;

examples/Example02_PresenceGPIO0Usage/Example02_PresenceGPIO0Usage.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <Arduino.h>
2525
#include "SparkFun_Qwiic_XM125_Arduino_Library.h"
2626

27-
SfeXM125 radarSensor;
27+
SparkFunXM125 radarSensor;
2828

2929
// I2C default address
3030
uint8_t i2cAddress = SFE_XM125_I2C_ADDRESS;

examples/Example03_PresenceSerialPlotter/Example03_PresenceSerialPlotter.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <Arduino.h>
2525
#include "SparkFun_Qwiic_XM125_Arduino_Library.h"
2626

27-
SfeXM125 radarSensor;
27+
SparkFunXM125 radarSensor;
2828

2929
// I2C default address
3030
uint8_t i2cAddress = SFE_XM125_I2C_ADDRESS;

examples/Example04_PresenceAdvancedReadings/Example04_PresenceAdvancedReadings.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <Arduino.h>
2525
#include "SparkFun_Qwiic_XM125_Arduino_Library.h"
2626

27-
SfeXM125 radarSensor;
27+
SparkFunXM125 radarSensor;
2828

2929
// I2C default address
3030
uint8_t i2cAddress = SFE_XM125_I2C_ADDRESS;
@@ -114,7 +114,7 @@ void loop()
114114
radarSensor.getPresenceDetectorPresenceDetected(presenceDetected);
115115
radarSensor.getPresenceDetectorPresenceStickyDetected(presenceDetectedSticky);
116116

117-
if((presenceDetected == 1) | (presenceDetectedSticky == 1))
117+
if((presenceDetected == 1) || (presenceDetectedSticky == 1))
118118
{
119119
radarSensor.getPresenceDistance(distance);
120120
Serial.print("Presence Detected: ");

examples/Example05_PresenceAdvancedSettings/Example05_PresenceAdvancedSettings.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <Arduino.h>
2626
#include "SparkFun_Qwiic_XM125_Arduino_Library.h"
2727

28-
SfeXM125 radarSensor;
28+
SparkFunXM125 radarSensor;
2929

3030
// I2C default address
3131
uint8_t i2cAddress = SFE_XM125_I2C_ADDRESS;

examples/Example06_DistanceBasicReadings/Example06_DistanceBasicReadings.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <Arduino.h>
2525
#include "SparkFun_Qwiic_XM125_Arduino_Library.h"
2626

27-
SfeXM125 radarSensor;
27+
SparkFunXM125 radarSensor;
2828

2929
// I2C default address
3030
uint8_t i2cAddress = SFE_XM125_I2C_ADDRESS;

examples/Example07_DistanceThresholdSettings/Example07_DistanceThresholdSettings.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <Arduino.h>
2525
#include "SparkFun_Qwiic_XM125_Arduino_Library.h"
2626

27-
SfeXM125 radarSensor;
27+
SparkFunXM125 radarSensor;
2828

2929
// I2C default address
3030
uint8_t i2cAddress = SFE_XM125_I2C_ADDRESS;

0 commit comments

Comments
 (0)