1.. _bt610: 2 3Ezurio Sentrius BT610 Sensor 4############################ 5 6Overview 7******** 8 9The Sentrius™ BT610 Sensor is a battery powered, Bluetooth v5 Long Range 10integrated sensor platform that uses a Nordic Semiconductor nRF52840 ARM 11Cortex-M4F CPU. 12 13The sensor has the following features: 14 15* :abbr:`ADC (Analog to Digital Converter)` 16* CLOCK 17* FLASH 18* :abbr:`GPIO (General Purpose Input Output)` 19* :abbr:`I2C (Inter-Integrated Circuit)` 20* :abbr:`MPU (Memory Protection Unit)` 21* :abbr:`NVIC (Nested Vectored Interrupt Controller)` 22* :abbr:`PWM (Pulse Width Modulation)` 23* :abbr:`QSPI (Quad Serial Peripheral Interface)` 24* RADIO (Bluetooth Low Energy and 802.15.4) 25* :abbr:`RTC (nRF RTC System Clock)` 26* Segger RTT (RTT Console) 27* :abbr:`SPI (Serial Peripheral Interface)` 28* :abbr:`UART (Universal Asynchronous Receiver-Transmitter)` 29* :abbr:`WDT (Watchdog Timer)` 30 31.. figure:: img/bt610_front.jpg 32 :align: center 33 :alt: Sentrius BT610 Sensor, front view 34 35 Sentrius BT610 Sensor, front view 36 37.. figure:: img/bt610_back.jpg 38 :align: center 39 :alt: Sentrius BT610 Sensor, rear view 40 41 Sentrius BT610 Sensor, rear view 42 43More information about the board can be found at the 44`Sentrius BT610 website`_. 45 46Hardware 47******** 48 49Supported Features 50================== 51 52The BT610 Sensor supports the following 53hardware features: 54 55+-----------+------------+----------------------+ 56| Interface | Controller | Driver/Component | 57+===========+============+======================+ 58| ADC | on-chip | adc | 59+-----------+------------+----------------------+ 60| CLOCK | on-chip | clock_control | 61+-----------+------------+----------------------+ 62| FLASH | on-chip | flash | 63+-----------+------------+----------------------+ 64| GPIO | on-chip | gpio | 65+-----------+------------+----------------------+ 66| I2C(M) | on-chip | i2c | 67+-----------+------------+----------------------+ 68| MPU | on-chip | arch/arm | 69+-----------+------------+----------------------+ 70| NVIC | on-chip | arch/arm | 71+-----------+------------+----------------------+ 72| PWM | on-chip | pwm | 73+-----------+------------+----------------------+ 74| QSPI | on-chip | qspi | 75+-----------+------------+----------------------+ 76| RADIO | on-chip | Bluetooth, | 77| | | ieee802154 | 78+-----------+------------+----------------------+ 79| RTC | on-chip | system clock | 80+-----------+------------+----------------------+ 81| RTT | Segger | console | 82+-----------+------------+----------------------+ 83| SPI(M) | on-chip | spi | 84+-----------+------------+----------------------+ 85| UART | on-chip | serial | 86+-----------+------------+----------------------+ 87| WDT | on-chip | watchdog | 88+-----------+------------+----------------------+ 89 90.. figure:: img/bt610_board.jpg 91 :align: center 92 :alt: Sentrius BT610 Sensor, board layout 93 94 Sentrius BT610 Sensor, board layout 95 96Connections and IOs 97=================== 98 99LED 100--- 101 102Two LEDs are visible through the BT610 housing lid. Note that the LEDs can be 103driven either directly, or via PWM. PWM should be used when current consumption 104is required to be minimised. 105 106* LED_1 (red) = LED0 = P1.07 (Red LED 1) 107* LED_2 (green) = LED1 = P1.03 (Green LED 2) 108 109* LED_PWM_1 (red) = LED0PWM = P1.07 (Red PWM LED 1) 110* LED_PWM_2 (green) = LED1PWM = P1.03 (Green PWM LED 2) 111 112Push button 113------------ 114 115The BT610 incorporates three mechanical push buttons. Note these are only 116accessible with the housing cover removed. 117 118Two of the buttons are available for use via the board DTS file, as follows. 119 120* BUTTON_1 = SW0 = P0.24 (Boot button SW1) 121* BUTTON_2 = SW1 = P1.01 (Tamper switch SW2) 122 123A third mechanical push button is provided to allow reset of the on-board 124microcontroller. 125 126Magnetoresistive sensor 127----------------------- 128 129The BT610 incorporates a Honeywell SM351LT magnetoresistive sensor. Refer to 130the `Honeywell SM351LT datasheet`_ for further details. 131 132* MAG_1 = SW2 = P1.15 (SM3531LT_0) 133 134External flash memory 135--------------------- 136 137A 64Mbit external flash memory part is available for storage of application 138images and data. Refer to the `Macronix MX25R6435FZNIL0 datasheet`_ for further 139details. 140 141The flash memory is connected to the on-board QSPI device controller. 142 143* MX25R64 = QSPI 144 145Voltage reference 146----------------- 147 148A precision 2.5V voltage reference is provided on the V_REF input for use 149during AD measurements. 150 151This can deliver up to 50mA peak and 20mA continuous current. 152 153 154Sensor connectivity 155------------------- 156 157The BT610 incorporates three terminal blocks J5, J6 & J7 that allow 158connectivity to its sensor inputs, as follows. 159 160Terminal Block J5 161----------------- 162 163+-----------+------------------------+----------------------------+-----------+ 164| Pin No. | Name | Description | Direction | 165+===========+========================+============================+===========+ 166| 1 | EXT_SPI_CS_2 | External SPI CS 2 | OUT | 167+-----------+------------------------+----------------------------+-----------+ 168| 2 | GND | GND | (N/A) | 169+-----------+------------------------+----------------------------+-----------+ 170| 3 | AIN4 | Analog Input 4 | IN | 171+-----------+------------------------+----------------------------+-----------+ 172| 4 | AIN3 | Analog Input 3 | IN | 173+-----------+------------------------+----------------------------+-----------+ 174| 5 | GND | GND | (N/A) | 175+-----------+------------------------+----------------------------+-----------+ 176| 6 | AIN2 | Analog Input 2 | IN | 177+-----------+------------------------+----------------------------+-----------+ 178| 7 | AIN1 | Analog Input 1 | IN | 179+-----------+------------------------+----------------------------+-----------+ 180| 8 | GND | GND | (N/A) | 181+-----------+------------------------+----------------------------+-----------+ 182| 9 | DIN2 | Digital Input 2 | IN | 183+-----------+------------------------+----------------------------+-----------+ 184| 10 | DO2 | Digital Output 2 | OUT | 185+-----------+------------------------+----------------------------+-----------+ 186 187Terminal Block J6 188----------------- 189 190+-----------+------------------------+----------------------------+-----------+ 191| Pin No. | Name | Description | Direction | 192+===========+========================+============================+===========+ 193| 1 | DO1 | Digital Output 1 | OUT | 194+-----------+------------------------+----------------------------+-----------+ 195| 2 | DIN1 | Digital Input 1 | IN | 196+-----------+------------------------+----------------------------+-----------+ 197| 3 | GND | GND | (N/A) | 198+-----------+------------------------+----------------------------+-----------+ 199| 4 | THERM4 | Thermistor Input 4 | IN | 200+-----------+------------------------+----------------------------+-----------+ 201| 5 | THERM3 | Thermistor Input 3 | IN | 202+-----------+------------------------+----------------------------+-----------+ 203| 6 | GND | GND | (N/A) | 204+-----------+------------------------+----------------------------+-----------+ 205| 7 | THERM2 | Thermistor Input 2 | IN | 206+-----------+------------------------+----------------------------+-----------+ 207| 8 | THERM1 | Thermistor Input 1 | IN | 208+-----------+------------------------+----------------------------+-----------+ 209| 9 | GND | GND | (N/A) | 210+-----------+------------------------+----------------------------+-----------+ 211| 10 | B+ OUT | Ext. sensor power supply | (N/A) | 212+-----------+------------------------+----------------------------+-----------+ 213 214Terminal Block J7 215----------------- 216 217+-----------+------------------------+----------------------------+-----------+ 218| Pin No. | Name | Description | Direction | 219+===========+========================+============================+===========+ 220| 1 | UART_1_RTS | UART 1 RTS | IN | 221+-----------+------------------------+----------------------------+-----------+ 222| 2 | UART_1_CTS | UART 1 CTS | OUT | 223+-----------+------------------------+----------------------------+-----------+ 224| 3 | UART_1_RXD | UART 1 RXD | IN | 225+-----------+------------------------+----------------------------+-----------+ 226| 4 | UART_1_TXD | UART 1 TXD | OUT | 227+-----------+------------------------+----------------------------+-----------+ 228| 5 | EXT_I2C_SCL | External I2C SCL | OUT | 229+-----------+------------------------+----------------------------+-----------+ 230| 6 | EXT_I2C_SDA | External I2C SDA | IN/OUT | 231+-----------+------------------------+----------------------------+-----------+ 232| 7 | EXT_SPI_CLK/TRACEDATA3 | Ext. SPI CLK/TRACE DATA 3 | OUT | 233+-----------+------------------------+----------------------------+-----------+ 234| 8 | EXT_SPI_MISO | External SPI MISO | IN | 235+-----------+------------------------+----------------------------+-----------+ 236| 9 | EXT_SPI_MOSI | External SPI MOSI | OUT | 237+-----------+------------------------+----------------------------+-----------+ 238| 10 | EXT_SPI_CS_1 | External SPI CS 1 | OUT | 239+-----------+------------------------+----------------------------+-----------+ 240 241Analog inputs 242------------- 243 244The four external Analog Inputs are multiplexed to a single host 245microcontroller AD input, AIN_1, via a TI TMUX1204 multiplexer. 246 247Refer to the `TI TMUX1204 datasheet`_ for further details. 248 249Signals up to 12V, to a maximum of 50mA, can be applied to the external Analog 250Inputs. 251 252External Analog Input connections are made to the multiplexer as follows. 253 254+--------------+--------------+ 255| Input | MUX Input | 256+==============+==============+ 257| AIN1 | S1 | 258+--------------+--------------+ 259| AIN2 | S2 | 260+--------------+--------------+ 261| AIN3 | S3 | 262+--------------+--------------+ 263| AIN4 | S4 | 264+--------------+--------------+ 265 266A TI TCA9538 port expander is used to determine the mode of each Analog Input, 267for either voltage or current measurement, and also to control the mutliplexer. 268A high level applied to the appropriate expander port pin enables the 269associated analog input as a current input; when a low logic level is applied, 270voltage measurement mode is selected. 271 272Refer to the `TI TCA9538 datasheet`_ for further details. 273 274The expander port connections are as follows. 275 276+--------------+---------------+ 277| Pin | Function | 278+==============+===============+ 279| P0 | AIN1 mode | 280+--------------+---------------+ 281| P1 | AIN2 mode | 282+--------------+---------------+ 283| P2 | AIN3 mode | 284+--------------+---------------+ 285| P3 | AIN4 mode | 286+--------------+---------------+ 287| P4 | MUX A0 | 288+--------------+---------------+ 289| P5 | MUX A1 | 290+--------------+---------------+ 291| P6 | (N/C) | 292+--------------+---------------+ 293| P7 | (N/C) | 294+--------------+---------------+ 295 296The following illustrates some possible configuration values for the port 297expander. Note that it is possible for combinations of voltage and current 298measurement to be applied such that some external Analog Inputs measure current 299and others voltage. This is not shown below. 300 301+----------------+------------------------------+ 302| Expander value | Selected Analog Input & mode | 303+================+==============================+ 304| b'00000000' | AIN1, voltage measurement | 305+----------------+------------------------------+ 306| b'00000001' | AIN1, current measurement | 307+----------------+------------------------------+ 308| b'00010000' | AIN2, voltage measurement | 309+----------------+------------------------------+ 310| b'00010010' | AIN2, current measurement | 311+----------------+------------------------------+ 312| b'00100000' | AIN3, voltage measurement | 313+----------------+------------------------------+ 314| b'00100100' | AIN3, current measurement | 315+----------------+------------------------------+ 316| b'00110000' | AIN4, voltage measurement | 317+----------------+------------------------------+ 318| b'00111000' | AIN4, current measurement | 319+----------------+------------------------------+ 320 321Circuitry associated with the analog input measurements can be disabled when 322not in use. 323 324A GPIO is used to control this behaviour, as shown below. 325 326+----------------+-----------+ 327| ANALOG_ENABLE | Behaviour | 328+================+===========+ 329| 0 | Disabled | 330+----------------+-----------+ 331| 1 | Enabled | 332+----------------+-----------+ 333 334Thermistor inputs 335----------------- 336 337The four external thermistor inputs are connected to a single AD input, AIN_2, 338via a TI TMUX1204 multiplexer. 339 340Refer to the `TI TMUX1204 datasheet`_ for further details. 341 342External analog input connections are made to the multiplexer as follows. 343 344+--------------+--------------+ 345| Input | MUX Input | 346+==============+==============+ 347| THERM1 | S1 | 348+--------------+--------------+ 349| THERM2 | S2 | 350+--------------+--------------+ 351| THERM3 | S3 | 352+--------------+--------------+ 353| THERM4 | S4 | 354+--------------+--------------+ 355 356The same port expander used to select external analog inputs is also used to 357select external thermistor inputs. 358 359The table below defines possible values that can be written. 360 361+----------------+-----------------------+ 362| Expander value | Selected Analog Input | 363+================+=======================+ 364| b'00000000' | THERM1 | 365+----------------+-----------------------+ 366| b'00010000' | THERM2 | 367+----------------+-----------------------+ 368| b'00100000' | THERM3 | 369+----------------+-----------------------+ 370| b'00110000' | THERM4 | 371+----------------+-----------------------+ 372 373A GPIO line is used to enable electronics associated with thermistor 374measurement. This is controlled as shown below. 375 376+----------------+-----------------------+ 377| THERM_ENABLE | Behaviour | 378+================+=======================+ 379| 0 | Enabled | 380+----------------+-----------------------+ 381| 1 | Disabled | 382+----------------+-----------------------+ 383 384Note the thermistor circuit must be calibrated before use. A suggested method 385for achieving this is described in the 386`BT610 Zephyr Application Thermistor Calibration`_ application note. 387 388Digital inputs 389-------------- 390 391Two external digital inputs are available for connection to external signals. 392For the digital level being applied to be detected, an appropriate output pin 393must first be set. This approach is taken to ensure supporting circuitry can be 394powered down when the input state is not being determined. When in use, the 395external digital input level can be read from the appropriate input pin. 396 397The output and input pins required are as follows. 398 399+----------------+----------------+ 400| Enable Pin | Input Read Pin | 401+================+================+ 402| DIN_1_ENABLE | DIN_1 | 403+----------------+----------------+ 404| DIN_2_ENABLE | DIN_2 | 405+----------------+----------------+ 406 407Digital outputs 408--------------- 409 410Two external digital outputs are available to provide signals to or to directly 411drive external equipment. 412 413To provide a high level on the external digital output, a high logic level is 414applied to the appropriate host microcontroller output. 415 416The output pins required are as follows. 417 418+----------------+--------------------------+ 419| Output Pin | External Sensor Terminal | 420+================+==========================+ 421| DO_1_MCU | DO1 | 422+----------------+--------------------------+ 423| DO_2_MCU | DO2 | 424+----------------+--------------------------+ 425 426External power supply 427--------------------- 428 429Power can be supplied to external sensors via the B+ OUT terminal. This is 430enabled by setting the BATTERY_OUTPUT_ENABLE GPIO line. In addition, the 431external supply can be boosted to 5V by setting the HIGH_SUPPLY_ENABLE GPIO 432line. When 5V is not selected, the external power supply follows the 433battery voltage. 434 435Up to 50mA peak and 20mA continuous current can be delivered by the External 436Power Supply. 437 438External sensor I2C port 439------------------------ 440 441External I2C sensors can be connected on the external I2C port. Note that 442external I2C sensors should be powered from the B+ terminal to ensure applied 443voltage levels match those expected internally by the board. 444 445Required pins are as follows. 446 447+-------------+--------------------------+ 448| Output Pin | External Sensor Terminal | 449+=============+==========================+ 450| SCL_PIN | EXT_I2C_SCL | 451+-------------+--------------------------+ 452| SDA_PIN | EXT_I2C_SDA | 453+-------------+--------------------------+ 454 455 456External sensor SPI port 457------------------------ 458 459Up to 2 external SPI sensors can be connected on the external SPI port. Note 460that external SPI sensors should be powered from the B+ terminal to ensure 461applied voltage levels match those expected internally by the board. 462 463Required pins are as follows. 464 465+-------------+--------------------------+ 466| Output Pin | External Sensor Terminal | 467+=============+==========================+ 468| SCK_PIN | EXT_I2C_SCL | 469+-------------+--------------------------+ 470| MOSI_PIN | EXT_I2C_SDA | 471+-------------+--------------------------+ 472| MISO_PIN | EXT_SPI_MISO | 473+-------------+--------------------------+ 474| SDA_PIN | EXT_I2C_SDA | 475+-------------+--------------------------+ 476| CS_GPIOS | EXT_I2C_SDA | 477+-------------+--------------------------+ 478| CS_GPIOS | EXT_I2C_SDA | 479+-------------+--------------------------+ 480 481 482Programming and Debugging 483************************* 484 485Applications for the ``bt610`` board configuration can be 486built and flashed in the usual way (see :ref:`build_an_application` 487and :ref:`application_run` for more details); however, the standard 488debugging targets are not currently available. 489 490The BT610 features a 10 way header, J3, for connection of a 491programmer/debugger, with pinout as follows. 492 493+-----------+------------+----------------------+ 494| Pin No. | Name | Description | 495+===========+============+======================+ 496| 1 | 3.3V | Power Supply, 3.3V | 497+-----------+------------+----------------------+ 498| 2 | SWDIO | Data Input/Output | 499+-----------+------------+----------------------+ 500| 3 | GND | GND | 501+-----------+------------+----------------------+ 502| 4 | SWDCLK | Clock Pin | 503+-----------+------------+----------------------+ 504| 5 | GND | GND | 505+-----------+------------+----------------------+ 506| 6 | SWO | Trace Output Pin | 507+-----------+------------+----------------------+ 508| 7 | (N/C) | Not Connected | 509+-----------+------------+----------------------+ 510| 8 | (N/C) | Not Connected | 511+-----------+------------+----------------------+ 512| 9 | GND | GND | 513+-----------+------------+----------------------+ 514| 10 | nRESET | Reset Pin | 515+-----------+------------+----------------------+ 516 517Access to the sensor debug UART is facilitated by a 6 pin header, J1, with 518pinout as follows. 519 520+-----------+------------+----------------------+-----------+ 521| Pin No. | Name | Description | Direction | 522+===========+============+======================+===========+ 523| 1 | GND | GND | N/A | 524+-----------+------------+----------------------+-----------+ 525| 2 | UART_0_RTS | UART 0 RTS Pin | IN | 526+-----------+------------+----------------------+-----------+ 527| 3 | 3.3V | Power Supply, 3.3V | N/A | 528+-----------+------------+----------------------+-----------+ 529| 4 | UART_0_RX | UART 0 RX Pin | IN | 530+-----------+------------+----------------------+-----------+ 531| 5 | UART_0_TX | UART 0 TX Pin | OUT | 532+-----------+------------+----------------------+-----------+ 533| 6 | UART_0_CTS | UART 0 CTS Pin | OUT | 534+-----------+------------+----------------------+-----------+ 535 536Note that pin 3 requires a solder bridge to be closed to enable powering of the 537BT610 board via the UART connector. 538 539Flashing 540======== 541 542Follow the instructions in the :ref:`nordic_segger` page to install 543and configure all the necessary software. Further information can be 544found in :ref:`nordic_segger_flashing`. Then build and flash 545applications as usual (see :ref:`build_an_application` and 546:ref:`application_run` for more details). 547 548Here is an example for the :ref:`hello_world` application. 549 550First, run your favorite terminal program to listen for output. 551 552NOTE: On the BT610, the UART lines are at TTL levels and must be passed through 553an appropriate line driver circuit for translation to RS232 levels. Refer to 554the `MAX3232 datasheet`_ for a suitable driver IC. 555 556.. code-block:: console 557 558 $ minicom -D <tty_device> -b 115200 559 560Replace :code:`<tty_device>` with the port where the BT610 can be found. For 561example, under Linux, :code:`/dev/ttyUSB0`. 562 563Then build and flash the application in the usual way. 564 565.. zephyr-app-commands:: 566 :zephyr-app: samples/hello_world 567 :board: bt610 568 :goals: build flash 569 570Note that an external debugger is required to perform application flashing. 571 572Debugging 573========= 574 575The ``bt610`` board does not have an on-board J-Link debug IC 576as some nRF5x development boards, however, instructions from the 577:ref:`nordic_segger` page also apply to this board, with the additional step 578of connecting an external debugger. 579 580Testing Bluetooth on the BT610 581*********************************** 582Many of the Bluetooth examples will work on the BT610. 583Try them out: 584 585* :ref:`ble_peripheral` 586* :ref:`bluetooth-eddystone-sample` 587* :ref:`bluetooth-ibeacon-sample` 588 589 590Testing the LEDs and buttons on the BT610 591***************************************** 592 593There are 2 samples that allow you to test that the buttons (switches) and LEDs 594on the board are working properly with Zephyr: 595 596* :zephyr:code-sample:`blinky` 597* :zephyr:code-sample:`button` 598 599You can build and flash the examples to make sure Zephyr is running correctly 600on your board. The button, LED and sensor device definitions can be found in 601:zephyr_file:`boards/ezurio/bt610/bt610.dts`. 602 603 604References 605********** 606 607.. target-notes:: 608 609.. _Sentrius BT610 website: https://www.ezurio.com/iot-devices/iot-sensors/sentrius-bt610-io-sensor 610.. _Honeywell SM351LT datasheet: https://sensing.honeywell.com/honeywell-sensing-nanopower-series-datasheet-50095501-c-en.pdf 611.. _MAX3232 datasheet: https://www.ti.com/lit/ds/symlink/max3232.pdf 612.. _TI TMUX1204 datasheet: https://www.ti.com/lit/gpn/TMUX1204 613.. _TI TCA9538 datasheet: https://www.ti.com/lit/gpn/TCA9538 614.. _Macronix MX25R6435FZNIL0 datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7913/MX25R6435F,%20Wide%20Range,%2064Mb,%20v1.5.pdf 615.. _BT610 Zephyr Application Thermistor Calibration: https://www.ezurio.com/technology/bt610-thermistor-coefficient-calculator 616