Using X4M200 With Arduino

Discussion in 'Respiration Sensor' started by Rajiv Swamy, Mar 16, 2019.

  1. Rajiv Swamy

    Rajiv Swamy New Member

    I tried to use the X4M200 sensor with the Arduino Mega using the code specified in the support resources documentation. I have the setup replicated exactly as specified in the documentation. I was getting the following errors/codes when compiling the example code and results from uploading in the serial monitor. I have attached the supporting screenshots. The sensor is working as expected with the Xethru explorer. Screen Shot 2019-03-15 at 7.19.46 PM.png Screen Shot 2019-03-15 at 7.20.32 PM.png
    Screen Shot 2019-03-15 at 7.19.46 PM.png Screen Shot 2019-03-15 at 7.20.32 PM.png Screen Shot 2019-03-15 at 7.18.25 PM.png
     
  2. Hi Swamy !

    My module seems to be stuck in the XTS_SPRS_READY loop. I'm using the exact same classifications provided on the Xethru arduino documentation. I tried changing the baud rates and the serial ports but nothing seems to work ( the tx and rx led's on the mega doesn't even blink while the xethru seems to boot up and fire all led's). I tried removing bits and pieces from the code and it seems like there is no acknowledgement from the radar. Any ideas on how to solve it ?
     
  3. Allen Wu

    Allen Wu Moderator Staff Member

    Hi Rajiv,

    I recently did a test on Arduino Mega with “X4M200_respiration_example.ino”
    My compile output is similar to yours.

    Here is what I did:

    Follow the connection diagram, using a Bi-directional Logic Level Converter (Level Shifter) in between, careful with the 3.3V and 5V sections.
    https://github.com/xethru/XeThru_Ar...ter/Connection_Diagram_XeThru_ArduinoMega.png

    In Arduino 1.8.10 menu, select Tools --> Board --> Arduino/Genuino Mega or Mega 2560
    Verify/Compile and then Upload

    The Output on the Serial Monitor should look similar like this:

    Waiting for XTS_SPRS_READY...
    Radar is booting...
    Received XTS_SPRS_READY!
    Sent: 7D 20 13 4E 7E
    Sent: 7D 21 AD 57 4E 6 EE 7E
    Sent: 7D 25 10 6 0 0 0 4E 7E
    Sent: 7D 10 10 1C A A1 96 CD CC CC 3E 0 0 0 40 EF 7E
    Sent: 7D 10 10 2B 11 A5 10 9 0 0 0 FB 7E
    Sent: 7D 41 10 6C A1 75 23 1 0 0 0 B6 7E
    Sent: 7D 41 10 26 FE 75 23 0 0 0 0 A2 7E
    Sent: 7D 41 10 0 3B A 61 0 0 0 0 7C 7E
    Sent: 7D 41 10 2 3B A 61 0 0 0 0 7F 7E 7E
    Sent: 7D 20 1 5C 7E
    State: Initializing
    RPM: 0.0
    Distance: 0.0
    signal_quality: 0
    movement_slow: 0.0
    movement_fast: 0.0
    ---
    State: Initializing
    RPM: 0.0
    Distance: 0.0
    signal_quality: 0
    movement_slow: 0.0
    movement_fast: 0.0




    ---
    State: Movement
    RPM: 0.0
    Distance: 0.4
    signal_quality: 6
    movement_slow: 40.2
    movement_fast: 57.6
    ---
    State: Movement
    RPM: 0.0
    Distance: 0.4
    signal_quality: 5
    movement_slow: 43.5
    movement_fast: 49.3
    ---


    PS. I would also suggest to check the connection, is it too long? are the connections good and secured?

    Allen