Current sensing over a wide range

arduinoinstrumentation-amplifiersensor

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?

Best Answer

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:

enter image description here

enter image description here