Arduino Nano SPWM at 24V/48V

My Arduino Nano SPWM working voltage is 12V, we need to change the voltage divider network if we want to work with other voltages such as at 24V/48V.

Voltage Divider Modification to 24V 48V

My Arduino Nano SPWM Generator module detects 12V input from unregulated 12V coming from Battery, then display it on LCD. It uses the same line as the IR2110 supply circuit but connects to the analogue input of Arduino via a voltage divider network. When we work with this voltage we don’t need to step down the input voltage nor need a regulator, so 12V input is mean the battery voltage to measure.

When we need to use this module at higher than 12V then we need to do a little modification on the voltage divider circuit, because in this situation a 12V input to the card comes from the step-down regulator. Thus we must make wiring direct to the battery.

First, cut the PCB trace connection between R1 and 12V on the header then rewire the connection from R1 to 24V or 48V inverter input.

Second, change the R1 value to 24kOhm for 24V input or 47kOhm for 48V. This is the calculation for R1

Batt = ( R2 / ( R1+R2 )) x Vin

Arduino Nano SPWM 12V to 24V/48V voltage divider modification
modification

The best ADC readings are in the middle of its range, So the voltage reading on the analog pin is about 2.5V at the specified battery voltage value. Thus we can determine the right combination for R1 and R2 at the desired input voltage. So I can use R1 with a value of 24kOhm for 24V and 47kOhm for 48V, both of which produce a voltage of around 2.5V.

R1 —> 24k @ 24V

R1 —> 47k @ 48 V

Coding Customization

For the code itself, there is no addition, it only needs to be adjusted to the new value as follows:

Battery protection value = (( R2 / ( R1+R2 )) x Vin ) / 5 x 1023

By using the values ​​of R1 and R2 above, we get:

Battery protection value —> 434 @ 21V

Battery protection value —> 466 @ 42V

if (battIn <= 434) alarmIndication(5);           // low batt @ 21V --> (2k7/26.7k x 21) / 5 x 1023 = 434
if (battIn <= 466) alarmIndication(5);          // low batt @ 42V --> (2k7/49.7k x 42) / 5 x 1023 = 466

Coding Customization for LCD

If you use an Arduino Nano SPWM generator with an LCD then the constant for the display must be changed as well, the value of this constant is obtained from the result of reversing the above formula

Vin = ADCreading x (( 5 ( R1 + R2 ))/( 1023 x R2 ))

dis1 = battIn * 0.04833;  // constant is the result of reversing the above calculation 24V
dis1 = battIn * 0.09;    // constant is the result of reversing the above calculation 48V

That’s all I can say, hope this helpful

greeting