DWM1000 and DW1000 compatibility

Hello. I would like to know if DWM1000 and DW1000 are compatible. That is, if I have a DW1000 as a tag and a DWM1000 as an anchor, will it work?

Example:

This DW1000: ESP32 UWB(Ultra Wideband) | Makerfabs
With this DWM1000: Decawave now Qorvo DWM1000 | Symmetry Electronics

Yes.

DW1000 = The radio chip on its own, not what you linked to.
DWM1000 = A module containing a DW1000 chip, antenna, clock and a few other parts needed to make the DW1000 hardware work.

Both give an SPI interface for the software to configure and drive the chip. You will need to configure and drive them appropriately but that would be the same even if you used identical hardware.

The link you have as DW1000 looks like it’s actually some third party copy of a DWM1000 attached to the processor board. Either way they should be compatible.

The only thing to double check is which bands the antennas support. The DWM1000 antenna is good for any of the supported radio bands, the link you gave for “DW1000” doesn’t indicate clearly if their antenna design is good for both bands or just one.

1 Like

Thank you very much for your answer. helped me.

I have another question: if I have the DWM1000 module connected, but it does not send or receive data. How much energy does it consume?

I mean the tag. I will connect it with a 600mAh battery and I want to know how much usage time the battery will have.

I read that the DWM1000 draws 160 mAh, I guess that’s when in use right? How much does it consume when not in use?

That depends on the mode it’s in, receive enabled but nothing to receive, idle or sleep. The data sheet will give you power consumption numbers for each mode.

Thanks for your answer. I hope not to bother, but can you tell me more about those 3 modes?

  1. Enabled but nothing to receive
  2. Idle
  3. Sleep

(I think the 1st is clear, but, it’s not bad to give a little explanation for newbies who want to learn like me).

According to the DWM1000 datasheet (page 12): https://www.decawave.com/sites/default/files/resources/DWM1000-Datasheet-V1.6.pdf

Supply current IDLE mode: 13.4 mA
Supply current INIT mode: 3.5mA
TX : 3.3 V supplies (VDDAON, VDD): 140 mA
RX : 3.3 V supplies (VDDAON, VDD): 160 mA

It wasn’t 100% clear to me because I don’t know which is which.

If the chip is doing nothing - you’ve initialised it, configured the radio etc… but not enabled receive then it’s the IDLE mode number, 13.4 mA.

If you’ve enabled receive and it’s listening for a signal but there is nothing there so it sits listening then it’s RX, 160 mA. This is why there is an option for a receive timeout, in battery powered modes you don’t want to sit in this state for a long time if there is nothing to hear.

If you put it onto sleep mode then it’s 3.5 mA but you will need to wake it from that mode, which takes a short while because the PLL will need to restart, before you can do anything else.

Thank you very much for your valuable answer.

I am using Arduino. Here is the library for DWM1000: arduino-dw1000/DW1000Ranging_TAG.ino at master · thotro/arduino-dw1000 · GitHub

You can see that in the loop it has: DW1000Ranging.loop();

Is there a way to turn it off when I’m not using it? So that it consumes 3.5mA. It occurs to me to place a conditional in the loop to disable the DW1000Ranging.loop(); when I press the button. What do you think?

Something along those lines is possible, DW1000.h defines two functions

    /**
    Enable deep sleep mode
    */
    static void deepSleep();

    /**
    Wake-up from deep sleep by toggle chip select pin
    */
    static void spiWakeup();

So it looks like the library has some support for sleep mode. You’ll just need to add the logic to control when to enter and exit that mode.

1 Like

I used the library and it works fine, but that code that I sent you with DW1000Ranging.loop(); it is always waiting to receive data. That is, it always consumes 160mA.

