Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

INA219 Sensor wrong data display

Hello Community,

I'm using the current sensor INA219 with NRF5340dk.
Communication is through i²c protocol and using nrf SDK v1.7.0 .
I'm trying to get the data output (Voltage, Current, Power).
i worked on the sample linked on Zephyr Lib. the problem is that i'm always getting the same output which i liked below

the wiring of the sensor is like below :

Vin->VDD nrf
GND->GND
SCL->P0.26
SDA->P0.25

I'm always getting the current and power to Null values and both voltage values don't change no matter what !
do i need to change the calibration values or do i need to do something else ?
i don't get what's wrong with the data output so i need your help please
can you help me get the right values and get the data displayed out from the sensor correctly, please

Kindly,
Many thanks
 

  • How difficult it will be to port your other project to v1.8.0 entirely depends on how big it is, and how affected it is by the changes between the versions. If it's not too big, there shouldn't be much of an issue porting it.

  • My project is about 4 assembled sensors that work when a button is pressed 
    the project recover data each 5s and then it stores it somewhere on the cloud 
    here's a snip from the project properties 

    do you think it's easy to migrate on the V1.8.0 or will it be complicated ? 

  • It doesn't sound like it should pose much of an issue.

    Those numbers aren't really helpful as most of it is the build folder.

    You can make a new private ticket about upgrading your project to v1.8.0, and I can help you with that there.

    Were you able to get the v1.8.0 version of the INA219 sample working? You probably need to add an overlay file with a "ti,ina219" node to get the driver working.

  • ok thanks for the suggestion 
    well i just finished downloading and searching but in fact under: ncs\v1.8.0\zephyr\samples\drivers\current_sensing 
    there's only the CMakeLists.txt 
    should i import the rest from the old version ? 

  • The new sample is zephyr/samples/sensor/ina219

    I think if you add this to an overlay file and add it to the sample, it should work:

    &i2c1 {
    
    	ina219@40 {
    		status = "okay";
    		compatible = "ti,ina219";
    		reg = <0x40>;
    		label = "INA219";
    		brng = <0>;
    		pg = <0>;
    		sadc = <13>;
    		badc = <13>;
    		shunt-milliohm = <100>;
    		lsb-microamp = <10>;
    	};
    };

Related