Difference between revisions of "dw1000 ranging demo"

From InCircuit
Jump to: navigation, search
(Overview)
(Download)
Line 44: Line 44:
  
 
==Download==
 
==Download==
The dw1000_ranging_demo can be found at our [http://wiki.in-circuit.de/index.php5?title=radino_Library#Downloads radino library].
+
The dw1000 ranging demo can be found at our [http://wiki.in-circuit.de/index.php5?title=radino_Library#Downloads radino library].

Revision as of 13:50, 28 March 2017

Overview

The dw1000 ranging demo is a measurement example for the DW1000 at the radino32 DW1000. The dw1000 ranging demo on radino32 DW1000 modules is optimized for radino spiders with ultra-wideband antenna. The demo is based on the DW1000 library by Thomas Trojer.

Configuration

At the first part of the sketch the hardware has to be configured.

Defines for ANCHOR (WE_ARE_ANCHOR == 1) or TAG (WE_ARE_ANCHOR == 0) mode on DW1000. At the third mode (WE_ARE_ANCHOR == 2), the read input from pin (PIN_READMODE) will set the TAG (internal pull-up) or the ANCHOR (connect to ground) mode. One ANCHOR can handle up to six TAGs.

#define WE_ARE_ANCHOR      0
#define PIN_READMODE      A1

Set an individual short address for every device (for ANCHOR and for TAG)

#define MY_SHORT_ADDRESS   0x1234

Set the TX power in dBm from 0 to 33.5 in steps of 0.5. If the value is too high, the signals may overdrive and the results distort. Activate only, if you known your local wireless regulations.

//#define DW_TX_POWER      33.5

If set to 1, the Anchor regularly prints out a table of known devices. Else it prints every ranging event separately.

#define PRINT_DEVICE_TABLE  1

LED toggles on successful measurement. Set to 0xFF to deactivate functionality. Default on pin 13 for led L on radino spider.

#define PIN_LED 13

Set where to printout information. Serial for serial communication by USB and Serial1 for communication by the UART port.

#define SerialOut if(Serial)Serial
#define SerialOutBegin() Serial.begin()

Here you can set actions to execute when a TAG gets near an ANCHOR. MODULE_NEAR_VALUE in meters and MODULE_NEAR_TIMEOUT in milliseconds.

#define MODULE_NEAR_VALUE    1.0
#define MODULE_NEAR_TIMEOUT  300

Activate (#if 1) or deactivate (#if 0) output signal for a near TAG at ANCHOR

  • MODULE_NEAR_INIT : Executed during setup()
  • MODULE_NEAR_ON : Executed when any tag is nearer than MODULE_NEAR_VALUE for at least MODULE_NEAR_TIMEOUT
  • MODULE_NEAR_OFF : Executed when no tag is nearer than MODULE_NEAR_VALUE
#if 0
#define MODULE_NEAR_INIT() do{ pinMode(22,OUTPUT); }while(0)
#define MODULE_NEAR_ON() do{ digitalWrite(22,HIGH); }while(0)
#define MODULE_NEAR_OFF() do{ digitalWrite(22,LOW); }while(0)
#else
#define MODULE_NEAR_INIT() do{}while(0)
#define MODULE_NEAR_ON() do{}while(0)
#define MODULE_NEAR_OFF() do{}while(0)
#endif

Download

The dw1000 ranging demo can be found at our radino library.

Personal tools