Ultimate (?) DIY dual battery controller!

Rando

Explorer
A year or so ago when I had my last (99) Tacoma, I was looking for a dual battery controller and was unimpressed with the commercial units, particularly for the price ($150 - $250!). So I decided to make my own. The first prototype worked well in my 99 Tacoma, up until it was bought back for rust issues. I have finally gotten around to putting together Mark II for my new ’04 Tacoma.
In short, it is a relay based (soon to be transistor based) micro processor controlled battery isolator and auxiliary load controller. It has a couple of features that make it a little more deluxe than what is commercially available:
• 4 line x 20 character LCD display in the cab to let you know the state of charge of the battery and what the controller is doing, and to adjust the operating parameters
• True battery capacity monitoring (in Ah remaining / % of charge / time to empty) based on the specific chemistry of the main and aux batteries and using charge and load current accounting (the same way that laptops keep track of their batteries). This is MUCH more accurate than measuring the voltage of a battery under load or under charge. The best part about this is that there is no more guessing about how long my fridge will run, the time-to-empty display lets me know that I can run my fridge for another 52 hours before I need to charge!
• Two individually controllable auxiliary fuse blocks for accessories – it measures the load current so it can estimate the run time available from the aux battery and can switch of each bank of accessories at predetermined state of charges (say 50% and 30%). Or you can configure it so that one is always on and the other is only on when the engine is running etc.
• A system to ensure that the starting battery gets fully charged before the aux battery is charged, as well as a time-to-full display so that I know how long I have to drive in order to fully recharge both batteries.
• Records statistics on the actual battery performance as opposed to rated battery performance so that I can watch my expensive Die Hard Platinum deteriorate over time. So far it has been performing better than rated.
• Fully re-programmable (it has a USB port) so that I can add more useless software gimmicks as I have more time.
• Safety monitoring so that it will isolate the batteries and/or disconnect the loads if the currents flowing to either are too high.

Enough with the sales brochure, and on to how it works. The brain is an Atmel ATmega328 microcontroller, in the form of an Arduino Duemilanove development board. This senses two current channels (the charge going into my aux battery and the current going out to the accessory fuse blocks) as well as the voltages of both the main and aux batteries. In general the state of charge of the aux battery is calculated by integrating the current going into the aux battery minus the current being used by the accessories. This works very well, but it subject to creep over long periods (weeks) due to the integration of small systematic errors. In order to compensate for this I periodically recalibrate this value when the battery has been at rest for 12 hours or more at room temperature (ie no charging and no loads) based on the open circuit voltage to state of charge function provided by Odyssey. I do the same thing for the starting battery based on the standard flooded lead acid charge curves.

The two batteries are connected by a 6 gauge cable and a 100A continuous duty solenoid (these suck and I intend to replace it with a transistor based solid state switch shortly). Based on the state of charge of the starting battery before the engine cranks the microcontroller decides how long to wait before switching the aux battery into the circuit to charge. There is also a ‘self jump start’ mode on the controller that forces the batteries to connect, but it has a time out function so that there is no chance of forgetting and leaving them connected.

The microprocessor and solenoid, current sensors and fuse blocks are mounted in a 6”x6”x4” waterproof junction box under the hood and the display is attached via a serial cable in the glove compartment in the cab. The display also has a rotary position encoder (think a mechanical version of the ipod click wheel) so that I can select different operating modes and adjust things like the low battery cut off state of charge or what parameters are shown on the display. The auxiliary battery is mounted in the truck bed in my wildernest, and is fed by a 6 gauge cable. There is also a sub-fuse panel in the ‘nest which is fed of the fuse blocks on the battery controller.

Well that is about it for tonight, while it is all working, I am not quite finished mounting it all up, and I will never be totally finished with the firmware! I will snap some photos in the light tomorrow and try and post up a schematic if anyone is interested. All told (not including the parts I already had) the system cost me about $75 and a week or two of evenings. It would probably be about $125 if you had to buy everything from scratch.
 

wrcsixeight

Adventurer
Depending on the (parts you already had) that price for the capability is amazing. There is a market for such a product, not only for people who frequent this forum, but the Whole RV and Boating world as well.

People spend 200 to 300 just for battery monitors capable of monitoring only one bank, not control battery isolation and give detailed readouts of loads and charging to and from multiple sources.

I'd love to see more specs and photos.
 

theksmith

Explorer
do post up more details, very neat stuff!

i've been wanting to get into the Arduino world, i first heard of it over on mp3car.com
 

kenallwine

Adventurer
I would love to see pictures of your system as well as a parts list and schematic. I love tinkering around!
 

dustboy

Explorer
Wow..that's way more sophisticated than anything I'd ever need, but for the price, why not?!?

Any chance of integrating solar charging?
 

Rando

Explorer
If you made any effort to factor in the time developing/building this thing, it would probably sell in the $300 to $400 range. But if you are adventurous tinkerer (or possibly an embedded systems engineer) it is not that hard to put together.

Photos will have to wait until after work, but here is a rough breakdown of the cost:

Arduino $30 (sparkfun) I had this.
4x20 LCD $15 (ebay)
Solenoid $25 (ebay) I had this lying around.
2 x Automotive solenoids $4
2 x current sensors (I built these using shunt resistors and differential op amps, but you can buy inductive ones on ebay for about $20)
2 x fuse blocks $6
Darlington transistor array $1 (Newark)
Shift Register $1 (Newark)
rotary position encoder $4 (sparkfun)
5V regulator $1 (Newark)
Waterproof junction box $9 (Home Depot).
Various passives (resistors, protection diodes etc $5)
A bunch of wire.

