About Xethru X2M200 Connecting with Arduino Uno

Discussion in 'Respiration Sensor' started by marcoyip, Dec 18, 2016.

  1. marcoyip

    marcoyip New Member

    Sorry guys, i dont know how to connect xethru x2m200 with arduino.
    which pin is gnd, which is vcc..all of pin i did not know.
    I tried to control led by using xethru x2m200 but it just had x2m1000 of the tutorial therefore i dont know x2m200.
    can anyone help?
     
  2. Lucile Chabre

    Lucile Chabre New Member

    Hey, we're on the same boat my friend I just purchased the X2M200 for a project similar to the controlling led with your breath tutorial and I can get a decent signal with the XeThru app let alone control the captar with the arduino program.
    However I did found out which pin is which, as it is written in the data sheet. (Took me some time too I shamely confess) : pin 1 - power, pin 2 - GND, pin 3 - RX, pin 4 - TX, other pin are not crucial apparently.

    Let me know if you get a good signal so that I can understand what I did wrong ! :)
     
  3. marcoyip

    marcoyip New Member

    thanks for your comment.
    sorry for another question,
    is it pin1 to 4?
    [​IMG]
     
  4. marcoyip

    marcoyip New Member

  5. Lucile Chabre

    Lucile Chabre New Member

    No worries, I'm just not sure how much help I can be as I'm very new to all this.
    Yes your pin number are correct.
    No idea for the code, it's not working for me at the moment. I have a good signal with the xethru app but can get a signal on the arduino monitor.
    I believe there's something to check about the usb connection on the X2M200 that is apparently blocking some of the Io Pin so maybe unplug that, I'll try it tonight.
    Try it with yours and let me know how it goes ?
     
  6. marcoyip

    marcoyip New Member

    Sure. I will tell you if it works.
    It just use arduino board and x2m200? Any other board have to use like level shifter?
    but now it couldn't work in xethru app, it show somthing like "xethru module upgrade failed" after i tried connect with arduino.
    i dont know if I upload the arduino code before that.
     
  7. Lucile Chabre

    Lucile Chabre New Member

    yeah you need a level shifter like the one shown on the tutorial. Maybe that's why.
    In any case you just need to plug the sensor to the computer using the usb cable to get the signal on the app so that should work. Maybe you need extra drivers depending the type of windows version you're using...
     
  8. marcoyip

    marcoyip New Member

    I use Mac to use the xethru app but I'm try to figure out whats wrong of xethru. It worked in few days ago, so I don't know
    [​IMG]
     
  9. Olav Liseth

    Olav Liseth Administrator Staff Member

  10. marcoyip

    marcoyip New Member

    Olav Liseth,

    thanks for your reply,
    is it the example can also suitable in arduino uno?

    Yes, same as the behavior described.
     
  11. Olav Liseth

    Olav Liseth Administrator Staff Member

    Are you holding pin 3 low during power-up/reset? See page 16 in the data sheet. Not sure about the comparability between the arduinos, but the some signal processing is implemented in the above sample which you don't need.
     
  12. marcoyip

    marcoyip New Member

    What it means holding pin 3 low during power-up/reset? I'm just use 3.3v to connect xethru.
    sorry that I'm just the new in all of this.
     
  13. Olav Liseth

    Olav Liseth Administrator Staff Member

    Can you disconnect the X2M200 from the Arduino setup and then run XeThru Explorer. Pin number 3 is used for UART RX and forcing bootloader mode if the pin level is low.
     
  14. marcoyip

    marcoyip New Member

    I used x2m200 run XeThru Explorer and not connect with arduino. It still show "Module upgrade failed".
     
  15. Olle Alm

    Olle Alm New Member

    Hi marcoyip!
    We seem to have the same bootloader problem. (I started the thread Olav linked to earlier)

    Just to make things a bit more clear.
    I had the M2X200 running with the "xethru-arduino-radar" arduino code (just using pin 1-4 connected to arduino and no usb or level shifter) so that don't seem to be the problem.

    But after trying some other stuff out and then returning to the "xethru-arduino-radar" I got the bootloader error. Might be that I connected something wrong the last time even though I don't think I did. Still hoping for a solution though.
     
  16. marcoyip

    marcoyip New Member

    Hi Olle Alm,
    Are you use Xethru Explorer in Mac?
    It would show "Module upgrade failed" by using Mac, but I connect xethru x2m200 in Window, it worked.
    You can try it in Window.
     
  17. Olle Alm

    Olle Alm New Member

    Yes, that solved the problem :)
    Thanks!
     
  18. marcoyip

    marcoyip New Member

    Can you get nice signal in arduino?
    I am trying it now but it can't make led blink.
     
  19. Olav Liseth

    Olav Liseth Administrator Staff Member

    Great marcoyip. The bug is reported and will be fixed for future versions.
     
  20. vikas mehra

    vikas mehra New Member

    Hello Olav
    I have used same example code as given "https://github.com/oyvdahl/xethru-a...istance-sensor/zero-radar-distance-sensor.ino"
    To connect X2M200 with Arudino Uno and made little changes to adjust with Uno as example code is for Arudino Zero board.

    Attachments:
    1. Picture.jpg. This message coming everytime i am connecting Arudino with X2M200. "Distance 0.1 mtr" and data receiving also not able to understand fully. As per serial protocol document "Start byte, Data, End byte" .
    Could you please put more light in understanding this data.

    2. distance.zip Code used Attached
     

    Attached Files: