12V DC: Voltage sensing detailed design considerations

Adjusting the circuit to measure any voltage range that the generator is outputting is a matter of choosing the right value resistors for the voltage sensing part.

The voltage sensing part consists of a voltage divider made up of RVDa and RVDb seen in the first circuit diagram. These resistors effectively scale down the voltage outputted by the generator to within the voltage range required by the Arduino.

Taking the example of the wind turbine the wind turbine voltage can vary between 0 and around 20V. The voltage divider needs to scale that voltage down to within 0 to 5V and so using the voltage divider equation:

Varduino = ( RVDb / ( RVDa + RVDb ) ) x Vturbine       

we need Varduino to be 5V when Vturbine is 20V. We also need the current flowing through the resistors to be small as to not dissipate much heat in them. I have chosen resistors in the 100 kOhm range. 100KOhms over 12V would dissipate P = V^2 / R = 12^2 / 100000 = 1.44mW the resistors I used were rated at 250mW.

if RVDa is set to 100kOhms in the above equation and Varduino to 5V and Vturbine to 20V we can find what value of RVDb we need. First rearranging the equation to find RVDb:

RVDb = (Varduino * RVDa) / (Vturbine - Varduino)

RVDb = ( 5 * 100000 ) / ( 20 - 5 ) = 33333Ohms
or 33kOhms.

I chose values for the resistors that would actually give a measurement range of 0 to 55V (RVDa: 100kOhms and RVDb: 10kOhms) giving plenty of room if the voltage accidentally spiked. One thing to bear in mind is that the larger the voltage range you decide to measure the less accurate your voltage measurements will be. To find out how accurate your voltage measurement will be you divide the voltage range you wish to measure by the arduinos ADC resolution so for 20V the accuracy/resolution will be 20/1024 = 19mV.

The last thing is that the values you decide to use for your RVDa and RVDb resistors then need to be entered in to the Arduino sketch this enables the sketch to calculate the voltage of the wind turbine, bike generator etc