Battery board with protection cut-off

Posted by Fred C. (W6BSD) on Sep 16 2019

A couple of months ago I designed a convenient Battery Monitor board with a voltmeter, one Andeson PowerPole connector as well as a USB power connector.

This board is suitable to turn any 7Ah, 9Ah SLA or Lithium battery into a convenient power source for indoor or portable operation. For example, I am using mine to power an AllStar node.

To protect the life of your battery, this board include an over-discharge protection circuit. I have also equipped this new version of the board with a PPTC Resettable fuse. No one wants to be in the field with a blown-up fuse and no replacement.


Since this article is an iteration from my previous design, I will only describe here, the voltage monitor and cut-off circuit.

The heart of the battery over-discharge monitor uses an ATTINY85 micro-controller. An ATTINY gives a very flexible solution that is cheap, flexible, and requires a minimal amount of external parts.

The design is straightforward. A voltage divider measures the voltage, and the power is switched on and off by a MOSFET. The voltage divider on the input has to have high resistance to keep power low. It would be preferable to use low tolerance resistors1 to guarantee precision.

Battery discharge cut-off
Battery discharge cut-off

A small circuit using an LN7805 and a couple of capacitors are providing the 5-volt power for the ATTINY.


In the setup() function the MOSFET signal is set to high if the power of the battery is higher than the minimum threshold.

In the loop() function, we measure the voltage, if the voltage is lower than the lowLimit threshold the gate of the MOSFET is set to low, turning off the output power.

If a battery charger is plugged in, the MOSFET turns on as soon as the voltage reaches the highLimit threshold.

 * Copyright (C) 2019 by Fred C.
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted.

 * voltage | voltage divider  |  normalization
 * 12.5    * 20 / (20 + 82)   * 1023 / 5
 * The ATmega will return a value between 0 and 1023.
 * 1023 = 5 volt
const int highLimit = 12.5 * 20 / (20 + 82) * 1023 / 5;
const int lowLimit  = 10.5 * 20 / (20 + 82) * 1023 / 5;

const int mosfet = 2;
const int sensor = 3;

int measurement = highLimit;

void setup() {
  pinMode(sensor, INPUT);
  pinMode(mosfet, OUTPUT);
  if(analogRead(sensor) > lowLimit)
    digitalWrite(mosfet, HIGH);
    digitalWrite(mosfet, LOW);

void loop() {
  measurement = analogRead(sensor);

  if(measurement > highLimit) {
    digitalWrite(mosfet, HIGH);

  if(measurement < lowLimit) {
    digitalWrite(mosfet, LOW) ;

Programming ATTINY micro-controller is easy. An Arduino UNO board can be used as ISP by following the instructions from the Arduino Website.

I use the Tiny AVR Programmer, a cute little USB key developed by Sparkfun. This device makes the programming of the ATTINY quick and easy.


The layout is simple. It's a two-layer PCB with ground plane on both sides.

Battery Monitor PCB top side
Top side

Final result

This following picture shows the battery monitor once assembled and installed on a battery and ready to use.

Battery Monitor PCB bottom side

You can get the full design, schematics and the PCB design from my account on or download the Gerber file.

I also have some PCB left, and if you are interested, I can send you one. Just send me an email or post a comment bellow.

If you are a ham radio operator, you can find my email address on my QRZ page.

  1. I get the best results with 1% tolerance resistors. 

Tags:  QRP    Battery    Arduino

Comments !