How to connect DWM1001-DEV to Arduino?

Hi,

Is there any tutorial about how to connect DWM1001-DEV to an Arduino UNO board?

Thanks,

hi, anyone has an idea?

ronen

Hi,
using UART communication.

Best regards

I have the DWM1001C, is it really blank?

thx

Is there an example of the hardwaae connection and software?

Iā€™m trying to connect it to an Arduino Mega or Nano.
Thx

Hi,
I donā€™t know if the Arduino have a baudrate of 115200, but if have you send comands (lep, lecā€¦), such as you do with the terminal.

Best Regards.

Hi, Iā€™m just using an Arduino DUE to communicate with two DWM1001-dev and send data to a PC.
If you use a MEGA then use the voltage divider to drive the input line.
Solder a wire to J14 and connect it to the RX input of any serial port of MEGA
Unsolder J15, clean the area of the jumper and connect a peace of wire th the jumper section connected to the DWM1000 module. Connect this wire (via voltage divider if using a 5V Arduino) to the TX of the Arduino serial port .
Just so easy but not documented before ;-))
Have fun, good luck.

1 Like

Hi Esperanto,
I am a little confused.
Why we donā€™t directly connect the Rx, Tx and Gnd Pins of the (3,3V)- Arduino directly to the Tx, Rx and Gnd Pins of the DWM1001-Dev board, which are located on the 26-pin Module IO-Header (the Raspberry Pi compatible header).

Noriemo

My answer appears to be lost. Iā€™ll try again.
The reason is that you cannot connect two drivers in parallel onto the Rx pin of the DWM1001. One will drive the line in the opposite direction. So you need to isolate the line coming from the USB/serial converter using the provided joints.
Conversely you can have two listeners on the TX (from DWM1001) line and both will receive the same information.
That way you can also monitor wath happens using the standard USB connection.
Hope to be clear enough.
Esperanto

3 Likes

Hi Esperanto,
Thank you for the answer.
Yes I agree with you. Sending at the same time would not work. The Tx signals will overlap.
I connected the DWM1001-dev (original) to my computer in parallel by using an USB cable and a serial/USB cable. I opened two Terminals (Hterm).
Both connections work without problems, I can send commands from any Terminal (not at the same time) and I receive the response (same information) in both Terminals.

Noriemo

Hi @Esperanto,
Iā€™m considering buying some DWM1001ā€™s for a Rael Time Location System (college project) and I will use an arduino to read through UART the data (as you did).
But I want to know first where did you find information about the code in Arduino in order to read the data of the DWM1001-DEV? Iā€™ve read all the datasheets but all the examples they give are based on Raspberry and I donĀ“t want to use a Raspberry. So I donĀ“t want to buy a module from which I wonĀ“t be able to get the data.

Your response would be very helpfull!
Best regards

Hi Saenz, I answered since yesterday night but from my e-mailā€¦wrong!!!
I repost my answer here, sorry for my mistake.

Hi Saenz,
ƍ didnā€™t find it, I wrote it for my application.
Iā€™m using a Due that is powered at 3.3 V and has multiple serials but you can use any Arduino putting a voltage divider between a 5V Arduino (ex Uno or Mega) and the dwm.
Using the Due you simply use a Serial port and set the speed 115200, bit 8, no parity, 1 stop. Thatā€™s all.
Then you send commands on that port and will get the info back.
I have two dwm connected to a Due serial 1 and 2 plus an hc-05 on serial 3 and the monitor on Serial 0(default on USB).

If you need additional info donā€™t hesitate to ask.
I limit my answer to what you ask but Iā€™m available to share moreā€‹:wink::wink:
Esperanto

Inviato da Libero Mail per Android
LunedƬ, 23 Marzo 2020, 07:25PM +01:00 da Saenz via Decawave Tech Forum forum@decaforum.decawave.com:

1 Like

Hi @Esperanto,
Thank you very much for your kick answer! It answered a lot of my questions. :slight_smile:
I just want to know what commands you have to send on port? Iā€™ve read a UART example for a Raspberry and they send these commands (they are using python):

DWM.write("\r\r".encode())
time.sleep(1)
DWM.write("lec\r".encode())
time.sleep(1)

So are these the two commands you have to send on port in order to get the data of the DWM1001-DEV?

Thank you for your time!
Best regards

Hi Saenz,
glad to be of some help.
Just to better understand how to move on, Iā€™d like to know something about you. Are you a student, a newbee, a teacher?
Where are you from? Spain? What College are you in?
Iā€™m and old engineer from the '50, and started workning with Intel 8080 in Assembler. Fortunately or not, I remained linked (limited) to some basic programming but enough to work and play even with state-of-the-art micros.
So ask about interrupts, debugging and Timers but not about Objects and complex development systems.
Arduino is very usefull to avoid soldering but the worse for debugging and understanding your mistalkes.

Anyway, to answer your question: YESā€¦butā€¦there is always a but :wink:
here below a peace of my code: (I hope you can understand comments in italian)

**************** I have two DWM, one HC-05 and the Seria (USB)

// Apre canale verso TAG 1
SerialD.begin(115200);
Serial.println(ā€œaperta comunicazione canale Destroā€);

