Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

INA219 protection for motor measurements
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: INA219 protection for motor measurements

by adafruit_support_bill on Sun May 24, 2020 9:41 am

SEC stands for 'secondary'. That is the secondary winding of the transformer. That is what makes me suspect it may be an unregulated supply. Some older transformer-based supplies did have regulation. But then the output spec would typically define the regulator output - not the secondary winding output.

Most modern supplies are regulated 'switch-mode' supplies. They do not use transformers.

The amperage is the maximum output capability of the transformer. Having more amps available is not the problem as long as the voltage is appropriate for the motor. The actual current draw will be determined by the load (i.e. your motors).

adafruit_support_bill
 
Posts: 78748
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 protection for motor measurements

by dsxoiniana on Sun May 24, 2020 2:59 pm

May I ask what will happen if the polarity of the battery or any input DC current is wrong? Will it burn the INA219?

dsxoiniana
 
Posts: 51
Joined: Mon Nov 25, 2019 4:41 pm

Re: INA219 protection for motor measurements

by adafruit_support_bill on Sun May 24, 2020 3:16 pm

Both the INA219 and the motor shields would not tolerate a polarity reversal.

adafruit_support_bill
 
Posts: 78748
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 protection for motor measurements

by dsxoiniana on Sun May 24, 2020 4:14 pm

adafruit_support_bill wrote:Both the INA219 and the motor shields would not tolerate a polarity reversal.


Ok, so probably this is how I burnt the INA219. However the motor shields still work fine. Can it just be that I was lucky or is it that the shields have higher tolerance than the INA219? All this started when I tried to connect a switch after the motor power supply... I guess it's time to buy a multimeter

dsxoiniana
 
Posts: 51
Joined: Mon Nov 25, 2019 4:41 pm

Re: INA219 protection for motor measurements

by adafruit_support_bill on Mon May 25, 2020 5:39 am

Actually, yes. The shields do have a reverse polarity protection circuit, so the H-bridge chips would be protected.

adafruit_support_bill
 
Posts: 78748
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 protection for motor measurements

by dsxoiniana on Mon May 25, 2020 8:07 am

adafruit_support_bill wrote:Actually, yes. The shields do have a reverse polarity protection circuit, so the H-bridge chips would be protected.

Got myself a multimeter and played around with the LEGO switches and the battery box. Indeed it seems that I must have burned the switch and the INA219 due to reversed polarity. I'm sorry that this thread becomes like a guide for newbies but I need to understand what went wrong so that I won't do the same mistakes again:

1. Assuming that the INA219 was dead or the switch got burned inside when I applied reversed polarity, how is it explained that the Node MCU was getting very hot? (in fact I have a second INA219 that measures the current through the Node MCU and the current was much higher than normal during that time.)

2. Assuming normal operation without the dead INA219 or dead switches on the circuit, I noticed that the voltage between the 5-12V motor power headouts of the motor shield read something like 1.5V when the circuit is completely switched off. Is there an explanation for not showing 0V?

3. Is there a way to actually check the INAs with the multimeter and verify that they are dead? What would be a possible test?

dsxoiniana
 
Posts: 51
Joined: Mon Nov 25, 2019 4:41 pm

Re: INA219 protection for motor measurements

by adafruit_support_bill on Mon May 25, 2020 9:01 am

how is it explained that the Node MCU was getting very hot?

Not sure. Can you post a diagram of how everything was connected?

I noticed that the voltage between the 5-12V motor power headouts of the motor shield read something like 1.5V when the circuit is completely switched off. Is there an explanation for not showing 0V?

I'm assuming that you are referring to the external power header on the shield. If there is power to the logic circuits, it is not unusual for there to be a small leakage through the H-Bridges that shows up on the motor power circuit.

Is there a way to actually check the INAs with the multimeter and verify that they are dead? What would be a possible test?

The first test would be whether or not you can talk to it on the i2c bus. Try running the example code from the library to see if it responds.

adafruit_support_bill
 
Posts: 78748
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 protection for motor measurements

by dsxoiniana on Mon May 25, 2020 10:46 am

Here's the setup, but let's assume that I reversed polarity by mistake and perhaps the INA219 is dead:

Image

Is there a logical explanation as to why the NodeMCU got hot? What would be the current flow in that case?

Regarding the INA219, it talks to the bus but the readings are completely wrong. In fact it reads a negative current and although the motors work the current reading stay steady in a negative value.

dsxoiniana
 
Posts: 51
Joined: Mon Nov 25, 2019 4:41 pm

Re: INA219 protection for motor measurements

by adafruit_support_bill on Mon May 25, 2020 11:41 am

Reverse polarity failure modes vary. But sometimes result in unpredictable current flows through the device depending on whether devices fail 'open' or fail 'closed'.

Depending on the failure mode of the INA219, it is possible that some reverse voltage found its way to the VU pin on the NodeMCU. I don't know much about the NodeMCU power circuitry, but a negative voltage there likely would have put considerable stress on the voltage regulator.

adafruit_support_bill
 
Posts: 78748
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 protection for motor measurements

by dsxoiniana on Wed May 27, 2020 7:54 am

adafruit_support_bill wrote:Reverse polarity failure modes vary. But sometimes result in unpredictable current flows through the device depending on whether devices fail 'open' or fail 'closed'.

Depending on the failure mode of the INA219, it is possible that some reverse voltage found its way to the VU pin on the NodeMCU. I don't know much about the NodeMCU power circuitry, but a negative voltage there likely would have put considerable stress on the voltage regulator.

I'm expecting some new INA219 and in the meantime I'm experimenting a bit and I noticed something very strange. My current setup is the following:

Image

The left MCU is connected to an INA219 which measures the power consumption of the other MCU on the right. To achieve this I just stripped a USB cable, cut the power supply cable and connected the 2 parts to Vin-, Vin+ of the INA219. The experiment shows that somehow, the current/power consumption of the MCU on the right is affected by whether the motor 9V power supply on the shields in on or off.

For example, when the motor supply is switched off, the MCU on the right has higher consumption and its spectrum analysis shows many frequencies:

Image
flag button png

You notice that the current is around 105mA in the high lobes and in the spectrum analysis right below you can see how the current's major frequencies fluctuate. When the motor supply is turned on, the power consumption of the MCU drops and the signal seems to "clear out" with frequencies peaks showing up in a very specific area. Below is the same diagram that shows the shunt voltage on the MCU.

Image
flag button png

When the motor power is off the shunt voltage goes up and vice versa. How is this explained?

dsxoiniana
 
Posts: 51
Joined: Mon Nov 25, 2019 4:41 pm

Re: INA219 protection for motor measurements

by adafruit_support_bill on Wed May 27, 2020 8:16 am

Hard to say. Un-connected wires make pretty good antennae for noise. That could lead to spurious readings.

adafruit_support_bill
 
Posts: 78748
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 protection for motor measurements

by dsxoiniana on Wed May 27, 2020 8:29 am

adafruit_support_bill wrote:Hard to say. Un-connected wires make pretty good antennae for noise. That could lead to spurious readings.

Just noticed that I don't have a common ground from the USB cable to the INA219 and the MCU on the left. Should I add one?

dsxoiniana
 
Posts: 51
Joined: Mon Nov 25, 2019 4:41 pm

Re: INA219 protection for motor measurements

by adafruit_support_bill on Wed May 27, 2020 8:36 am

Yes. Without a common ground, the voltages will be floating relative to the sensor.

adafruit_support_bill
 
Posts: 78748
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.