I am writing to report an issue I encountered with the SparkFun Pulsed Coherent Radar Sensor - Acconeer XM125 (Qwiic) that I recently purchased. I connected the device to an Arduino Nano and attempted to run it according to the provided instructions. However, the device did not work, and I received the following errors in the Serial Monitor:
10:23:41.810 → ��HXM125 Example 8: Distance Serial Plotter
10:23:43.339 →
10:23:43.339 → Begin
10:23:45.167 → Distance Detection Start Setup Error: 7
10:23:45.167 →
10:23:45.669 → Distance Reading Setup Error: 1
Steps I Took:
- I connected the device to the Arduino Nano using the Qwiic port.
- I uploaded the provided example code (Example 8: Distance Serial Plotter) from the library.
- I ensured that the wiring was correct and that the Arduino Nano was receiving sufficient power.
#Expected Outcome:
I expected the device to function properly and display distance readings in the Serial Monitor.
The Issue:
When running the code, the device fails to start the distance detection process and displays the errors mentioned above.
#Questions:
- What is the cause of these errors?
- Are there additional steps I need to follow to get the device working correctly?
- Could the issue be related to the firmware version or the libraries being used?
Thank you for your support, and I look forward to hearing from you soon.
Best regards,
Hi I am Joel Roman
I am reaching out to you in an effort to offer support regarding your results
Error Analysis and Potential Causes
The error messages and symbols (◆□×□◆) suggest issues with the Acconeer XM125 sensor’s configuration, wiring, or communication with the Arduino Nano. Potential causes include:
- Incorrect wiring or connections between the XM125 sensor and Arduino Nano
- Incompatible firmware or library versions for the XM125 sensor
- Sensor configuration errors, such as incorrect settings for the sensor mode, range, or gain
- Insufficient power supply to the XM125 sensor
Additional Steps
- Firmware and Library Update: Update the Arduino Nano’s firmware and the XM125 sensor’s libraries to the latest versions.
- Verify Wiring and Connections: Double-check the wiring between the XM125 sensor and Arduino Nano, ensuring that all connections are secure and correct.
- Review Sensor Documentation: Ensure that you’ve consulted the XM125 sensor’s datasheet, user manual, and any provided example code.
I’ve went ahead and developed this quick and basic code for you to try to run it I did it really fast like in an hour so I haven’t revised it but it should be good I’m not seeing the system physically but it doesn’t sound that complicated hope this helps
Here is the code
c++
#include <Wire.h>
#include <SparkFun_Acconeer_XM125.h>
// Create an instance of the Acconeer XM125 sensor
AcconeerXM125 radarSensor;
void setup() {
Serial.begin(9600);
Wire.begin();
// Initialize the radar sensor
if (!radarSensor.begin()) {
Serial.println("Radar sensor initialization failed.");
while (1);
}
// Set the sensor mode to "Envelope" (default)
radarSensor.setSensorMode(ACCONeer_XM125_SENSOR_MODE_ENVELOPE);
// Set the range to 0.2 meters to 4 meters
radarSensor.setRange(0.2, 4.0);
}
void loop() {
// Start a new measurement
radarSensor.startMeasurement();
// Wait for the measurement to complete
while (!radarSensor.measurementComplete()) {
delay(1);
}
// Read the measurement data
int numPoints = radarSensor.getNumPoints();
float distanceM = radarSensor.getDistanceM();
float amplitude = radarSensor.getAmplitude();
// Print the measurement data
Serial.print("Distance (m): ");
Serial.print(distanceM);
Serial.print(", Amplitude: ");
Serial.println(amplitude);
// Wait a short period before taking the next measurement
delay(100);
}
If you need any further assistance or have any other questions feel free to ask I am, here to help😁 good luck on achieving your goals
Best regards
Joel roman
Founder & CEO
Creative Thinking Labs
thank you for your replay but ı use this library what is different
#include “SparkFun_Qwiic_XM125_Arduino_Library.h”
and I didn’t find any library same this
#include <SparkFun_Acconeer_XM125.h>
can you share this library, please
thank you so much
Hi there!
Thanks for reaching out. I understand your confusion about the two libraries. After further research, I found that the SparkFun_Acconeer_XM125.h library is not a publicly available library. The correct library to use with the XM125 sensor is indeed the SparkFun_Qwiic_XM125_Arduino_Library.h, which you’re already using.
You can find the Qwiic library and its documentation on the SparkFun website or GitHub repository. If you have any questions or need help with your project, feel free to ask!"
The examples use different firmware; 1-5 use ‘presence detection’ firmware which comes on the unit, 6-9 use ‘distance detection’ firmware…make sure to flash the distance version before attempting to use any of the examples 6-9 Flashing Firmware to the XM125 - SparkFun Qwiic Pulsed Coherent Radar Sensor Breakout - Acconeer XM125 Hookup Guide