Circuits for Low Voltage Detection

Description and Calculations

An indicator that lights up when we have a low battery to indicate that we should charge it can save many debugging hours when we are testing late at night and do not realize the battery has run low. We cannot measure battery voltage directly with the AD port, because battery voltage is higher than 5V and would damage the C32 board. Therefore, we used voltage divider to read the battery voltage. Convenient resistors were a 100k above a 10k, meaning that we read 1/11th of the actual voltage. We want a low battery signal at 7V because that is when the power regulators stop functioning correctly.

7V corresponds to 7/11 = .63V on the AD port. AD port range is 0V = 0, 5V = 1230. So .63V reads as 130 on the AD port, which is set as #define LOWVOLTAGE .

Schematics