Note: This is a work in progress and will be updated over time
This is the design specifications and the design choices for a battery monitor. This is designed as a fuel gauge for batteries within stand alone power supply systems, typically lead acid batteries. Please click here for reasons why we are working on this project.
- DC current monitor (bi-direction) 10A/50/A100A versions
- DC voltage monitor 9-60V DC input (12-48V DC systems)
- Micro-controller based
- High accuracy sampling 12 bit or above
- High speed 2kHz or above data collection
- Temperature sensor (internal and remote)
- 5v or 3v3 operation voltage for processor and peripherals
- High efficiency – very low power (average power consumption <20mA)
- Micro SD card data storage
- USB flash drive data storage
- Mini USB connection for computer
- LCD display with ambient light auto-sense for LED backlight
- Input buttons x 3
- RGB LED status indication
- Plug-in modules for extra functionality
- Open-source design
- Integrate easily with other open-source products
- To send text message data and warnings
- Wifi connection for data connection
- Ethernet connection for data connection
- Wireless data connection (via serial data?)
- Charge regulation for battery charging
I am trying to design this unit to be:
- Easy to use
- Open design
- Modular – same unit can be used in different projects
I have done a review of micro-controllers in a blog post here, so I wont repeat that.
The main criteria are:
- open-source/free programming tools
- >32k program memory
- >1k RAM
- high clock speed
- USB stack management built-in
- C language compiler (or similar)
- Programming environment which is not code limited
At present my choice is for a 32 bit PIC IC. This has easily enough power to cope with this application and be expanded even further. It has USB connectivity, Ethernet, CAN bus, SPI etc etc. PICs also have free un-limited development tools which are very powerful. I will write the code in C and use a C compiler.
I have been using the PIC24F Starter Kit. This is as powerful as required and the starter kit contains nearly everything required to get this project moving forwards.
The only disadvantage is that the ADC is only 10 bits which will mean that I will need to use an external ADC, perhaps with an SPI output.
I have written some design information relating to DC current measurement here.
The resolution of the current measurements must be pretty accurate – at least 12 bit or higher resolution. In general the ADCs built into micro-controllers only 10 or 12 bits
Voltage measurement will be done using a potential divider, with high accuracy resistors.
Power supply options
Supplying power to the circuit is another issue. We need the unit to be efficient, so that we do not waste valuable energy, and also take a wide range of input voltages. Our specification are that the input voltage range must be 10 to 72V DC, with an output voltage of 5V at up to 500mA.
Linear voltage regulators
Linear voltage regulators maintain a constant output voltage by dissipating the excess voltage drop. The main issue is that, with high input voltages, we get a high voltage drop and hence high power consumption at high voltages. For example, with 24V input and 5V output at 500mA this gives a voltage drop of 24-5 = 19V at 500mA, which is 9.5W. This component would get very hot and hence would need a large heatsink. It is also a waste of power – adding 9.5W for 24hrs a day would be a large drain on the renewable energy system. Here are the main types of linear voltage regulator:
The first component to consider is the ubiquitous 7805 voltage regulator. This is a cheap and cheerful linear voltage regulator. The maximum input voltage is 35V DC, hence making this component not suitable for this project.
A high input voltage regulator is the TL783 device. This can take up to 125V DC input. The main issue is that to regulate to 5V from 100V DC means a high voltage drop and hence high power dissipation even at relatively low currents. This makes it not suitable for this application.
DC to DC switched mode converters
We have seen that we cannot really use linear regulators for this design, due to the high step down range. Hence we need to change to a DC-DC converter. Rather than just dissipate the power (voltage drop multiplied by the supply current), a DC-DC converter will convert the input voltage to the correct output voltage. For example 50V input and 5V output at 0.5A, the converter would only take around: 5 x 0.5 = 2.5W required by the load, hence the supply current would be 2.5W / 50V = 0.05A. There are some inefficiencies, but this is a much more sensible option than the linear voltage regulator. There are many different designs for DC-DC converters, but basically we are wanting a step-down (also called a buck) converter.
National Semiconductor has an online design program for their range of DC DC converters. I ran the design calculator with the design parameters of 10-72V DC input and 5V 0.5A output. This produced a full design. Its pretty incredible, with full simulation of the circuit, thermal analysis, bill of materials. I clicked on the ‘order parts’ and get all the parts ordered for me, easy (although at prototype cost and delivery from the US).
The design was based upon their LM5574 DC DC converter IC. The cost of this part was £2.53 from RS. This has a very wide input voltage range (6-75V DC) which makes it prefect for this application. It does not require many external components.
Another design was based upon the LM5009. This required fewer external components and was slightly cheaper, but had lower efficiency. It also had lower output current capability.
Maxim are the other main producer of DC-DC converter controller ICs. Their range was a little bit more expensive than the National Semiconductor range.
A design based upon the MAX5035 would work, but cost price of the Maxim IC is around twice that of the National semiconductor device (around £5.50 each in low quantities).
Voltage regulator design
The final design will be based upon the LM5574 from National Semiconductor. A prototype will be developed and tested with a wide range of input voltages.
Data about the prototype design and testing will be entered here.
I will be using KiCAD PCB design software for this PCB. Please check to blog for postings on making PCBs.
My idea is to have a unit which can stand-alone with built in LCD, USB, SD card, voltage regulation, voltage and current measurement. but the PCB will be designed so that there are pins available which are compatible with an Arduino shield, so people can take the battery monitor and have access to the data recorded. The data can be accessed using the serial port.
- Back-lighting required
- Auto-adjust for the available conditions (i.e. switch on LED back light if it is dark)
- Bar graph display?
- Graphics? More visual
- Bar-graph with LCD 16 x 2 display
- Also need to show numbers
On-board storage of data will be very important. Basically this unit is a glorified data-logger. The requirements for storage are:
- Standard availability
- Able to take the storage out easily
- Storage should be usable directly into a computer
Note: One idea from barcamp – use automatic adjustment to average the data. this will limit that max size of the data storage required and mean that old data is averaged, rather than lost. the unit can then be ‘in the field’ for a long time but still contain some very useful data.
Basically this means taking minute data
This will change colour depending upon the state of charge of the battery. This is a very useful, easy, visual indication.
Battery state of charge algorithms
Physics of lead-acid batteries
Factors affecting state of charge
Idea is to have a battery model which can be used to predict the various values. This would be constantly learning by adjusting the various components of the model using the real data being obtained.
Where to store the battery model?
Plug In modules
As mentioned in the specifications, additional modules should be available which can:
- To send text message data and warnings (GPRS)
- Wifi connection for data connection (WiFi)
- Ethernet connection for data connection (Ethernet)
- Wireless data connection (via serial data?) (Wireless)
- Charge regulation for battery charging
1 GPRS Connection
GPRS or GSM is the protocol required to send text messages. This module will require a valid sim card and contract.
GSM modules available include:
DIY drones module
2 WiFi Connection
3 Ethernet Connection
4 Wireless Connection
5 Charge Regulator module
To do list
- Which micro-controller to use? – done 25/7/2011
- Which current monitor to use? – Written initial article – need to decide on final design
- Voltage sensing
- Power supply design ideas
- Storing data
- Battery state of charge algorithms – research
- Prototype photos
- Plug-in module design