0

INA219 Sensor for Measuring Short-Circuit Current and Open C
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

INA219 Sensor for Measuring Short-Circuit Current and Open C

by MagicManBob on Sat Jan 05, 2019 5:06 am

I am having some trouble understanding how I could use the INA219 sensor to measure open-circuit voltage and short-circuit current of a small solar cell. I am using an Arduino Uno to record data from the INA219. My panel is rated at 5.5V, 170mA, and 1W. Is it feasible to connect the positive and negative terminal of the solar panel directly to the two terminals on the INA219 without a load? My thinking is that I do not want to measure the current drawn and the voltage across a load but rather the short-circuit current and open-circuit voltage of the solar cell. Will connecting the solar cell with no load damage the INA219 sensor? The reason for this project is that I want to measure the short-circuit current and open circuit voltage of a small solar cell over a week to determine how quickly it degrades (the type of solar cell I am working with degrades fairly quick).

MagicManBob
 
Posts: 16
Joined: Sat Jan 05, 2019 4:57 am

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by adafruit_support_bill on Sat Jan 05, 2019 8:22 am

Connect it as shown in the guide - But wire a switch or a relay where the load would normally go.

With the switch open, there is no load and you can measure the open circuit voltage. With the switch closed, there is a short-circuit which places the INA219 sense resistor in the load path so you can measure the short-circuit current.

Just make sure that all of your wiring and connections are sized to handle the maximum expected current.

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

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by MagicManBob on Sun Jan 06, 2019 7:27 am

Would this setup be correct? (View attached image). I used an N-type MOSFET as a switch which I can use to automatically open and close the circuit by making pin D3 on the Arduino high or low. The INA219 is in series with the solar cell. The Arduino will be powered with a battery connected to ground and Vin as this system will be placed in the sun.
Attachments
Current_Voltage_Sensor_bb.png
Current_Voltage_Sensor_bb.png (327.21 KiB) Viewed 412 times

MagicManBob
 
Posts: 16
Joined: Sat Jan 05, 2019 4:57 am

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by adafruit_support_bill on Sun Jan 06, 2019 8:01 am

Yes. That should work.

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

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by MagicManBob on Sun Jan 13, 2019 5:43 am

I have received a lot of input from other people suggesting I use a shunt resistor across the V+ and V- of the INA219. How would this help my situation? I cannot quite seem to wrap my head around these suggestions or if/how I should implement another shunt resistor?

MagicManBob
 
Posts: 16
Joined: Sat Jan 05, 2019 4:57 am

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by adafruit_support_bill on Sun Jan 13, 2019 9:00 am

The big black rectangular component on the board is a shunt resistor. You can remove that one and replace it with an external one if you like. You may be able to achieve higher resolution by choosing one specifically matched to the range of measurements you are expecting. But you probably want to test things as-is before trying to optimize.

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

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by MagicManBob on Sun Jan 13, 2019 9:12 am

The rectangular component is not a resistor but instead it is a MOSFET...this is acting as a switch to open and close the circuit so that the short circuit current can be read when the MOSFET completes the circuit and then measure the open circuit voltage when the MOSFET is open. However, I don't see how the voltage can be measured by the Arduino when the MOSFET breaks the connection?

MagicManBob
 
Posts: 16
Joined: Sat Jan 05, 2019 4:57 am

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by adafruit_support_bill on Sun Jan 13, 2019 9:41 am

The big black rectangular component on the board is a shunt resistor.

The big black rectangular component labeled "R100" on the INA219 breakout board is a 0.1 ohm 1% shunt resistor betwen V+ and V- as shown in the schematic
https://cdn-learn.adafruit.com/assets/a ... 1475858479

Image

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

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by MagicManBob on Fri Jan 18, 2019 2:35 pm

I have connected up the circuit and removed the MOSFET for now just to test to see if the INA219 gives accurate results when using a normal mechanical switch. It works perfectly to measure the open-circuit voltage of the solar panel (shows 2.53V in normal office lighting - the solar cell is rated at 6V 170mA). I compared the voltage to the measured voltage on a multimeter and it is quite spot on.

