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 again,

    I just looked over your overlay file. Please change your adc section to instead be:

    &adc{  
    
            compatible = "nordic,nrf_saadc,nrf_adc";
    
            status = "okay";
    
    };

    I.e remove the compatible line and add a semicolon at the end.

    Best regards,
    Karl

  • Hello again,
    i even created a new project with the same items within and with the config you recommended in previous comments but unfortunately always the same error 
    " create_nordic_project.py failed(1) and i can't open the project 

  • here's the output after the error " create_nordic_project.py failed(1)"

    Creating solution adc.emProject
    C:/Users/rzaafouri/ncs/v1.7.0/toolchain/opt/bin/cmake.exe -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp_ns -DBOARD_DIR=C:\Users\rzaafouri\ncs\v1.7.0\zephyr\boards\arm\nrf5340dk_nrf5340 -BC:\Users\rzaafouri\ncs\v1.7.0\zephyr\samples\drivers\adc\build_nrf5340dk_nrf5340_cpuapp_ns -SC:\Users\rzaafouri\ncs\v1.7.0\zephyr\samples\drivers\adc -DNCS_TOOLCHAIN_VERSION=1.7.0 -DEXTRA_KCONFIG_TARGETS=menuconfig_ses -DEXTRA_KCONFIG_TARGET_COMMAND_FOR_menuconfig_ses=C:\Users\rzaafouri\ncs\v1.7.0\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
    -- Application: C:/Users/rzaafouri/ncs/v1.7.0/zephyr/samples/drivers/adc
    -- Zephyr version: 2.6.99 (C:/Users/rzaafouri/ncs/v1.7.0/zephyr), build: v2.6.99-ncs1
    -- Found Python3: C:/Users/rzaafouri/ncs/v1.7.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.11.1", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpuapp_ns
    -- Cache files will be written to: C:/Users/rzaafouri/ncs/v1.7.0/zephyr/.cache
    -- Found dtc: C:/Users/rzaafouri/ncs/v1.7.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/Users/rzaafouri/ncs/v1.7.0/toolchain/opt)
    -- Found BOARD.dts: C:/Users/rzaafouri/ncs/v1.7.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_ns.dts
    -- Found devicetree overlay: C:/Users/rzaafouri/ncs/v1.7.0/zephyr/samples/drivers/adc/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay
    -- Configuring incomplete, errors occurred!
    Including boilerplate (Zephyr base): C:/Users/rzaafouri/ncs/v1.7.0/zephyr/cmake/app/boilerplate.cmake
    -- Using NCS Toolchain 1.7.0 for building. (C:/Users/rzaafouri/ncs/v1.7.0/toolchain/cmake)
    Error: nrf5340dk_nrf5340_cpuapp_ns.dts.pre.tmp:741.2-742.1 syntax error
    FATAL ERROR: Unable to parse input tree
    CMake Error at C:/Users/rzaafouri/ncs/v1.7.0/zephyr/cmake/dts.cmake:219 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      C:/Users/rzaafouri/ncs/v1.7.0/zephyr/cmake/app/boilerplate.cmake:553 (include)
      C:/Users/rzaafouri/ncs/v1.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      C:/Users/rzaafouri/ncs/v1.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    
    error: cmake failed
    create_nordic_project.py failed (1)

  • Oh, my mistake, after closer inspection it seems the tutorial you are following does things a little bit differently - could you change your overlay file to contain just the following:

    / {
    
        zephyr,user {
    
            /* adjust channel number according to pinmux in board.dts */
    
            io-channels = <&adc 1>;
    
        };
    
    };

    Let me know if it compiles with this change, or what the error log says if it does not.

    Best regards,
    Karl

  • yeah, it compiled 
    i need to get the current and average values from the acs714 sensor 
    do you know how to proceed to collect those values through ADC please 
    can help me with that please 
    do i need to add things to the prj.conf about the sensor ?
    how can i proceed to get them displayed please 
    i appreciate your help very much 


Related