This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

INA239: VCP Monitor 4 Click using the IC -

Part Number: INA239
Other Parts Discussed in Thread: SYSCONFIG, INA229, TI-SCB, INA236
Hi!
Below is my simple setup using the INA239 on a device called the VCP Monitor 4 Click. I have provided the link to the device that the IC is built on, the schematic, as well as the INA239 datasheet.
In the images below, the load connected to the IN +/- are the LEDs. First thing I noticed when powering on the monitor device and reading register values from the INA239 is that the readings only appear when the GND pin is disconnected. I also notice that if I pull out all the spi data lines off the sensor but kept the 3.3v in, the sensor turns off. If I plug them back in, the sensor turns on (still with no GND pin connected). I have tested continuity between data lines and gnd and I did not see any continuity. So I am a bit confused on how the data lines complete the power circuit. You can see in the first image of the breadboard that the GND pin is not used, but the device is powered on. The second image is the current using a meter to verify the current being read by the sensor device. The third image is the readings from the sensor, again with no GND pin connected. I need help because this sensor will be used in a larger control system where I need to know where the reference GND is and that it is working properly. 
Thank you, DL
  • Hello Douglas,

    Thank you for using the TI forum.  First off, so you know, the INA239 datasheet link that you sent is out of date. Here is a link to an updated datasheet: https://www.ti.com/lit/ds/symlink/ina239.pdf

    The INA239 will not function without a the GND pin connected, so if you are seeing this behavior, then there may be a hardware issue on your board. You may want to reach out to Mikroe to see if they have any ideas what could be wrong, or visually inspect the PCB for errors, such as device pins soldered together. Also double check for errors on the breadboard itself. You may want to try just connecting to the INA239 directly without a load setup to see if you can read the ID registers or the Temperature register to help validate the setup. 

    If you end up not getting their module to work, you may be interested in our evaluation module for the INA239: https://www.ti.com/tool/INA229_239EVM. Which pairs with this controller: https://www.ti.com/tool/TI-SCB. And evaluation is available through the GUI: https://dev.ti.com/gallery/info/CurrentSensing/INA228_229_237_238_239EVM_GUI

    Also, if you want additional software recourses, this device is available in SysConfig, which helps generate C code based on your desired configuration settings, found here: https://dev.ti.com/sysconfig/index.html?product=ascstudio&module=/ti/sensors/currentsensor/INA239

    Regards,

    Mitch

  • Thanks for replying back. I was able to read the ID register w/out the GND pin connected. I am currently in contact w/Mikroe but they have not replied back yet. 

    I do have a couple questions though:

    1. Does every INA239 evaluation board whether from Mikroe or TI have a max current reading of 10 amps?

    2. Is your evaluation module INA229_239EVM Arduino compatible? I am currently using a Teensy4.1 board that is programmed with the Arduino IDE.

  • Hello Douglas,

    You're welcome. Here are my responses to your questions:

    1. Our INA239EVM is limited to 10A when you run the current through the PCB, but it has connections for an external shunt resistor so that you can run the current off of the PCB and use whatever current you want. The EVM User's Guide discusses how to do this in section 4.2.3.1.

    2. The INA229_239EVM (or in your case, just the INA239EVM) can be connected to whatever MCU you want. It is designed to plug directly into our TI-SCB controller that has a convenient software/GUI package ready to run, but you can always use your own MCU (like the Arduino) instead of our controller. When using your own MCU, you will have to do your own software. However, if you take the software from SysConfig, it can pretty easily be converted into an Arduino project. Here is a guide written by a colleague of mine that shows how to do this (it's written for the INA236, but will apply for the INA239 also. Click the images to enlarge them):

    .

    How to turn SysConfig code into Arduino code:

    1. Download all.zip from INA236 ASCStudio Sysconfig
    2. Find Arduino documents folder
    3. Create new sketchbook folder that is the same name as your main INO file
      1. Create a "main" folder sketchbook to reflect main.ino
    4. Change the main.c extension to main.ino
    5. Change the sysconfig file extensions from .c & .h to .cpp & .hpp
    6. Opening main.ino should open the entire sketchbook of files
    7. Change the #include statements at the beginning of each file to reflect the extension change (ex. #include "mcu.h" to #include "mcu.hpp")
    8. To communicate between your MCU of choice and INA236 (or any other current sensor) you'll need to add MCU-specific code to mcu.cpp. Arduino has a premade library for I2C/two-wire communication called "Wire" - here's a guide
      1. Add an include statement for the Wire library in both mcu.cpp and your main.ino
      2. Start the wire communication in the mcu_i2cInit function
      3. Add write and read code to mcu_i2cTransfer function from examples given in the Wire guide for Arduino
      4. Add delay function to mcu_msWait
        1. This also requires that you add #include <Arduino.h> in your mcu.cpp if you use delay() from the Arduino library
    9. hpp, INA236.cpp, mcu.hpp, config.cpp, and config.hpp do not require changes beyond the includes and extension changes
    10. Finally you'll need to write the main loops inside your main.c now main.ino file
      1. Instead of int main(void) you will have two functions void setup() and void loop() following with standard Arduino
      2. Inside void setup you'll include code to start the wire communication and serial to output the information/current you're reading to the serial monitor in the Arduino IDE. You'll also need to include the configuration function to configure the INA236_0 struct
      3. Inside void loop you will write functions that utilize your INA236.c functions for instance INA236_readReg to pull current values or manufacturing IDs
    11. From here you can compile the code and upload it to the Arduino
    12. To connect the Arduino to an INA236EVM you connect

     

    Regards,

    Mitch

  • Thank you Mitch for the reference.

    May you help me look further into the INA239 chip? I purchased some INA239 chips by themselves and decided to further test them on their own on a small 10 pin breakout board. I did not add any capacitors or resistors to the circuitry. I wired the INA239 to my controllers SPI pins and still the GND of the INA239 interferes with the accuracy of the reading. When the GND pin is connected I read 0.00. When the GND pin is not connected I read 2.8V (should read 3.3V) In this case I am only reading the VBUS which is the 3.3 volts from the controller. Is there any way you could test this out on your end? I have a feeling something is wrong with the INA239 chip itself. Below are my images of the simple setup I did.

  • In my last post I showed the controller on the breadboard and ina239 not on the breadboard. That caused the issue I discussed with the reading of 0.00 with the GND connected, and 2.8V with the GND not connected. I just tried taking the controller off the breadboard and just directly wiring everything to the controller and the INA239 (no breadboard). Now the vbus reading is correct with GND connected. BUT... it still powers on when I take the GND pin off. I know its on because instead of reading 3.3V, it still reads 2.8V. This is mind boggling.

  • Hello Douglas,

    Interesting, so maybe there was a problem with the breadboard itself? I'm glad you were able to get the device to work properly with GND connected.

    Regards,

    Mitch

  • Yes I think the breadboard does something. I still have a question though. When I directly connect it like this with no breadboard, I still do not understand why the INA239 is still reading a voltage value when I take the GND off?

  • Dear Mitch,

    With the current setup of no breadboard.

    Image 1 is the correct reading with the GND connected to the INA239.

    Image 2 is the reading with the GND not connected to the INA239.

    Is this supposed to happen?

    Image 1:

    Image 2:

  • Hey Douglas,

    We do not spec the devices for when there is power but no GND, so it could just be that power is draining somewhere else. I recommend not running the device with power connected and no GND.

    Regards,

    Mitch