Dual Channel Battery Charger/Analyzer

This is an efficient dual channel battery charger/analyzer for maintaining rechargeable batteries with programmable parameters and logging.

Similar projects worth following
This is a follow up of my working rev 2.0 Dual Charger Battery Analyzer design. I will be incorporating additional features, improvements, cost reductions and design for manufacturing (DFM).

This is a useful tool for determining the charge/discharge characteristics of batteries which help you reuse or for fixing/maintaining batteries. With your own firmware, this could be used as a programmable dual electronic load/current source/power supply.

* Dual channels. Each channel can operate independently. (Scalable to higher number of channels and/or power)
* Efficient switch mode power supply for charging/discharging reduces cooling requirements
* High frequency (~200kHz) PWM - smaller L&C and less ripple current
* Battery parameters are user programmable for different battery types
* Stand alone or operate from a Windows PC
* Flexible power source - USB or external power supply
* Battery voltage is not limited by external supply voltage
* Reverse polarity protection

What is it?

It is a battery charger/analyzer. It is not going to save the world from an alien invasion or cure cancer or something equally noble. It'll let you charge, maintain, and test the discharge characteristics of rechargeable batteries. It is a nice tool for re-purposing or evaluating cheap batteries of unknown capacity/performance as . It helps to save you money in the long run by not throw away otherwise usable batteries.

Whenever the topic of electronic load is brought up on HaD articles, testing batteries come up quite often as one of the main applications.

What does it do that similar design doesn't?

What set this charger design different are:

  • Flexible power source - two independent buck/boost converters allow higher/lower than input voltage. So you could be charging batteries from USB, vehicle power or green power source such as unregulated power from small solar power panel/wind power etc.
  • High switching frequency beyond traditional uC PWM type of design can offer. This allows for the use of much smaller components and also reduces input/output ripple current.
  • During discharge mode, the switch mode converter works to draw power away from the battery. The power can be diverted to external use. e.g. charging a Super capacitor bank, light. etc.
  • Scalable design for additional channels and/or higher power.

Functional Blocks

The following is the block diagram. This is essentially a programmable power supply during charging and an electronic load during discharging. The firmware also implements the charging/discharging algorithms for the supported battery types and display/communicate with the Window PC charger software.

Charging Mode

In charging mode, the input power is routed into a SEPIC converter and the output is used to charge the battery. The input voltage can be higher/lower than the output and the output is DC blocked. The voltage/current is monitor by the microcontroller and controlled by means of PWM duty cycle. The microcontroller uses a charge algorithm that is tailored for the battery chemistry and capacity. The parameters for a supported battery type can be edited and saved by the end user on a computer.

Discharge Mode

In the discharging mode, the input power is routed from the battery via the converter into an external load. By monitoring the voltage, current over time, the battery capacity and characteristics can be analyzed. The discharge is also controlled by user defined parameters.

The same changing circuit can be used for discharging by simply rearranging the input and output. The external load can be a large battery, a super capacitor bank etc or a simple resistive load. The two channels can share the same load output. The discharge can work all the way down to below 1 volt as SEPIC converters boost the battery voltage up.

By keeping the dissipation outside the unit, I have reduced the cooling requirements. This also improves on the accuracy due to components temperature coefficients. There are commercial RC Battery Analyzer designs that use a MOSFET as a resistive load which limits their discharge capacity.

The microcontroller has native USB hardware and raw data can be streamed to a PC for logging/plotting purposes. The unit can operate in a stand alone mode or connected to PC. There is bidirectional communication between the unit and the PC, so unit can be controlled from either side. (See here)


This is the part that is done very differently than most microcontroller based chargers. I use Analog PWM for the SEPIC converters in my design. This is why the SEPIC operates at 200-300kHz instead of the much lower tens of kHz that most common digital PWM design seems to use. This means the the components do not need to store a lot of energy until the next period arrives. Smaller and cheaper (because less material) inductors/capacitors can be used and you'll also get smaller ripples.

