Introduction: PIC 12F675 Programmable 12V Battery Monitor
Being an active outdoor guy, I have a few different types of 12V lights and a variety of battery types.
- For flying RC planes and quadcopters at night, we use sealed lead acid batteries to power our club tables.
- For fishing, I have a few 12V 2W led lights, powered by 2200mA, 3 cell LiPo batteries.
- For camping, the tent and trailer lights are using 12V sealed lead acid batteries, and portable lights 2200mA 3 cell LiPo batteries.
As I do not want to totally discharge any of my batteries, I decided to design this battery monitor.
- Easy to use and install permanently.
- To be able to use on any battery type used for 12V lights.
- Non-irritating alarm.
- Adjustable alarm pick-up value.
Instead of setting the alarm value using a pot, I opted for an easy programmable option, thus the need for a microcontroller (PIC 12F675).
The 12F675 is powered via the 78L05 regulator, and this voltage is also the A/D converter reference voltage. Using a resistor voltage divider (R2 & R3), the battery voltage is measured using the internal A/D converter of the 12F675.. This divider values were chosen such that the maximum measurable voltage of the 12F675 will be around 15V, with a resolution of around 15mV.
The buzzer is a standard 5V piezo buzzer, and will give 3 short beeps ever 15 seconds once the battery voltage is below the alarm value.
Programming of the alarm level is obtained with a 3-pin header and mini jumper.
Maximum input voltage 20V
Minimum input voltage 8V
Minimum alarm voltage level 8V
Maximum alarm voltage level 15V
Idle current 3.12mA
Alarm voltage resolution 15mV
Step 1: Building the Battery Monitor
You will need the following components:
R1 10K resistor
R2 100K, 1% resistor
R3 47K, 1% resistor
C1, C2 0.1uf capacitors
IC1 Microchip PIC 12F675
IC2 78L05 voltage regulator
SG1 5V piezo buzzer
JP1 3 pin header, with mini jumper
Build the circuit using veroboard or PC Board.
Step 2: Using PC Board
As I wanted to build a couple of this Battery Monitors, I opted to make a couple of PC boards. Using the free version of Eagle, I was able to make 12 boards at once on the 100 x 80 PC Board.
However, the circuit is easy enough to build on a piece of strip board.
Step 3: Assembly
Using the PC Boards, assembly took only a few minutes per board. After testing the circuit, I used heat shrink to cover the project to keep costs down.
The PIC 12F675 needs to be programmed first. Please upload this HEX file first before soldering on the 12F675, or use an IC socket.
Step 4: Programming the Unit
You will need a variable power supply and decent voltmeter for calibrating.
- Before connecting the unit to the power supply, adjust the power supply to the desired alarm value.
- Place the mini jumper across pin 1 & 2.
- Connect the unit to the power supply.
- Unit will beep 6 times.
- After a second, unit will beep once.
- Unit is now programmed.
Disconnect unit from power supply, and place mini jumper back between pin 2 & 3 for storage.
The calibration only needs to be done once, as the alarm value is stored in EEPROM memory. Should you want to change the value, simply redo the calibration process.
Due to the many different types of batteries, I am not able to give precice minimum levels for each type. I use the following values for my equipment:
- 12.0V for 12V Sealed Lead Acid batteries.
- 10.0V for 11.1V, 3 cell LiPo battries.
- 13.3V for 14.8V, 4 cell LiPo batteries.
We have a be nice policy.
Please be positive and constructive.