If you really start from scratch, $150 - $200 is probably more reasonable. As an aside, you can save a fair amount of money by getting your heavy gauge wire from jumper cables (32 feet of nice stranded 6AWG wire for $15 !)






Depending on the (parts you already had) that price for the capability is amazing. There is a market for such a product, not only for people who frequent this forum, but the Whole RV and Boating world as well.

People spend 200 to 300 just for battery monitors capable of monitoring only one bank, not control battery isolation and give detailed readouts of loads and charging to and from multiple sources.

I'd love to see more specs and photos.
 

Rando

Explorer
Here are some photos of the battery controller, I apologize for the poor quality, it is dark in the man cave.

The first photo shows the main box mounted to the ABS bracket on the passenger side fender. The two fuse blocks are on top each independently fed by one of the two binding posts on top. The connections for the batteries and the remote display are on the drivers side. The white cable is the lead for the remote display, which is currently not installed in the cab for testing purposes.

The second is a the connections for the Main battery (left) ground (middle) and Aux battery (right). Above that, the recycled serial cable is for the remote display/controller. The access cutout for the USB port is not really visible, but it is on the top left corner.

The third is a quick peek inside. The red board is the Arduino interface board (built on a proto shield) with the Arduino below. The smaller green board are the current sensors. The main solenoid is mounted to the underside of the Aluminium plate.
 

Attachments

  • IMG_7380.JPG
    IMG_7380.JPG
    52.9 KB · Views: 371
  • IMG_7382.JPG
    IMG_7382.JPG
    62.9 KB · Views: 255
  • IMG_7378.JPG
    IMG_7378.JPG
    54.8 KB · Views: 359

Rando

Explorer
To follow on, here are some photos of the remote display/controller. I am working on adjusting the backlight, so it is not currently mounted in the cab, but it usually sits in the glove box. The display is not quite finished as it still needs to be painted and I need to find a knob for the rotary encoder/push button.

The first photo shows the default screen with the engine off and the batteries isolated. The values are 'load' which is the instantaneous current. Aux battery capacity remaining in Ah and as a % of the manufacturer specified capacity. The last line shows the run time to empty (well actually to the user defined maximum depth of discharge) based on the average current draw since the engine was last shut off. In this photo my fridge is on, but the compressor is not running and some of the LED lights are on in the 'nest.

The second photo gives an example of the menu structure. You move the asterisk to the row you want by turning the encoder, then press the encoder to select that option.

I didn't want to start the engine in the garage, so I didn't take any photos of the batteries charging.

Any one have any ideas for other options to implement in software?
 

Attachments

  • IMG_7386.JPG
    IMG_7386.JPG
    30.8 KB · Views: 254
  • IMG_7387.JPG
    IMG_7387.JPG
    32.1 KB · Views: 250

Rando

Explorer
Seeing my car is parked in the garage 95% of the time, I am unlikely to add solar, but it would be very easy to do. You just need to attach the output from the solar charge controller between the solenoid and the current sensor for the aux battery. That way the current from the solar panel would be correctly accounted for in the state of charge calculation. I am planning to add a float charger to keep the aux topped up when I am not driving it very often.

Wow..that's way more sophisticated than anything I'd ever need, but for the price, why not?!?

Any chance of integrating solar charging?
 

wrcsixeight

Adventurer
Any one have any ideas for other options to implement in software?

If someone were to add Solar, and an MPPT charge controller. It would be neat to see the panel voltage, The amps into the controller vs the amps out independent of alternator amperage or auxiliary loads.

A digital readout of engine oil temp, water temp, tranny temp would be useful if the vehicle did not have the gauges, or inaccurate analog gauges.
 

Michael

Adventurer
Great design! It looks very capable for battery management. I hope this thread continues as a "how to" so I figure out how to build one too. You've hit all the issues I struggled with in designing my own aux power system -- which is not nearly as capable as yours! Or maybe I can be the first customer :drool:
 

Rando

Explorer
Unfortunately these all seem like hardware additions as well as software additions. Measuring the panel voltage/current would be fairly easy, and there can be two spare analog channels available for this. The engine temperatures etc are probably best read from the ECU via OBDii. In fact that is why I first bought the arduino and LCD I used for this project. They were initially used in my old Tacoma as a homemade scan gauge in addition to a simple battery controller.

If someone were to add Solar, and an MPPT charge controller. It would be neat to see the panel voltage, The amps into the controller vs the amps out independent of alternator amperage or auxiliary loads.

A digital readout of engine oil temp, water temp, tranny temp would be useful if the vehicle did not have the gauges, or inaccurate analog gauges.
 

nfpgasmask

Adventurer
This is an awesome setup. A full step-by-step how to write up would be awesome. :punk03:

I REALLY need to figure out a way to have back up power for back country solo expeditions.

Bart
 

Rando

Explorer
Unfortunately I don't think I have the time to do a full step by step guide for the uninitiated. Unless you already have some experience with micro-controllers and building your own circuit boards it would be quite a challenging project.

That being said if there are any boffins out the there that want to use this as a starting point, I would be happy to PM you the schematics (once I draw them after the fact) and the firmware code.

On another note I did some testing by cycling my battery from fully charged to 50% charged, and the system seems to be accurate to about 10%! Now I just need to build/buy an on board float charger to keep the aux battery charged as I am driving the Tacoma a lot less often.

This is an awesome setup. A full step-by-step how to write up would be awesome. :punk03:

I REALLY need to figure out a way to have back up power for back country solo expeditions.

Bart
 

Forum statistics

Threads
188,339
Messages
2,905,755
Members
229,959
Latest member
bdpkauai
Top