By lowering the peak ripple current, you lower the amount of I^2*R losses. When the frequency is too high, the switching losses come...

Read more »

  • 1 × Microchip TC4426A Power Management ICs / MOSFET, Bridge Drivers and Controllers
  • 2 × Bourn SRF1260 Inductors, Chokes, Coils and Magnetics / Fixed Inductors, Chokes and Coils
  • 1 × Alpha Omega AON7804 Dual N-MOS 30V, 22A, Ron
  • 1 × SiLabs Universal Bee EFM8UB1 16kB Microcontroller, 48MHz 8051 Core, supports USB device 12Mbps
  • 1 × "Nokia 5110" LCD China ( SKU: 7214000, SKU091069) Graphic LCD, SPI

View all 7 components

  • Calibration - Let's all calibrate and have a good time

    K.C. Lee09/30/2015 at 15:10 0 comments

    This is not the most exciting part of the project. I basically take some readings of the input Voltage/current (X) vs display values (Y) and use linear regression in Excel to compute the coefficient for a linear fit. The voltage is done by connecting the positive and negate terminals of battery inputs to a isolated bench supply. The current reading are done by connecting a bench supply with current limiting between the ground of the load and the negative terminal of the battery.

    The large number of data points helps for reading errors and non-linearity. I take a lot more readings for the current as the sampling resistors can get heated up at high currents and could affect their readings.

    The following screen shot shows the result of the regression (CH0 voltage))

    The regression statistics tells us how good/bad the data are by how close the results are to 1. The important part is the Coefficients.

    There is also a table that shows the residual output which basically compares the results of a fit vs the input data Y. That gives you a rough idea of the accuracy (vs what you use to calibrate your device).

    In my channel 1 current data (row 7), I probably meant to type in -831mA instead of -931mA. There is a large residual (error) on that particular row. I can go back retake the reading etc to fix it and redo the regression.

    After getting the coefficients, a lazy person would just use floating point math and call it a day.

    That can bloat up the code and storage if you are already running low on memory. There is a much better way using integer math. Both the input and output are 16-bit integer as I only have at most 4 or 5 significant digits in my ADC to start with. The scaling can be approximated using 16-bit fractions. A 16-bit x 16-bit multiply produces a 32-bit result, so we'll need to use 32-bit math.

    I use the "Fast Decimal to Fraction Approximations" here

    I use the largest fraction that fits inside 16-bit unsigned integer. This particular fraction matches the first 10 digits of the decimal values and it more than good enough for what I use it for.

    I notice that the ADC offset seems to drift over temperature. The offset is around 2-3mV and seems to drift over time.

    Here is the routine for the offset adjustment. The (running average) ADC values is compared against the calibrated offset. If the values are within a threshold i.e. very close to zero, then the offset is overwritten.
    void ADC_ForceZero(void)
      uint8_t i;
      int16_t Offset;
        Offset = ADC_Cal_Data[i].Offset-ADC_Data[i];
        if((Offset>-ADC_AUTOZERO_THRESHOLD) &&
           (Offset< ADC_AUTOZERO_THRESHOLD))
          ADC_Cal_Data[i].Offset = ADC_Data[i];

    This kludge seems to work well enough for now.

  • Progress report For Semi-final

    K.C. Lee09/20/2015 at 14:40 0 comments

    Summary of Activities: Current phrase: progress as of Sept 21

    Hardware/firmware components and their progress

    Windows host software has been patched to recognize the new PID/VID and the new interrupt packet for this hardware version. The software is working on Windows 7 and Windows 10. On Windows 10, the install requires a different step because the OS is more strict about signing drivers. See here.

    Current issues I am working on (to bring to 2.0 baseline level)

    • NV Storage routine that replaces the internal EEPROM on the atmega microcontroller.
      • I am trying to use the smaller pages of Data FLASH for efficient storage of battery type and calibration data. Trying to write my old Flash Translation Layer and redesign the data structure/support code around it.
      • This module affects battery type, calibration and new host interface routine needed to be added.
      • I can attach external I2C to GPIO port if this proves to be too much a firmware headache.
    • ☑ Calibration of the ADC for voltage / current on this new design. (done)
      • Right now this produces garbage as scaling factors and offsets have not been set.
      • Over voltage/current code needs the new scaling factor. Don't need to be exact, so not need per unit calibration.
    • ☑ Need to reformatting the UI display for the higher current range. (done)
      • Right now the formatting routine doesn't know how to handle the larger number on the device side, so there is garbage.
      • Also need to change the display format to maximize significant digits within the LCD space available.
        e.g. 0-999mA display as XXXmA and higher currents as XAXX (or 1.XXA)
    • Need to add battery discharge/constant current sink option
      • UI and PC GUI support needed
      • Battery charger state machine code
      • Battery type entry
    • PID parameters needs to be tuned to the new design.
      • different sawtooth generator with different voltage levels, faster RC filter time constant etc. changes the transfer function of the system. Tuning of the PID parameter would optimize the performance of the feedback loop.
      • need to rework the design to take into account of duty cycle is depending on input/output voltage ratios.
    • SEPIC charging circuit needs to be tested – shouldn’t be an issue as this part is just new components with similar values as 2.0 in new and improved layout.

    Future work - improvements

    • PC software to include plotting function, battery capacity analyses etc
    • Battery holders PCB with integrated thermal sensors
    • NiMH battery charging algorithm incorporated into charger state machine
    • Some sort of peak power tracking to maximize charging power from solar power or power sources with limited current.

    Very dry video for status update:

  • Filling the need between FLASH and full EEPROM Emulation

    K.C. Lee09/11/2015 at 19:01 0 comments

    I am using the largest of the EFM8UB1 series (so far) and 16kB FLASH is already kind of small. I really can't spare any of that for EEPROM emulation for storing calibration and battery settings. There are 14 of these 64 bytes block FLASH intended for data storage. It is all fine and dandy except it is left as an exercise for the end user to write their own libraries!

    Silabs has a couple of app notes (AN568, AN798) for EEPROM emulation inside program FLASH which has an upper limit of 255 bytes each as they are only using a block at a time. The size is limited by the sector size. Zilog on the other hand has an interesting app note AN140 here that uses multiple blocks of FLASH to implement as much EEPROM as you want, but their solution has a lot of overhead (32kB of FLASH to emulate 4kB of EEPROM) as they are tagging the individual EEPROM bytes. There got to be a good middle ground.

    After a lot of head scratching, I have decided to write my own code. As I was doing that, I realize that I actually don't need full EEPROM emulation at all. All I need is an abstraction layer, FTL (FLASH Translation Layer) that can subdivide the 64 bytes block into smaller chunks and manage the read/write/erase.

    The idea is to have a header (FTL_TAG, FTL_ADDR) for each the sub blocks that are scattered over the FLASH.

    • FTL_TAG can be one of these values: { FTL_TAG_BLANK, FTL_TAG_WIP, FTL_TAG_CUR, FTL_TAG_OLD}
      It tells the program whether the sub-block is Blank, WIP (write in progress), Current or Out of date.
    • FTL_ADDR is the sub-block address

    For my application, I could make do with about 22 bytes blocks. The closest one is to divide the 64 bytes blocks into two blocks: 30 bytes + 2 bytes header each.

    For Reading a block: Use a linear search for matching the FTL_ADDR in the header to find the right block. Since I am only dealing with 28 blocks, I don't need fancy searches or link list etc. Once it is found, copy the data.

    For writing a block: By tagging the header during various stages, we can some what recover if the write was interrupted by power failure/reset.

    1. Do a check for blank FLASH pages if we need to do a garbage collection
    2. Find a blank location by searching for FTL_TAG_BLANK.
    3. Mark the header as FTL_TAG_WIP
    4. Copy data to the block
    5. Mark the old location (if exists) as FTL_TAG_OLD
    6. Mark the new block as FTL_TAG_CUR
    7. Do a check if we need another garbage collection because of step 5.

    Garbage collection: Now once in a while, we'll do some garbage collection when the amount of blank FLASH pages are below the water mark: FL_SPARE_PAGES. Having spares around means that we can always make room by packing the blocks and erasing stale FLASH blocks.

    1. Search for Erasable pages i.e. pages that are not FTL_TAG_BLANK nor FTL_TAG_CUR. (WIP means we previously crashed in a write while OLD means it is out of date. Anything else means that there was some data corruption.)
    2. If the other FTL page sharing the same FLASH block is FTL_TAG_CUR, we'll need to copy it into a blank FTL page.
    3. Erase the current FLASH page.
    4. Repeat 1-3 until we are done

    The datasheet specifies 20k (min) and 100k (typ), so that's plenty for my application without wear levelling. AN798 deals with wear levelling for those who are interested.

  • The Win of change - how to install libusb-win32 .inf driver

    K.C. Lee09/11/2015 at 03:23 0 comments

    I got a tablet to replaced the netbook died recently.

    It seems that windows has changed the driver signature in Win 8.1 and higher. What used to work for the inf-wizard inside libusb-win32 no longer work. Thankfully there is Zadig.

    After selecting Reinstall Driver...

    Now it shows up under device manager correctly under Windows 10.

  • It's soldering and bug squishing time!

    K.C. Lee08/22/2015 at 01:50 0 comments

    Start off with the power supply section of the board. USB connector, diodes, inrush control, 5V SEPIC, regulator for the MOSFET driver.

    • I have 5.10V at the output, and 9.4V (no load) for the MOSFET gate supply. They are both within range.
    • With the charger powered by the supply from the coax connector, I notice that there is leakage current flowing through the reverse biased schottky diode back to VUSB. At 15V, 70C, the current can be up to 40uA. A quick fix is to put a 10K resistor parallel to C2 (VUSB decoupling cap). This would limit the open circuit voltage to 0.4V. That should enough margins.

    Had a bit of slight melting on the stickvise, so I tape it off with the Kapton tape hoping that the extra insulation would help with not melting the plastic during hot air reflow.

    That didn't work too well. I am now putting on a layer of copper tape first and then a layer of Kapton tap over it. The idea is to use copper tape as a heat spreader/heat sink over a larger area. The Kapton tape offers electrical and some minor thermal insulation.

    Soldered in the microcontroller, saw wave generator, relay driver.

    There is 3.28V coming off the built-in 3.3V LDO of the Microcontroller.

    Here is what the sawtooth waveform looks like. It is a bit faster than I expected, but still a reasonable frequency. There is a bit of rupples on the slopes of the waveform even after I solder in the 10uF cap just above the LM339 for the 5V supply.

    So what happens is that the long ground wire on the scope probe picks up noise. This is the waveform captured by using a modified ground probe looks like. There is a bit of non-linearity on the beginning and the end of that slope. That's not an issue as the PID control loops can correct for that using the voltage/current ADC readings.

    My netbook died and has been sitting on my "new" refurb tablet since last Friday. They are a really horrible company to deal with. It is a pain to go back and forth between my computer desk and work bench to soldering a few parts at a time. Thankfully this board isn't that complicated (at least for me). It is slowly coming together in last couple of hours. Looks like I can get it fully assembled by tomorrow.

    It would seem that I messed up the silkscreen on the bottom layer. There isn't any! The silkscreen alignment on this batch is a lot better than my last one. May be my mounting holes and silkscreen outline helps a bit with their alignment. It looks looks like they now void the solder pads too. My fonts silk screen looks a bit thin.

    Soldering took about 4 hours and it is finally done.

    SiLabs starter kit debugger detects the microcontroller. That's always a good sign.

    With erased FLASH, the charger uses 31.5mA at 5V. Load FLASH with the code I got, my debug shell shows up.

    • ☑ serial port works
    • ☑ C2 debug port works
    • ☑ LCD is now working
    • ☑ PWM is now working
    • ☑ Timer interrupt is working
    • ☒ USB code not turned on yet

    Found 1 mistake. P3.1 is for VBUS detection, but for some reasons, I thought I could use it to read the analog value but keep on using the ADC MUX VREGIN input. :( Unless there is an undocumented MUX value, I'll have to cut and jumper a couple of traces to connect P3.1 to VBUS on the USB connector and use the spare P1.7 to the voltage divider instead.

    The hardware is more or less working. The ADC is reading the voltage/currents/buttons. The main loop is running and updating the LCD.

    The new current sense circuits works well enough and save a lot of board space and parts. The battery input in V2.0 was getting a biased current from the differential amplifiers to 1.4V. That was a pain as it was hard to tell if a battery was connected. Now the inputs are below 50mV when no batteries are connected. There is a tiny bit of current (~5uA depending on temperature) through the BAV99 diodes at forward bias of 0.3V. These diodes are used for reverse polarity detection.

    • ☒ need to calibrate the ADC and make scaling code.
      Without that, the number are jubbish and the buttons won't work.There are no...
    Read more »

  • uC/Firmware Status

    K.C. Lee08/04/2015 at 15:02 0 comments

    Right now I have managed to compile/port part of the AVR firmware over to SiLabs EFM8UB (8051). As predicted, the code size is about double that of the AVR as 8051 code. LCD font data takes up a bit of space, but is the same size on 8051. I won't be doing any actual test until the new PCB is populated. I am hoping that there are no significant delays now that the package has finally left China.

    There are some missing pieces such as USB code and EEPROM emulation (code and FLASH space). Previously, I used V-USB on the ATMega8, whereas EFM8UB1 has hardware USB. The EEPROM emulation uses FLASH memory and provides an EEPROM/abstraction layer. I have ported that code from SiLabs application note on to the data FLASH on a project. I'll need to read up on the Keil compiler to figure a way to reserve a few blocks of FLASH in the code space in order for storing the different battery parameters. Alternative a small I2C EEPROM dongle may be plugged into the recessed 3.3V Serial/GPIO port.

    I have considered their EFM8UB2 series which has a larger program memory, but they are slightly older chips and do not have the USB charger detection support. Hopefully at some point, they'll make EFM8UB1 chips with more memory.

    The Keil compiler is a lot nicer to use than GCC/AVR as it has 8051 extensions for embedded code. It fully supports the different memory models (a lot of them for the 8051) directly without clumsy kludges like GCC/AVR.

    8051 only has a single 16-bit memory pointer, therefore it isn't too good on memory access and needs lots of register shuffling on moving/copying external memory (xdata). Complex data structures, pointers, large number of parameters passing can be very costly in this architecture.

  • I am altering the deal, pray I don't alter it any further.

    K.C. Lee07/31/2015 at 18:15 0 comments

    So looks like they have changed the PCB design including the pin out and the dimension of the LCD modules. On the other hand, these modules are cheaper, the LCD aren't scratched up. One of the backlight LED wasn't reflowed properly, that's why the LCD wasn't pushed all the way down and the latch on the right side of this picture are left opened. The PCB is thicker than what the latches are designed for. On 2 of the panels, the metal tabs are twisted 30 degrees or so while 2 of the modules just have them latches grabbing to the inner surface of the milled slots.

    The LED connection are also a bit different - they have included four 300 ohms series resistors for the 4 LED. The LED pin should now be grounded and "JP" can be used to jumper that.

    These LCD are probably "look alike" made by different vendor. That's a business risk. The good news is that the PCB is simple, so it is a matter of sourcing the LCD modules and making my own for the long term. The other thing to do is to integrate the buttons on that PCB.

    The shipping time for small packages via China Post is now back to the usual 3 weeks instead of 4 weeks.

    The pin out of the new LCD module matches a 1.8" TFT LCD module I am using for a different project.

  • Where is waldo? - PCB Status

    K.C. Lee07/28/2015 at 03:46 0 comments

    2 email updates from vendor in the last 2 days, tracking code still not even in China Post's system and ditto for Canada Post. Yes that looks like my PCB. Earliest arrival would take at least a week. So far it is not looking good at all.

    Meanwhile the inductor from a seller I haven't dealt with has been received by China Post and it out of China already. It might take a incognito slow boat scenic route. I guess I'll find out.

    The vendor claims that they used paypal for shipping and it'll take 3-4 day for the tracking to show up. Just hope this will not cost 3-4 additional days of delays.

    Paypal package tracking. Not sure where it is departing from and where it is going to. Still not in China Post nor Canada Post system.

    I did some reading seem like the Paypal package is a new service for cheap shipping for small items with tracking. It links China Postal Beijing to the postal system of other countries.

    It used to be it could make a next door trip to Hong Kong, handed it off to Canada Post and be on its flight within a couple of days. I now have a feeling that the departure scan is for my PCB leaving Southern China to make a trip up North to Beijing. The tracking is not even there on China Post nor Canada Post.

    Looking at the numbers they are quoting for 7-15 days to the US, I am not too optimistic about it showing up here and leave me some time before the deadline for the video. Of course I can be completely wrong and I would be delighted for that.

    Now tracking info is in China Post's system.
    Destination: Canada Current Status: International Mail Receiving Centre - Received

    Now Canada Post has the tracking info:

    Well not really. It only arrived at the air terminal. I guess it is not a daily flight.

    It has arrived on the West coast. Further Processing = Canada Customs

    Lot of horror stories about custom delays. :(

    Hard to tell what's going on here as now there is no longer tracking, but there is a new date on the status. Given the time frame, I can only assume that the package might have passed through the Customs on the 17th and now no longer being tracked. Individually, the tracking # returns no info, but when I entered in more than one, then it returns the date info.

    Given the 4 days time apart, I would guess it is either "out on delivery" or "arrived at local post office". All the domestic packages have tracking feature and Canada Post choose not to display it. That new change might be why the 2nd package has no tracking at all.

    I got a delivery notification card in the mail for me to pick up the package "Tomorrow after 1:30pm" The delivery notification number points to the tracking number of this PCB with no tracking info. I am assuming that it is the next work day. I am going to poll their site again later on this evening. Canada Post is shutting their website over the weekend for upgrades. So either way, the long wait for this PCB has ended. Just the little wait now.

  • We need bigger inductors!!!

    K.C. Lee07/22/2015 at 03:07 0 comments

    Ordered some 0201 0.01uF caps by mistake. 0201 is 0603 Metric, so it showed up in the 0603 search! Thankfully I pull some parts off PII motherboard like I was before.

    I have been testing out the 5V SEPIC. Previously I had luck with both the same vendors on my FPGA board. I guess I have made some bad choices on the Taiyo Yuden 1210 inductors. The chip has a switch for 500mA, thought I'll be okay with something in the 600-700mA range. I actually did a simulation with a LT part and the inductor currents were 200-300mA range.

    Thankfully I haven't ordered the PCB just yet., so I am going to redo the that section to put in a larger footprints for some last minute Chinese inductors. For the mean while I'll wound my own inductors if I have to get things moving.

    Ordered some of the replacement inductors from Aliexpress. They look to be knock off Samida CD54 series, so I made PCB footprints for them. All else fails, I'll order the legit ones from digikey.

    I swapped out the inductors with larger ones. Those are iron powder cores inductors intended as filters (because they are lossy), but that's all I have right now.

    This time the SEPIC works. It is supply 5V to two 100 ohms resistor in parallel (i.e. 100mA). The 5V SEPIC runs the relays and supplied 5V to the microcontroller's on-chip 3.3V LDO which runs the control circuits and the LCD.

    At 3V, we get about 72% efficiency. The SEPIC converter is operating as a boost converter.

    At 15V, the efficiency is around 80%. The SEPIC converter is now operating as a buck converter.

    So I guess it works!

    I have received the inductors today. The parts comes on cut tapes. It takes exactly 3 weeks with the "Free" small packet non-tracking shipping option just like the other places I order from.

    Here is the same circuit on a home made PCB.

    With a proper PCB layout, the output regulation has improved. This was tested with a 50 ohms load, i.e. 100mA. The efficiency is about 80% between 5V and 15V. At 3V, the design lower limit, it is a bit lower at about 70%.

    In version 2.0, I used a LDO fro powering the control circuits. The SEPIC converter for the charging circuits was used to derive the gate drivers. That proves to be problematic in the case when the main power is off, but a battery is connected. The inputs to the gate drivers are not defined and can cause the MOSFET to turn on shorting out the battery. The 2.1 design runs the control circuit and gate driver are powered from the same SEPIC supply.

    The switching node in the SEPIC converter sees a voltage peak that is the sum of Vin and Vout. (Source here)

    The peak voltage from the switching node is rectified and a simple series regulator is used to regulate the output.

  • Dummy Load for Dummies!?

    K.C. Lee07/19/2015 at 01:58 0 comments

    In the discharge mode, the SEPIC converters acts as a buck/boost converter to drive an external load. I am going to talk about making one. You can use the good old power resistor and mount it on a panel/heatsink and call it a day. Of course, this would make a very boring project log if I ended it like that.

    We are living in very interesting times when a MOSFET is cheaper than a resistor. This is the cheapest TO-220 MOSFET I can find at digikey. A TO220 is easy to mount onto a heatsink. There is no point of getting a MOSFET for low Rds(on) or logic threshold as the MOSFET would operate in the linear region part of its drain current vs. drain-to-source voltage curve.

    I read about the idea back when I was designing the V2.0 circuit. I can no longer find the link as the web is cluttered these days. The basic circuit is a very crude shunt regulator using the threshold voltage of the MOSFET. The voltage divider R1 and R2 controls the the feedback ratio. It is very crude as the voltage is dependent on the process, temperature. It is not an issue here as the PID firmware loop would adjust the SEPIC output (within limits) via duty cycle to suit the load.

    The SEPIC topology switching elements sees the sum of input and output voltage. You want to keep the voltage to around 12V so that it would leave lots of headroom for the battery input voltage. A really low voltage on the other hand, means a higher current and you'll run against the relay contacts ratings.

    You can mount the MOSFET on old CPU cooler that you have lying around and connect the fan directly across the MOSFET load and use it to run the cooling fan. :)

View all 22 project logs

View all instructions

Enjoy this project?



MECHANICUS wrote 08/31/2015 at 05:27 point

Very cool, this could come in handy very soon!

  Are you sure? yes | no

Valent Turkovic wrote 08/17/2015 at 16:48 point

Can this battery charger be used with solar panels? Can it charge 12V lead acid batteries?

  Are you sure? yes | no

K.C. Lee wrote 08/17/2015 at 17:05 point

It should be able to charge lead acid batteries as it uses a similar CV/CC charging algorithm as Li-ion.  I haven't tested it yet.

The charger can charge from power source from 5V to 15V.  Input + output has to below 30V (components rating).  This is one draw back of SEPIC topology.  The power ratings can be extended by upgrading some of the power components.  The buck-boost nature allows the battery voltage to be higher or lower than the input and a crude form of MPPT could be implemented in the firmware.

  Are you sure? yes | no

K.C. Lee wrote 07/06/2015 at 18:13 point


  Are you sure? yes | no

Debasish Dutta wrote 07/06/2015 at 18:06 point

Congrats for your win :)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates