LED Control using Proximity on NRF52811 evaluation Board (ublox BMD 360)

Hello Everyone, 

I am using  NRF52811 evaluation board  for my development purpose using SDK 2.6.1 on visual studio code. 

My tasks involve LED control using Bluetooth as follows.

task 1: Turn on/off LEDs using button press on user device(NRF connect on android phone)

task 2: turn on/off LEDs using distance of 5 meter Exceed: for example LED should turn on in distance of 5 meter or less.

I have already  implemented task 1 but can anyone guide me how I can connect and control LEDs  in accordance with the distance. 

Id there any example available which I can use to connect to my  nrf52811 BLE board  and control LED   using distance. 

Parents
  • Calculating distance can be done two ways.

    1. Use the Distance Measurement lib which is a proprietary way to calculate the distance. You can try this using the sample provided here and some discussions in this forum like this one can be found.
    2. Use obtained RSSI value to evaluate a very rough estimate of the distance and change the LED status at whichever RSSI you find is the proper range for a given distance.
  • Hello Thank For your response. I am trying to implement the solution suggest by you using DM library. I am using bmd360 evaultion kit which has nRF52811 soc and  using build configuration nRF52840 DK nRF52811 . and i am  getting following error.  Can you help me to solve it. i have set necessary flag in proj.conf same as mentioned in sample.am i missing some more flag to set or reset ?

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/gd_ws/keyless-access-system-ble/ble_application
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.6.1/zephyr/.cache
    -- Zephyr version: 3.5.99 (C:/ncs/v2.6.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52840dk_nrf52811
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/cf2149caf2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.6.1/zephyr/boards/arm/nrf52840dk_nrf52811/nrf52840dk_nrf52811.dts
    -- Generated zephyr.dts: C:/gd_ws/keyless-access-system-ble/ble_application/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/gd_ws/keyless-access-system-ble/ble_application/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/gd_ws/keyless-access-system-ble/ble_application/build/zephyr/dts.cmake

    warning: Deprecated symbol BT_DEBUG_LOG is enabled.


    warning: Deprecated symbol BT_DEBUG_LOG is enabled.


    warning: Experimental symbol BT_DDFS is enabled.


    warning: Experimental symbol DM_MODULE is enabled.


    warning: Experimental symbol NRF_DM is enabled.


    warning: FPU (defined at soc/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.mcimx6x_m4:11, soc/arm/nxp_s32/s32k3\Kconfig.defconfig.s32k344:11, soc/arm/nxp_s32\s32ze\Kconfig.defconfig.series:15, soc/arm\renesas_rzt2m\Kconfig.defconfig:15, arch/Kconfig:847) has direct dependencies (SOC_MCIMX6X_M4 && SOC_SERIES_IMX_6X_M4) || (SOC_S32K344 && SOC_SERIES_S32K3XX) || SOC_SERIES_S32ZE_R52 || SOC_RENESAS_RZT2M || CPU_HAS_FPU with value n, but is currently being y-selected by the following symbols:
    - NRF_DM (defined at C:/ncs/v2.6.1/nrfxlib\nrf_dm/Kconfig:7), with value y, direct dependencies y (value: y), and select condition !SOC_NRF5340_CPUNET (value: y)

    error: Aborting due to Kconfig warnings

    Parsing C:/ncs/v2.6.1/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.6.1/zephyr/boards/arm/nrf52840dk_nrf52811/nrf52840dk_nrf52811_defconfig'
    Merged configuration 'C:/gd_ws/keyless-access-system-ble/ble_application/prj.conf'
    CMake Error at C:/ncs/v2.6.1/zephyr/cmake/modules/kconfig.cmake:358 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    C:/ncs/v2.6.1/nrf/cmake/modules/kconfig.cmake:29 (include)
    C:/ncs/v2.6.1/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
    C:/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:2 (find_package)


    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\cf2149caf2\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe '-Bc:\gd_ws\keyless-access-system-ble\ble_application\build' -GNinja -DBOARD=nrf52840dk_nrf52811 -DNCS_TOOLCHAIN_VERSION=NONE '-Sc:\gd_ws\keyless-access-system-ble\ble_application'

    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

Reply
  • Hello Thank For your response. I am trying to implement the solution suggest by you using DM library. I am using bmd360 evaultion kit which has nRF52811 soc and  using build configuration nRF52840 DK nRF52811 . and i am  getting following error.  Can you help me to solve it. i have set necessary flag in proj.conf same as mentioned in sample.am i missing some more flag to set or reset ?

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/gd_ws/keyless-access-system-ble/ble_application
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.6.1/zephyr/.cache
    -- Zephyr version: 3.5.99 (C:/ncs/v2.6.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52840dk_nrf52811
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/cf2149caf2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.6.1/zephyr/boards/arm/nrf52840dk_nrf52811/nrf52840dk_nrf52811.dts
    -- Generated zephyr.dts: C:/gd_ws/keyless-access-system-ble/ble_application/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/gd_ws/keyless-access-system-ble/ble_application/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/gd_ws/keyless-access-system-ble/ble_application/build/zephyr/dts.cmake

    warning: Deprecated symbol BT_DEBUG_LOG is enabled.


    warning: Deprecated symbol BT_DEBUG_LOG is enabled.


    warning: Experimental symbol BT_DDFS is enabled.


    warning: Experimental symbol DM_MODULE is enabled.


    warning: Experimental symbol NRF_DM is enabled.


    warning: FPU (defined at soc/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.mcimx6x_m4:11, soc/arm/nxp_s32/s32k3\Kconfig.defconfig.s32k344:11, soc/arm/nxp_s32\s32ze\Kconfig.defconfig.series:15, soc/arm\renesas_rzt2m\Kconfig.defconfig:15, arch/Kconfig:847) has direct dependencies (SOC_MCIMX6X_M4 && SOC_SERIES_IMX_6X_M4) || (SOC_S32K344 && SOC_SERIES_S32K3XX) || SOC_SERIES_S32ZE_R52 || SOC_RENESAS_RZT2M || CPU_HAS_FPU with value n, but is currently being y-selected by the following symbols:
    - NRF_DM (defined at C:/ncs/v2.6.1/nrfxlib\nrf_dm/Kconfig:7), with value y, direct dependencies y (value: y), and select condition !SOC_NRF5340_CPUNET (value: y)

    error: Aborting due to Kconfig warnings

    Parsing C:/ncs/v2.6.1/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.6.1/zephyr/boards/arm/nrf52840dk_nrf52811/nrf52840dk_nrf52811_defconfig'
    Merged configuration 'C:/gd_ws/keyless-access-system-ble/ble_application/prj.conf'
    CMake Error at C:/ncs/v2.6.1/zephyr/cmake/modules/kconfig.cmake:358 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    C:/ncs/v2.6.1/nrf/cmake/modules/kconfig.cmake:29 (include)
    C:/ncs/v2.6.1/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
    C:/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:2 (find_package)


    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\cf2149caf2\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe '-Bc:\gd_ws\keyless-access-system-ble\ble_application\build' -GNinja -DBOARD=nrf52840dk_nrf52811 -DNCS_TOOLCHAIN_VERSION=NONE '-Sc:\gd_ws\keyless-access-system-ble\ble_application'

    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

Children
No Data
Related