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
 

Parents
  • Hi,

    INA219 examle in Zephyr writes very strange (IMHO incorrect) value into configuration register. Try to replace it with default one:

    	/* Configurate the chip using default values */
    	data[0] = 0x39;
    	data[1] = 0x9f;

  • i already changed that before i putted the message on the forum 
    for now i changed the pins and changed my overlay file according to the new pin numbers 
    and i always took the comment of Dmitry in consideration and i changed the addresses and now it's being so strange 

  • when i was on the V1.7.0 i used to visualize data on the terminal of SES.
    infact the snipped output photo was from there ( but the data wasn't correctly displayed).
    but for now i just downloaded Putty to be able to visualize data.
    but i'm not really familiar with it.
    can you give helpful links please to be able to use it and visualize data through it.
    and how can i link it to SES built ?  

  • The link I sent explains how to set up PuTTY.

    Set up the settings for Serial connections:

    Set up the settings for the terminal:

    Then select Serial for the session, and save your settings, then open the terminal:

  • Hello 
    I managed to get output on the SES terminal 
    and it says that the device is not ready 

    i will put also my overlay file below 

    &i2c1 {
    	status = "okay";
    	sda-pin = < 34 >;
    	scl-pin = < 35 >;
        clock-frequency = <100000>; 
    	
    	ina219: 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>;
    	};
    };
    
    &uart1 {
        status = "disabled";
    };


    is it an I²C problem like in V1.7.0 
    the user needs to change I²C to make it work ? or what may be causing this problem ? 
    can you help me find out please ?

  • Hello Again 
    I finally managed to get an output through the INA219 sensor 
    and i got it on the terminal of SES 
    i came back to my initial problem 
    the main problem for which i created the ticket 
    the sensor is indicating mostly strange values and it's frequently repetitive
    i will put you a screenshot below 
    i just want to fix this problem to get reasonable values 
    but i don't know what to try exactly to make it get the right values 
    can you help please with it 

  • Try connecting the sensor to VDD, and not VDD_nrf. You can find VDD next to the power switch.

Reply Children
No Data
Related