However, the current seems to be an issue again. When I close the circuit to measure the short-circuit current the voltage drops to zero. This is understandable since the short-circuit current brings the voltage to zero if you look at a standard IV curve for a solar cell. When running the code and opening the serial monitor the current shows a negative value. I am assuming that this is just a polarity issue because the INA219 is connected to the positive side of the solar cell. This can be fixed by just multiplying by -1 in the code. When I measure the short-circuit current in office lighting using a multimeter I get about 110mA but the INA219 code shows a current of about 1mA. Then when I apply more light to the solar cell the value keeps decreasing to about 0.30mA. So not only is the INA219 not showing a current of 110mA to match the multimeter value but the current value declines when applying light to the solar cell. What could be the issue? I am using the exact code on the Adafruit INA219 article.

MagicManBob
 
Posts: 16
Joined: Sat Jan 05, 2019 4:57 am

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by adafruit_support_bill on Fri Jan 18, 2019 2:42 pm

Please post some photos showing your soldering and connections.

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

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by MagicManBob on Fri Jan 18, 2019 2:52 pm

I have used the same schematic as shown higher up in the post. I have just placed red boxes over the part of the circuit I have removed and replaced with a switch to connect the positive of the solar panel to ground (positive of the solar cell to V+ and out V- of the INA219 and then to ground which shorts the solar cell). I have connected it exactly like in the attached image.
Attachments
Current_Voltage_Sensor_bb - Copy.png
Current_Voltage_Sensor_bb - Copy.png (302.55 KiB) Viewed 286 times

MagicManBob
 
Posts: 16
Joined: Sat Jan 05, 2019 4:57 am

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by adafruit_support_bill on Fri Jan 18, 2019 3:29 pm

Please post some actual photos of the circuit.

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

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by MagicManBob on Mon Jan 21, 2019 2:59 am

Here is an image of the wiring. The green and yellow cables that are loose connect to the positive (yellow wire) and negative (green wire) of the solar cell. The red cable on the far right can disconnected or reconnected to ground depending on if you are measuring open circuit voltage or short circuit current. To repeat my question:

I have connected up the circuit and removed the MOSFET for now just to test to see if the INA219 gives accurate results when using a normal mechanical switch (connecting or disconnecting the wire). It works perfectly to measure the open-circuit voltage of the solar panel (shows 2.53V in normal office lighting - the solar cell is rated at 6V 170mA). I compared the voltage to the measured voltage on a multimeter and it is quite spot on.

However, the current seems to be an issue again. When I close the circuit to measure the short-circuit current the voltage drops to zero. This is understandable since the short-circuit current brings the voltage to zero if you look at a standard IV curve for a solar cell. When running the code and opening the serial monitor the current shows a negative value. I am assuming that this is just a polarity issue because the INA219 is connected to the positive side of the solar cell. This can be fixed by just multiplying by -1 in the code. When I measure the short-circuit current in office lighting using a multimeter I get about 110mA but the INA219 code shows a current of about 1mA. Then when I apply more light to the solar cell the value keeps decreasing to about 0.30mA. So not only is the INA219 not showing a current of 110mA to match the multimeter value but the current value declines when applying light to the solar cell. What could be the issue? I am using the exact code on the Adafruit INA219 article.
Attachments
20190121_083328.jpg
20190121_083328.jpg (598.57 KiB) Viewed 251 times

MagicManBob
 
Posts: 16
Joined: Sat Jan 05, 2019 4:57 am

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by adafruit_support_bill on Mon Jan 21, 2019 8:09 am

When you test the short-circuit current with the multimeter, is the INA219 shunt resistor in the circuit?

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

Re: INA219 Sensor for Measuring Short-Circuit Current and Op

by MagicManBob on Mon Jan 21, 2019 8:44 am

No. I disconnect the solar cell completely and test it independently from the circuit.

MagicManBob
 
Posts: 16
Joined: Sat Jan 05, 2019 4:57 am

Please be positive and constructive with your questions and comments.