// Apre canale verso TAG 2
ā€¦
//Apre canale verso HC-05
ā€¦
// pulisce Buffer ricezione
ā€¦
resDWM_D:

************* First key point: be sure to start from a known condition
************* Then RESET the DWM and allow time to restart

// Invia comando reset ai TAGs per asicurare condizione di inizio
Serial.println(ā€œinvio comandi di resetā€);
SerialD.print(ā€œreset\rā€);
SerialS.print(ā€œreset\rā€);
// dly 500 msec
Tout = millis()+500;
while(Tout>millis());

***** Remember RPI runs Linux which is a multitasking OS Arduino doesnā€™t.
*************** Avoid delay() use the two lines above instead
********** this is required to leave the communication running.
********** Communication is managed by the interrupts

// pulizia buffer COM stringhe ricezione
RxDflush();
RxSflush();
Serial.println(ā€œPulizia canali comunicazioneā€);
******** I clean the rx buffersā€¦just in caseā€¦

//************ inizializza sensore Destro
// Per un secondo scarta ogni rispostada canale Destro
Tout = millis()+1000;
while(millis()<Tout){

******* If something arrives in the first second, is spuriousā€¦throw away
if (SerialD.available()){
SerialD.readBytes (&B_RXLineD[0],1);
}
}

**** here I notify myself that Iā€™m issuing the command to switch to SHELL MODE

Serial.println(ā€œinvio comandi di SHELL MODEā€);

*******and send the command to DWM

// put cD in Shell Mode
SerialD.print("\r\r");

****** then I allow 1.5 seconds for the DWM to change mode of operation,
print the messages, print the prompt (dwm>) and be ready to work

// aspetta di vedere il prompt nel buffer di ricez
count = 0;
strcpy(B_RXLineD,"");
Tout = millis() +1500;
while(millis()<Tout){
if (SerialD.available()){
buf = SerialD.read();
if (buf == ā€˜>ā€™) break;
}
}

****** notify myselfā€¦

Serial.print("BufD ");Serial.println(byte(buf));
if(buf == ā€˜>ā€™)
Serial.println(ā€œConferma prompt canale Destroā€);
else{
Serial.println(ā€œNESSUNA Conferma prompt canale Destroā€);
SerialHC.println(ā€œNESSUNA Conferma prompt canale Destroā€);
goto resDWM_D;
******* and confirm it is OK or retry the whole process.

Well, I hope itā€™s clear; there is a lot to learn when you will be able to have the DWM in your hands.
A last suggestion: make large use of the USB connection to familiarize with dwm :wink:

Esperanto

The reason why you find quite nothing about Arduino and DWM1001-DEV via serial is that itā€™s probably not interesting for the community.
If you like we can switch to a direct contact. What about your project? My is about a support for autonomous mobilty for blind or visually impaired people.

You can see videos at https://www.youtube.com/playlist?list=PLHR2LoI75xGARoncvg-TXdNtqGf60ikUi
Cheers,
Esperanto

Hello @Esperanto,
Your answer is really from a lot of help. I really appreciatte your kindness.So yes Iā€™m a college student. Iā€™m on my last year of Mechatronics engineering at the Universidad del Valle in Guatemala (Central America). Thatā€™s were I am from. I want to use de DWM in my graduation project. It is not a small proyect and Iā€™m in charge of the electronics. Now we are in the design phase. I can explain you more about the project if you want and I would really like to have direct contact :slight_smile: so you can send me by e-mail ( sae16263@uvg.edu.gt ) your contact. I would want to hear your advice (beacause you have been using the dwm) if this device would be usefull to my aplication.

Iā€™ve watch the videos about your project and let me tell you I found it very interesting and an awesome project (I couldnā€™t understand much because of the languaje) but I can see all the hard work behind it. I really like electronics and I can say you have made a succesfull work.
Cordiali Saluti

Hi Saenz,
I sent you a mail with subject ā€œDWM Direct Contact.ā€
Let me know if you received it. It comes from ā€œkienā€¦ā€

hi, @Esperanto

If you use a MEGA then use the voltage divider to drive the input line.
Solder a wire to J14 and connect it to the RX input of any serial port of MEGA
Unsolder J15, clean the area of the jumper and connect a peace of wire th the jumper section connected to the DWM1000 module. Connect this wire (via voltage divider if using a 5V Arduino) to the TX of the Arduino serial port .

The reason is that you cannot connect two drivers in parallel onto the Rx pin of the DWM1001. One will drive the line in the opposite direction. So you need to isolate the line coming from the USB/serial converter using the provided joints.
Conversely you can have two listeners on the TX (from DWM1001) line and both will receive the same information.
That way you can also monitor wath happens using the standard USB connection.

currently Iā€™m using DWM1001-dev for some test, and I want to send some data from DWM1001-dev to raspberrypi through UART. Iā€™m wondering If I can directly connect rasp TX/RX to DWM1001-dev RPi header TX/RX without need to desolder J15?

I just use Sergger Jlink to print some log/data in my test, I guess in this case Jlink may not send data using RXD(J15).