current sensing

Hello everyone,
i'm trying to deal with the ACS714T sensor 
but i can't find any samples or guide through internet 
the communication need to be done through ADC and SAADC HAL
but i don't know from where to begin with this 
i tried the ADC sample on the Zephyr documentation to have a closer look but it didn't help me a lot
is there a guide on how to do with the sensors that are not premade by Nordic 
what do i need to do first to deal with this sensor ?  
i'm a bit lost with it 
can you give me some guidance please 
i would appreciate your help 

  • Hello,
    i found this tutorial ADC conf
    i tried to make something similar but i don't succeed to run it 
    i'm putting it below 
    please correct me 
    acs714 t.zip

  • Hello everyone,
    i created a new version of project based on ADC sample 
    on the NRF5340dk 
    but i think i'm missing something related to the overlay file 
    this is my projectp_adc.zip
    i'm keeping getting the error of the device tree it says #error "No suitable devicetree overlay specified"

    Rebuilding ‘C_COMPILER__app_’ from project ‘app/libapp.a’ from solution ‘build’ in configuration ‘Common’
    2> Compiling ‘main.c’
    2> C:\Users\rzaafouri\ncs\v1.7.0\toolchain\opt/bin/arm-none-eabi-gcc -DBUILD_VERSION=v2.6.99-ncs1 -DEXT_API_MAGIC=0x281ee6de,0xb845acea,13570 -DFIRMWARE_INFO_MAGIC=0x281ee6de,0x8fcebb4c,13570 -DKERNEL -DNRF5340_XXAA_APPLICATION -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/Users/rzaafouri/ncs/v1.7.0/zephyr/include -Izephyr/include/generated -IC:/Users/rzaafouri/ncs/v1.7.0/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/Users/rzaafouri/ncs/v1.7.0/nrf/include -IC:/Users/rzaafouri/ncs/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/rzaafouri/ncs/v1.7.0/modules/hal/nordic/nrfx -IC:/Users/rzaafouri/ncs/v1.7.0/modules/hal/nordic/nrfx/drivers/include -IC:/Users/rzaafouri/ncs/v1.7.0/modules/hal/nordic/nrfx/mdk -IC:/Users/rzaafouri/ncs/v1.7.0/zephyr/modules/hal_nordic/nrfx/. -isystem C:/Users/rzaafouri/ncs/v1.7.0/zephyr/lib/libc/minimal/include -isystem c:/users/rzaafouri/ncs/v1.7.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/rzaafouri/ncs/v1.7.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros C:/Users/rzaafouri/ncs/v1.7.0/Projects/p_adc/build_nrf5340dk_nrf5340_cpuapp_ns/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacros C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.7.0/Projects/p_adc=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.7.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.7.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MF C:/Users/rzaafouri/ncs/v1.7.0/Projects/p_adc/build_nrf5340dk_nrf5340_cpuapp_ns/CMakeFiles\app.dir\src\main.c.obj.d -fno-diagnostics-show-caret -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
    2> ../src/main.c:7:2: error: #error "No suitable devicetree overlay specified"
    2> In file included from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/arch/arm/aarch32/arch.h:20,
    2>                  from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/arch/cpu.h:19,
    2>                  from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/kernel_includes.h:33,
    2>                  from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/kernel.h:17,
    2>                  from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/zephyr.h:18,
    2>                  from ../src/main.c:1:
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:81:17: error: 'DT_N_S_zephyr_user_P_io_channels_LEN' undeclared here (not in a function)
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:2542:24: note: in definition of macro 'DT_CAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:560:36: note: in expansion of macro 'DT_PROP'
    2> ../src/main.c:10:26: note: in expansion of macro 'DT_PROP_LEN'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/sys/util_internal.h:84:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:2524:2: note: in expansion of macro 'UTIL_CAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:2524:11: note: in expansion of macro 'DT_ROOT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:129:22: note: in expansion of macro 'DT_PATH_INTERNAL'
    2> ../src/main.c:10:38: note: in expansion of macro 'DT_PATH'
    2> ../src/main.c:31:28: note: in expansion of macro 'ADC_NUM_CHANNELS'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:81:17: error: 'DT_N_S_zephyr_user_P_io_channels_IDX_0_VAL_input' undeclared here (not in a function)
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:2542:24: note: in definition of macro 'DT_CAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:1075:2: note: in expansion of macro 'DT_PROP'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree/io-channels.h:274:2: note: in expansion of macro 'DT_PHA_BY_IDX'
    2> ../src/main.c:32:2: note: in expansion of macro 'DT_IO_CHANNELS_INPUT_BY_IDX'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/sys/util_internal.h:84:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:2524:2: note: in expansion of macro 'UTIL_CAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:2524:11: note: in expansion of macro 'DT_ROOT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/devicetree.h:129:22: note: in expansion of macro 'DT_PATH_INTERNAL'
    2> ../src/main.c:32:30: note: in expansion of macro 'DT_PATH'
    2> In file included from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/toolchain/gcc.h:66,
    2>                  from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/toolchain.h:43,
    2>                  from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/kernel_includes.h:19,
    2>                  from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/kernel.h:17,
    2>                  from C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/zephyr.h:18,
    2>                  from ../src/main.c:1:
    2> ../src/main.c: In function 'main':
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/device.h:80:39: error: '__device_dts_ord_DT_N_S_zephyr_user_P_io_channels_IDX_0_PH_ORD' undeclared (first use in this function)
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/toolchain/common.h:124:26: note: in definition of macro '_DO_CONCAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/device.h:80:31: note: in expansion of macro '_CONCAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/device.h:232:37: note: in expansion of macro 'DEVICE_NAME_GET'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/device.h:246:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
    2> ../src/main.c:61:33: note: in expansion of macro 'DEVICE_DT_GET'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/device.h:80:39: note: each undeclared identifier is reported only once for each function it appears in
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/toolchain/common.h:124:26: note: in definition of macro '_DO_CONCAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/device.h:80:31: note: in expansion of macro '_CONCAT'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/device.h:232:37: note: in expansion of macro 'DEVICE_NAME_GET'
    2> C:/Users/rzaafouri/ncs/v1.7.0/zephyr/include/device.h:246:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
    2> ../src/main.c:61:33: note: in expansion of macro 'DEVICE_DT_GET'
    2> At top level:
    2> ../src/main.c:38:16: warning: 'sample_buffer' defined but not used [-Wunused-variable]
    2> ../src/main.c:31:16: warning: 'channel_ids' defined but not used [-Wunused-variable]
    Build failed

    can you help me with this please 

  • Hello,

    The tutorial you linked used NCS v1.4.0, but the board names has since changed, so you will need to rename the overlay file from nrf5340dk_nrf5340_cpuappns to nrf5340dk_nrf5340_cpuapp_ns for this to work with newer versions of the NCS SDK.
    Please try this, and let me know if the issue persists.

    Best regards,
    Karl

  • Hello,
    i did changed the overlay file name but it doesn't work anymore
    it's not even opening 

  • what can i do please to figure out this issue, i can no longer open my project 
    can you help me please 

Related