# Current sensing over a wide range

My project aims to measure the current of a photovoltaic module after applying a certain voltage across it.

That means applying a voltage from 0V to 38 V with 0.1V step and measure the corresponding logarithmic currents (which vary from almost 1mA to 8A) then draw the Current-Voltage curve after sending the measured data to the computer.

I have developed an initial system using an Arduino Uno R3 ..... I measured the big voltage across the module using a voltage divider (0V to 40V down to 0V to 5V) and the current was measured by current sensor ACS712. However the current measurements were so bad since it is logarithmic and in the mA range.

My supervisor has suggested that I can't measure such low current and high ones in the same time, and that I have to divide it to 3 ranges. After reading and searching online, I decided to have 3 ranges:

Am doing the right thing?

• The INA118 should be suitable for all ranges, you just need to pick three gain resistors (or whatever number is reasonable) and switch between them to give a suitable output. An advanced setup would use the Arduino to automagically select the correct resistor, and would maybe use the INA138 instead - it's designed specifically as a current shunt monitor and doesn't care so much about the common mode voltage of the inputs. – CharlieHanson Oct 7 '15 at 13:24
• I like @CharlieHanson idea of one instrument amp, but you'd have to switch the shunt resistance for the highest current. (10 A and 0.1 ohm is 10 W!) – George Herold Oct 7 '15 at 14:21
• How about stating the accuracy of the measurements that you need. – Andy aka Oct 19 '15 at 14:01
• I would employ the Channel resistance of a Mosfet (Rds) within its linear region as current sense resistor and control it by Gate Voltage. not very accurate measurement though due to its poor thermal stability! – Mohsen Oct 19 '15 at 14:27

Your ADC input voltage range is (Vref) 5V or 2.56 V if you select the internal voltage reference of the MCU.

Then use a shunt resistor to give you the desired resolution for the minimum current in a given range and calculate the end of range as:

$$I_{max} = \frac{V_{ref}}{R_{shunt}} \cdot \frac{1023}{1024}$$

for example: to measure 1 mA in 0.01 mA resolution using the internal

$$V_{ref} = 2.56V \text{(ADC Step = 2.56 / 1024 = 2.5 mV)}$$

I need to get 100 as ADC output for 1 mA;

$$V_{in} = 2.5mV \cdot 100 = 0.25V$$

$$R = \frac{0.25V}{1mA} = 250 \Omega$$

$$I_{max} = \frac{2.56}{250} \cdot \frac{1023}{1024} = 10.23 mA$$

then with shunt resistor of 250 Ohm, I Cover 1 to 10 mA.

Finally:  • Thank you @ir.imad , but what do you mean by "I need to get 100 as ADC output for 1 mA" why 100??? – Khoulod Ghanem Oct 8 '15 at 9:11
• 100 steps/ 1mA is for examble, if your ADC output is 100 ==> the current : I = 1 mA ; and if ADC out = 101 ==> I = 1.01 mA – ir.imad Oct 8 '15 at 22:53
• I got the idea @ir.imad thank you so much.... I am trying to search online to buy the shunt resistances , it seems to me that it is not easy to find such resistances , can you help me ??? – Khoulod Ghanem Oct 9 '15 at 9:04
• you can use standard res. values (220, 22, 2.2 ..) and recalculate the equation of the current as function to the adc output. By the way, the Metal Glass resistances have a very small thermal drift, and the carbon ones have a grate thermal drift – ir.imad Oct 11 '15 at 20:41
• is your project OK ? – ir.imad Oct 15 '15 at 23:55

This is my new calculations with Vref=1.024 A more off-the-shelf approach might involve a bench-top multimeter and a programmable DC power supply. You can hook them up to a computer via serial, usb, LXI, or GPIB depending on the instrument and programmatically take and log data.

Many manufacturers make suitable equipment from Rigol all the way up to HP/Agilent/Keysight.

This approach is likely to get you the most accurate answer.

You could even use a computer-controlled relay and switch the DC voltage into the multimeter to verify the accuracy of the input voltage!

The Cu Weir Res = 0.0175 * L / S [L:m ; S:mm2] Then you can calculate the resistance of weirs. I propose a deferential method : The shunt resistance is a resistance with a given value and power but with a low thermal factor, you can use a Metal-Glass type.