I am reading in the description of that library and it says that it has in TO-DO the improvements of the sleep function (GitHub - thotro/arduino-dw1000: A library that offers functionality to use Decawave's DW1000 chips/modules with Arduino.). I will ask in the Arduino forums to know more clearly how to use it:

However, in case I don’t want to use a sleep function as such, I just remove DW1000Ranging.loop(); as you say, so that he stops expecting to receive information, right? Do you think it will work?

Example:

void sleepControl() {
  if (button == 1) {
    //Enable UWB
    DW1000Ranging.loop();
  }
  //Disable UWB
  else if (button == 2) {
    Serial.println("Waiting");
  }
}

Do you think it will work to make the module sleep? Is there something I’m not seeing? Remember that I am a newbie.

It depends on the state DW1000Ranging.loop() leaves the part in when it exits. You may need to put something like a command to return to idle where you have the print “Waiting”.

An arduino forum is probably more appropriate for how best to implement this since it’s a code structure and library issue rather than anything to do with the DW1000 itself. If nothing else it’ll have more people on, this isn’t exactly a high traffic board.

1 Like

@AndyA, Look at my code. Give me your opinion, please.

// currently tag is module #5
// The purpose of this code is to set the tag address and antenna delay to default.
// this tag will be used for calibrating the anchors.
#include <SPI.h>
#include "DW1000Ranging.h"
#include "DW1000.h"

#define SPI_SCK 18
#define SPI_MISO 19
#define SPI_MOSI 23
#define DW_CS 4

// connection pins
const uint8_t PIN_RST = 27; // reset pin
const uint8_t PIN_IRQ = 34; // irq pin
const uint8_t PIN_SS = 4;   // spi select pin

// TAG antenna delay defaults to 16384
// leftmost two bytes below will become the "short address"
char tag_addr[] = "7D:00:22:EA:82:60:3B:9C";

void setup()
{
  Serial.begin(115200);
  delay(1000);

  //init the configuration
  SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
  DW1000Ranging.initCommunication(PIN_RST, PIN_SS, PIN_IRQ); //Reset, CS, IRQ pin

  DW1000Ranging.attachNewRange(newRange);
  DW1000Ranging.attachNewDevice(newDevice);
  DW1000Ranging.attachInactiveDevice(inactiveDevice);

  // start as tag, do not assign random short address
  DW1000Ranging.startAsTag(tag_addr, DW1000.MODE_LONGDATA_RANGE_LOWPOWER, false); 
}

void loop() { 
  DW1000Ranging.loop();
  if (Serial.available()) {
    int state = Serial.parseInt();
    if (state == 1) {
     DW1000Ranging.loop();
     Serial.println("ON");
    }
    if (state == 2) {
     DW1000.deepSleep();
     Serial.println("OFF");
    }  
  }
}

void newRange()
{
  Serial.print(DW1000Ranging.getDistantDevice()->getShortAddress(), HEX);
  Serial.print(",");
  Serial.println(DW1000Ranging.getDistantDevice()->getRange());
}

void newDevice(DW1000Device *device)
{
  Serial.print("Device added: ");
  Serial.println(device->getShortAddress(), HEX);
}

void inactiveDevice(DW1000Device *device)
{
  Serial.print("delete inactive device: ");
  Serial.println(device->getShortAddress(), HEX);
}

Inside the loop I place:


void loop() { 
  DW1000Ranging.loop();
  if (Serial.available()) {
    int state = Serial.parseInt();
    if (state == 1) {
     DW1000Ranging.loop();
     Serial.println("ON");
    }
    if (state == 2) {
     DW1000.deepSleep();
     Serial.println("OFF");
    }  
  }
}

When I press 2 it turns off, but if I press 1 it doesn’t turn back on.


The following does work, but it’s unorthodox (because I force restart my module). I am looking for a way to put the module to sleep and wake up.

As you can see, I’ve tried several, but they don’t work:


void loop() { 

  DW1000Ranging.loop();
  
  if (Serial.available()) {
    int state = Serial.parseInt();
    if (state == 1) {
     Serial.println("ON");
     ESP.restart();
     
     //DW1000.spiWakeup();
     //delay(500);
     //DW1000.reset();
     //DW1000.softReset();
     //delay(200);
     //DW1000Ranging.loop();
     
    }
    if (state == 2) {
     Serial.println("OFF");
     DW1000.deepSleep();

    }
  }
  
}

If you remove the first loop() then loop is only called when serial data is entered.
Try something more like

bool sleepMode = false;
void loop() { 
  if (!sleepMode)
    DW1000Ranging.loop();

  if (Serial.available()) {
    int state = Serial.parseInt();
    if (state == 1) {
      sleepMode = false;
      DW1000.spiWakeup();
      // don't know if some other re-initialisation will also be required here or not.
      // maybe try a short wait and then soft reset if it doesn't work as is.
      Serial.println("ON");
   }
   if (state == 2) {
     sleepMode = true;
     DW1000.deepSleep();
     Serial.println("OFF");
   }  
 }
}
1 Like

Code:

void loop() { 
  if (!sleepMode) {
    DW1000Ranging.loop();
  }
  if (Serial.available()) {
    int state = Serial.parseInt();
    if (state == 1) {
     sleepMode = false;
     DW1000.spiWakeup();
     Serial.println("ON");
     //ESP.restart();
     //DW1000.reset();
     //DW1000.softReset();
    }
    if (state == 2) {
      sleepMode = true;
      DW1000.deepSleep();
      Serial.println("OFF");
    }
  }  
}

I think something else is needed to sleep or wake up, there is something we are missing. Look at the code sequence:

1st test sleepMode false

  1. Start the DW1000Ranging.loop();
  2. I press 2 to turn it off and it goes to sleep.
  3. If I press 2 nothing happens, in that case it is recorded that it was disconnected from the device before. I press 2 again and nothing happens.

Screen Shot 2022-03-17 at 10.22.52 AM


2nd test sleepMode true:

  1. By default DW1000Ranging.loop(); does not start
  2. I press 1 and it does start.
  3. I press 2 to put him to sleep and he does sleep.
  4. I press 1 to wake it up again and nothing happens.

It tells me that the error is when I press 2. Because at first it did work.


3nd test without DW1000.deepSleep();:

If I remove DW1000.deepSleep(); it works. That is, it turns the loop on and off. My question is: is it actually sleeping or not? Does it still consume 160mAh?


void loop() { 
  if (!sleepMode) {
    DW1000Ranging.loop();
  }
  if (Serial.available()) {
    int state = Serial.parseInt();
    if (state == 1) {
     sleepMode = false;
     Serial.println("ON");
    }
    if (state == 2) {
      sleepMode = true;
      Serial.println("OFF");
    }
  }  
}

If you remove the sleep command or start with sleepMode = false; then the module isn’t sleeping, all that’s happening is that you’re not calling the loop function. If you’re not calling the loop function then it’s not going to output a range no matter what power mode the part is in.

As I said, you may need to do some re-initialisation after waking from sleep. This will depend on the library. Currently the only times it’s working are when you’ve never put it to sleep.

If you want to know how much power it’s using then measure the power usage. You can’t guess that sort of thing, you need to measure it just like you would the power consumption for any other part.