This project came to life when I received an old fishing sonar from a friend (my dad). The sonar supply voltage is rated from 10V to 17V. It is normally powered by the 12V output of the boat’s outboard motor, a lead acid battery or a pack of 8 D batteries. After testing with a power source, I found out that it kept working with a voltage as low as 7.5-8V before it automatically shut off. It consume between 300mA and 400mA under normal conditions.
Being a remote control toys enthusiast for many years has had the effect of creating an accumulation of various sizes/types batteries on my workbench. I was an early adopter of the small 400 sized “Align T-Rex” helicopter which used the popular 11.1V/2100mA lithium polymer battery pack. These battery packs have a usable voltage of 12.6V full to 9V depleted.
I thought that it would be a good idea to use some of my old LiPo battery packs to power the sonar, as the voltage of a 3 cell pack is in the perfect voltage range of the supply. And also, it is way lighter to carry than a lead-acid or 8 D batteries.
After a life of intense usage (helicopter flying) these packs loose their punch, however they are still very capable for a less demanding usage. The idea is to extend the life of those battery packs before destroying them.
Even if my packs are older and do not perform optimally, I think that I could easily sustain a full day of fishing with 2 packs (~4200mA/h).
One of the issues with LiPo packs is that they do not handle over discharging very well; they can even self ignite under bad conditions. Especially if you try to recharge them when they are over discharged.
In this case, the sonar would only shutdown at a little under 8V which is too low for our pack (9V).
So this is where this project comes to life; make a circuit to automatically cutoff the battery pack at a specific low voltage.
The main concern here is to make sure not to over discharge the battery pack since after that it is quite hazardous to recharge it.
In the RC world, such modules already exists so you do not over stretch your packs when you’re flying but they do not cutoff (would obviously be bad) they just emit a strong sound signal at specific low voltage to warn you. In my case I want to totally disconnect the battery.My Requirements
- Does not draw current when connected and in the “Off” position (We do not want to drain the battery after the cutoff).
- Draw as little power as possible during usage (monitoring).
- Can handle at least a couple of amps of supply to the application.
- Does not regulate the battery voltage (just a pass thru); the output is the full battery voltage.
For the switching of the load, with the requirement of allowing a good amount of current supply, a relay was a good choice since it would isolate the application circuit current draw from the monitoring one. However, it takes quite a lot of current to keep a relay energized and this was also one of my requirement (minimal current draw during usage).
So the solution came with a latching relay. This less common type of relay will keep its last position even after the inductor is de-energized.
The way it works:
- When you plug the battery, if the relay is latched in the off position, nothing will happen as the monitoring circuit is de-energized and the output is off. If the relay was already latched in the on position, as soon as the monitoring circuit is energized and the mcu boots up, the battery voltage will be monitored and if it is too low, the relay will be latched in the off position, turning everything off. Otherwise, the relay will remain in the on position and the output is energized.
- While de-energized, pressing the “On” button will energize the monitoring circuit, booting the mcu. The mcu will measure the voltage of the battery pack, display the status LEDs (good-medium-low) and if the voltage is high enough, it will latch the relay in the on position enabling the output. Once armed, the circuit is self fed by the relay so letting go the "On" button won't turn off the circuit.
- During the time that the output is enabled, the monitoring circuit continually checks the battery pack voltage; if it falls under the threshold, the relay is latched in the off position and everything is cutoff (output and monitoring).
- At any time while the output is enabled, pressing the “On” button will force the monitoring circuit to show the battery status on the LEDs.
- At any time while the output is enabled, pressing the “Off” button will disarm the circuit by latching the relay in the off position.
- Plug your application to supply on the output.
- Plug the battery on the input.
- Press the “On” button to enable the output.
- At any time that the output is enabled, pressing the “On” button will display the battery status (three colored LEDs).
- While the output is enabled, the battery status is monitored and if the voltage falls under the lowest acceptable level (8.5V), the output will be disabled.
- At any time that the output is enabled, you can disable it by pressing the “Off” button.
The Program (Firmware)
The program is very simple and well commented. Every action is segmented in small functions.
What the main loop monitors continuously;
- Read the voltage once every second.
- If the on pushbutton is pressed and the circuit is deactivated and the voltage is high enough, the relay is activated.
- If the on button is pressed, the monitored voltage level is displayed on the lights.
- If the voltage is under the low threshold, the relay is deactivated.
My whole design is based on the latching relay. So I concentrated my build around that component. I chose an Omron G5RL-K1-E, the SPST version G5RL-K1A-E could also suffice for this application as we only use one side of the switch.
I chose an Arduino Pro Mini for this project as it is very small, and has a low power consumption since there is no usb-rs232 conversion chip on that board (you need a fdti cable or interface to program the board). I also removed the power LED and the onboard voltage regulator to minimize the power consumption. Without the 232 and the voltage regulator chip, it is just the mcu that will consume power. Another factor that drove my choice is that I have a bunch of them laying around.
The monitoring circuit is made of a voltage regulator (ams1117-50) ; I used an external regulator because the LiPo pack voltage when full is too high for the regulator on the Arduino Mini board. Also the coils of the relay take 150mA when energized. The AMS1117 can take up to 15V of input and source 1A. Perfect for our application, and I have a drawer full of those (how convenient).
D1 and D2 are standard protection devices when driving coils with an MCU. Q1 and Q2 are NPN transistors used as low-side switch to drive the relay with the MCU. The resistors R6-R7-R8-R9 were calculated so that the mcu would only source 8mA to drive the relay. Q1 is used to turn on the circuit, it is connected on the Arduino (D3). Q2 is connected to D2 of the Arduino to turn the circuit off. It can also be driven by S2 which override the monitoring and just latch off the relay. The resistors values on Q2 are lower than Q1 because of the diode D7 that is there to protect the Arduino from the S2 switch.
The zener D6 with R2, are connected to the arduino (D4), this is the signal to know the state of the S1 switch (so we can display the LEDs). The D3 diode is there so that when the circuit is armed and S1 is open, the zener is not energized.
Resistors R3-R4 are a voltage divider to monitor the battery voltage. The Arduino uses its analog pin 0 to do the monitoring. Diode D4 is there so that the resistors get the same voltage if they are fed by S1 or by the relay.
Zener D5 with R5 are connected to the Arduino (D5) to give a signal when the circuit is armed.
The monitoring LEDs and their current limiting resistors are connected to the Arduino (D8-D9-D10).
If you look carefully at the pictures, you might notice that some parts are different than what I documented(ex. transistors are 2n3903) thats because I'm using what's laying around and what I have available.The Build
I chose a 6cm X 4cm perforated board to cram all the components of my prototype. There is no real recipe on how to make this; it is more by experience and trial and errors.
I usually go by placing the biggest parts first; here the relay and the green wire connectors. After I decided to put my on and off transistors on each side of the relay etc. Put all the required components on the table so you always have a view on what remains to be put on; almost like making a puzzle.
Here is my Arduino Pro Mini with its LED and voltage regulator removed.
During the programming portion of the build, since it is easier to program, I was using an Arduino Nano to validate my program and finding my ADC values for the voltages thresholds.
In retrospect, since the Arduino Nano already has a AMS1117 onboard (I realized that after), I could have used that board and not put my own voltage regulator and capacitors in my circuit. I would also have benefited from the direct usb connection.
At the moment the whole circuit consumes 22mA during monitoring; I might try to make the mcu sleep for a good portion of the second that it does not do anything to see if I could bring down the consumption.The Future
If I decide to spend more time to refine that project, here are my ideas for improvements :
- Make a real circuit board and use surface mount components.
- Go 3.3V for the MCU and monitoring circuit. (instead of 5V).
- Support 2 cells(7.4V) LiPo packs as well (maybe a switch, or auto-detect).
- Use a smaller MCU (ATtiny or 8bit microchip) directly on the circuit board.