Shop OBEX P1 Docs P2 Docs Learn Events
INA 219 DC Current Sensor Discussion - Product ID 29130 INA219 — Parallax Forums

INA 219 DC Current Sensor Discussion - Product ID 29130 INA219

John KauffmanJohn Kauffman Posts: 653
edited 2013-09-03 12:28 in Accessories
I'm starting to work with this new Plax product and my mistakes could be useful to others.

=====Prop Code
The download sample code from product page is the "INA219 Demo Program by Nick Ernst "
n.b. On set-up with Propeller Tool, Parallax Serial Terminal is baud 115,200. But this code uses 9,600 - so nothing appears on the screen. Change one or the other.

=====BS2 Code
None? Seems like I2C might be on high end of what BS2 can do, but possible? I'm hoping Plax will provide sample code to plug and play this product.

=====Tests
As simple benchmark, on Prop BOE with a circuit of 3.3v > INA219 > 220 ohm > LED > grnd. I am getting
Shunt Voltage: 79.4 mV
Bus Voltage: 3.97 V
Current: 317 mA
Load Voltage: 4.05 V

=====Grounding loads
The code notes include "If you use a separate power supply for your unit under test, ie a dc motor, ensure that you have a common ground connection or you will not see any readings from your board." I could use some help on this.
Example 1 - I am controlling a motor:
The motor circuit: battery 12v+ > INA219 > switch > motor > battery 12v-.
The INA219 is set up on the Prop BOE which is powered by USB.
How is the "same ground" set up? Jumper the battery 12v- to the PropBOE GND?

Example 2 - I am measuring the power from a (regulated) 6v solar panel to a battery pack:
The solar panel circuit will be panel+ > INA219 > battery+ > Battery- > panel-
The INA219 is on PropBoe powered by USB
How is the common grounding done?

===== Tests on Solar Panels to come

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-08-31 09:29
    John,
    I don't have one of those, but I'm sure the answer to the grounding question in both cases is that you need to connect the ina219 common to the battery (-) terminal.

    Code for the Stamp will be much easier if it is a member of the BS2p_ series, with native I2C commands.

    The test result with the LED is suspicious in all respects. How can it measure 3.97V and 317mA through an LED that is powered from 3.3V? The current should be around 10mA.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2013-08-31 10:34
    I agree that the measurement values don't make sense. The voltages are way out of line and LED should be, from my experience, like you said 10-15 mA. Goal one was to get numbers to the terminal. Next is making sense of them.

    As my kids said when they got a ridiculous result on their calculator: "But it must be right I used the calculator." When I was in high school calculators were first appearing ($120). Only three of us had them (sons of scientists). Their appearance created a stir and the conclusion from the faculty was that before a student could use a calculator in class they had to pass The Slide Rule Test. The logic was that you never knew if your calculator would work but you would always have a slide rule available.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-09-03 12:28
    Another option for the BS2 would be an analog current sensor such as the ACS711, which you have to connect to an analog to digital converter. Pololu has a breakout board. It doesn't give back as much information as the digital INA219.

    I took a couple of years off between undergrad and grad school, working in environmental education and doing a lot of backpacking. During that time nice scientific calculators from HP and others came into use big time, and it was quite a shock to sit in an exam where everyone else was hitting the buttons! The right answer is always a more thoughtful process, is it reasonable, dimensionally consistent etc etc.
Sign In or Register to comment.