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,

    I assume you are using zephyr/samples/drivers/current_sensing?

    Have you made any changes to the default setup of the I2C peripheral?

    If not, try changing main.c:89 from I2C_0 to I2C_1:

    	i2c_dev = device_get_binding("I2C_1");

    For I2C_1, the default SCL pin is P1.03 and the default SDA pin is P1.02

Reply
  • Hi,

    I assume you are using zephyr/samples/drivers/current_sensing?

    Have you made any changes to the default setup of the I2C peripheral?

    If not, try changing main.c:89 from I2C_0 to I2C_1:

    	i2c_dev = device_get_binding("I2C_1");

    For I2C_1, the default SCL pin is P1.03 and the default SDA pin is P1.02

Children
No Data
Related