12V DC: Current sensing detailed design considerations

The circuit component values can be sized for different types of generators. For example a hand crank may produce 0 to 10Amps, while a small wind turbine could produce 0 to 50Amps. If you want to use the same components for both the first step is to size the current sensing resistor (shunt) to take the upper value of 50Amps. The current sensing resistor I bought has a maximum rating of 100Amps its resistance is 0.0005Ohms.

The current is measured by measuring the voltage drop across the resistor. At 50Amps the voltage drop across the 0.0005Ohm resistor will be V=RI = 0.0005 * 50 = 0.025V. The next step is to amplify this voltage to the required voltage range of the Arduino.
Lets say we want to measure 0 to 50Amps. When the current is at 50A we want Varduino to be at 5V. Vdrop will be 0.025V and so we need to amplify it by 200 times.
In the diagram RA and RB are responsible for setting this amplification factor.  The scale factor is given by RB / RA and so RB = 200kOhms and RA = 1kOhms would give the required amplification.

To recap the steps you need to take to size the components are:

1) decide what range of current you want to measure.
2) find a current sensing resistor that is rated at a little over your maximum current value.
3) the resistance of the sense resistor will determine the magnitude of the voltage drop across the sense resistor and therefore the amplification required to scale up this voltage to vary between the 0 to 5V input range of the Arduino.
4) Once you have decided on the component values the component values then need to be entered into the Arduino sketch.

The maximum power the circuit can measure is then given by the maximum voltage you decide to be able to measure and the maximum current value you decide to be able to measure. For a voltage range of 0 to 20V and a current range of 0 to 50A the circuit will measure a power range of 0 to 1000W.