The Investigation and Prototype
This project will first investigate the possibilities for a DIY UPS system for all Raspberry Pi models, at least that is the goal for the design.
When this investigation is successful, I will design a PCB for it in a later Blog post.
Why do I do this?
Well, I have a pretty long history of building a number of UPS versions for my Pi projects, starting with an elaborate version for my wireless thermostat that was running on the first version of the Pi, the Model 1B and even de Model 1A, now many years ago (2015). That post is on my Blog, search for "UPS". Since then, I designed a number of other attempts to basically protect the SD card in the Pi from power outages or glitches.
My friend Bud designed two very nice UPS systems, in 2018 and 2019, using the HAT module layout, that could use 14500 and 18650 Li-Ion cells. He used a dedicated chip to handle the Pi power and charging (for the Pi Model 3 at the time), and used a micro-controller to keep things "under control". The latest version of that design worked for years for me, and at least two of them in Bud's applications, but recently the one I used developed an issue.
Here is Bud's posting of the latest design with all the details :
https://hackaday.io/project/162653-u1liupsrpi
It turned out that the IMR cell that I used for several years got bad while in the application, but the UPS also showed an issue that I wanted to investigate. During that process, I successfully managed to create some magic smoke and blew a hole in the main chip, the LTC4040. Replacing that chip has it's challenges due to the footprint, and getting just a single one would cost me too much, and I still would not know if there are other bad parts on the board.
I abandoned that resurrection project as being too costly, cumbersome and risky.
Although I do not have an immidiate need for a UPS, I kept thinking about it and the challenges. Bud designed a very nice UPS, much better than even commercially available products, but we were surprised that only very few Makers build one. It's not the lack of visibility because several projetcs we did together, he himself or myself, had a lot of success with Makers, so that could not be the reason.
Putting myself in their shoes, I realized that there are two main obstacles preventing more global use.
- First, the LTC4040. It's not widely available, and not cheap. The other challenge is the package, a 24-Lead 4mm × 5mm QFN that makes it a challenge for most Makers to solder.
- Second is the controller, a PIC16F18323. The package is OK, but the programming is not. You need to have a programmer and a socket for the chip. Bud published the Microchip MLAB information and the flow-chart, but you have to program the chip yourself.
So, while thinking about another DIY version that is sturdy, reliable and easy to build, I started to piece a few things together that will potentially eliminate some of the challenges that plague most DIY UPS systems for applications like the Pi.
There are actually three rather difficult to overcome challenges:
- There are many Pi models and they all have peculiar differences for this application, in addition to OS or firmware/ROM/EEPROM related changes at just about every new OS version. The Pi's are all different in several aspects when dealing with the powerdown and power-up processes and that makes the restart a bit of a challenge. There are a myriad of postings on the official Raspberry Pi Forum from users and Makers that struggle with this. (sadly, this constant changing of the OS landscape has forced me to avoid the Pi as much as possible, and I now only use it when I have no other solution)
- The later models, like the Model 4 and 5 consume a lot of power, especially when you use a number of USB adapters. The current requirement can quickly get up to 5A for the Pi or even higher for a loaded system.
- You need access to the GPIO connector.
- You can use it to supply power to the Pi, rather than using the standard USB power input connector.
- But you have to use the GPIO connector to tell the Pi that power has dropped in order to let it gracefully terminate running processes and start the powerdown sequence. (only the Pi Model 5 can communicate over the USB power cable connection)
- You need access the the 3V3 rail to sense the end of the powerdown to know when to turn off the power. Luckily, that voltage is available on the GPIO connector.
With the advent of newer Pi models and newer ways to protect or even circumvent the SD card, the UPS functionality is a bit less important for that part, but if you have applications that do not tolerate a sudden power loss or power glitch, you still need protection.
The UPS goals for this project
Rather than keeping the Pi alive for a very long time, the focus will be on riding out power glitches and to provide a controlled power down and restart when power returns. Most of us live in countries where the main power is very reliable and stable, so the focus is not so much on a long period with the loss of power, but a graceful termination of a running one. With this design you could potentially cover long periods of a power loss, but the battery will most likely have to be very different (al least very large) and this is not covered with this project.
The powerdown process will be under control of the Pi itself so you are free to do what's needed to cleanly terminate your processes and then execute the powerdown.
The UPS function only needs to supply power to the Pi for a few minutes. Three minutes to ride out power glitches, and an additional two minutes for the shutdown process should be enough to do what's needed, so that will leave enough remaining capacity in the cells to go through another cycle that happends before the cells are fully recharged again.
The switching from main power to the battery power should be automatic and instantenous without glitches.
To make the design simple, I'm planning to use a normal 12V DC power-brick with up to 5A for the Models 1 through 4 and a 6A to 8A version for a loaded model 4 and 5.
To avoid the issues with Boost regulators that will convert a single Li-Ion cell (between 4.2 and 3.0V) to the 5V the Pi needs, I elected to use two cells in series. That configuration only needs a simple Buck regulator to regulate the cell voltage from between say between 8 and 6V down to the 5V the Pi needs.
The charger function will be one that can handle a 2S (2 cells in Series) configuration with all the protection needed for Li-Ion cells. An active and simple balancer circuit willl be used to keep both cells happy and at the same voltage level. This is important because the cells will normally be off-duty for very long periods with only an occasional use. There will also need to be alow cell voltage protection, a high discharge temperature protection and protection for back-feeding and a short.
In the selected topology, a Buck convertor sits after a diode-OR that is fed by the main 12V and the 2S cell voltage. The Buck regulator reduces the incoming 12V tor the 8-6V from the cells to 5V for the Pi. The Pi sees no difference and is not very sensitive for the selected Buck regulator's high frequency switching noise.
The diode-OR switch will be so called active Ideal Diodes. This will ensure that the diodes will not have a significant voltage drop and nothing will get hot. Besides that, the ideal diode regulator has reverse voltage protection built-in.
The two Li-Ion cells I'm planning to use can be 14500 IMR or 18650 cells that feature a very high discharge current. I'm planning to use two Efest 14500 IMR cells that can discharge up to 9A, but will also provide the option to use 18650 cells that will have more oompf for high current applications.
In this design, I specifically avoided a micro-controller and used a discrete version around two timers.
With the above building blocks, we can provide the Pi with power when the mains drops away and will tell the Pi to initiate a powerdown all by itself. We will use a Watchdog to keep en eye on that process.
The shutdown process is easy to create, the real trick for all these UPS solutions is to reliably wake-up the Pi when power returns and avoid false restarts. This is where in most UPS designs a micro-controller is used, but we won't have one. A clever state-machine circuit will keep an eye on the power loss and will turn-off the Buck regulator output when the Pi is made powerless after a powerdown.
The state-machine will also allow the Pi to start normally when main power returns, and will need to avoid interruptions when power comes back too soon. Yes, you can use the features newer Pi models have, but these features are not available on the older model Pi's. Allowing the Pi to only startup when power has been removed completely before it comes back is reliable for all current models.
The Prototyping phase
When I had this rough design done, mostly in my head, I looked for modules that would allow me to build the system and test it out.
I could find everything I needed on Amazon, for reasonably low prices and with a fast delivery.
Here are the building blocks:
Li-ION 2S Charger Module:
This is actually a solar panel based charger with an MPPT feature that I won't need, but it's easily disabled. The input is the 12V from the wall-wart, and the output goes to the two cells in series, as if it was only one cell. The MPPT feature has to be disabled by turning the trimmer all the way down. The other trimmer sets the charge output voltage for the cells.
The specifications of this module are:
Model: CN-3795-2A.
Input voltage: DC 6,5-24 V.
Output current : max. 2 A
Output voltage range: adjustable from 2,4 V to 20 V.
Can be used for : 1 to 5 lithium-ion cells in series.
Charging modes: constant current / constant voltage plus MPPT.
DC-DC-efficiency: ca. 85%
Module size: 20 x 35 mm.
However, do NOT order this board!
It turns out that the version I got has two serious flaws that can cause a very serious problem as I discovered when testing it. First of all, the Schottky diode (on the left side of the inductor) is a very flimsy one. On my unit it has an 0805 size. The next even more serious issue is that the current limiter resistor has a value of 50mOhm, resulting in a 2.4A current, not the 2A listed in the specification. The diode cannot handle that. In my case, when I recharged my almost depleted 2S set, the diode blew and took the MOSFET with it, supplying an unregulated almost 9V to the cells. This can result in a catastrophic failure.
Only then did I search for another module, and after some time searching, found the one below. As you can see, it has a much beefier SS54 diode (50V 5A) (just North of the inductor) and a current limiter resistor with a much larger size (3528?) (to the right of the inductor) with a marking of R120, a 120mOhm value, resulting in a 1A current. Still a little too high for my 1C for the 650mAh 14500 cells, but at least the board is capable of handling it.
It also has much better input and output capacitors, a combination of a 47uF/63V electrolyte with a parallel ceramic capacitor. Also note that the inductor has a 47uH value much more in line with the current, while the other board has a 15uH value.
The result of this failure event is that I'm adding safety features to the circuit that will avoid this from happening again. I will add a temperature cut-out because I found that the 14500 cells got too hot to my liking when I used a contineous 4A discharge current with my DL. Yes, this is unrealistic compared to a Pi Model 1-3, but consider it worse-case. Finally a fuse and a circuit to protect the cells from an under-voltage discharge.
When you order this board, make sure you get it with the MPPT setting of 12V. (it comes in 9V, 12V and 18V versions, and I got the 18V one that I needed to modify (change R15 to 12K to disable it) The 12V version has a max current of 1A.
Look for this one on Amazon:
Solar Power Regulator, 1A 12V MPPT Solar Panel Controller Li-ion LiFePO4 Lithium Battery Charger Module, Solar Power Controller Module
There are instructions to modify it.
This unit is behaving very well in the tests that I'm running, in combination with the 2S balancer below.
The 2S Balancer Circuit:
The output from the Balancer Circuit goes to the plus of the top cell, the middle to the connection between both cells, and to the bottom of the second cell. That's it. It simply balances the voltage of both cells to within 30mV and uses a 10mA charge to reduce a higher voltage cell.
Because the controller chip is so tiny and without leads you can probe, I already decided to create a simple discrete version that does the same and is more DIY friendly.
The Buck Convertor:
This regulator will be used to reduce the cell voltage down to the 5V the Pi needs.
I have number of this little boards, several that use the LM2598S. It has an EN pin (pin5) that can be easily lifted from the PCB so we can switch it off (albeit with some special considerations)
The LM2598S even has a softstart/EN input. The EN signal input will be used to switch off the 5V supply to the Pi when the Pi has been through the Powerdown process, so it will make the Pi truly powerless. This is an important pre-requisite for the clean restart of all the Pi models when power returns.
The above one is the one I will use during the prototyping phase, but not in the final design. Please keep that in mind. If you need to buy one, get one of these until I can give you a better alternative.
There are also many other Buck regulator boards that use the XL6009E1 chip.
However, the XL6009 E1 is a Buck and Buck-Boost regulator, and that poses issues, including some serious ones for this circuit. The EN input is active high and that needs to be taken into consideration.
Don't use these regulator modules for this design!
Here is one that uses the XL4015, but this chip has no EN pin and therefore cannot be used in this configuration at all.
The typical key specifications for these regulators are:
Input voltage: 4-38VDC
Output voltage: 1,25-36 VDC adjustable
Output current: 0-5A (but stay below 3 to keep the heat down).
Depending on the Pi Model, we will have to select a higher power circuit with at least 5A up to 8A for the PCB design, we'll get to that later.
The Ideal Diode Switch
This circuit uses N-Fet's (very low RDS-on) and the LM74700 controller. It is ground based (many other boards are not and that gives a problem) The LM74700 has an EN (enable pin) that I could bring out for this board, so the Pi can switch-off the battery supply when it has reached the powerdown status. To use an N-FET in this circuit the LM747001 has a built-in charge pump. It also has reverse voltage protection built-in.
Specifications:
Input voltage: 5-30V (another spec says 0-50V; that's not correct)
Current: up to 10A
These Ideal Diode boards will need a minimum input voltage to let the LM74700 function, typically 4V is OK. We'll find that out when we're testing.
On the two modules that I got because they claim support for 10A, they use MOSFETS that are an absolute overkill, and have a very large package to boot. The ised MOSFET is a HYGO15N10NS1A that featurs 100V and a whopping 360A. Rest assured, I will use more common smaller ones in the PCB design.
The create the diode OR circuit, one of the inputs is connected to main 12V, and the other to the cell voltage. The outputs from both boards are then connected together and go to the Buck voltage regulator that will create the Pi 5.1V power input.
The Li-Ion High Current Discharge Cells
I used EFEST IMR 14500 650mAh cells before and still have two that have now lost their maximum capacity, but they are still usefull for testing purposes. They can provide up to a whopping 9.75A discharge. I ordered two fresh ones for this project.
The newer Vapce IMR cells are 1250mAh and have a maximum contineous discharge capability of 3A.
With power requirements from 5A upwards we cannot use the 2S configuration for the Vapce cells, but we'll address that later.
I also ordered two new 18650 cells with a high quality. I already have two that I purchased several years ago but are fakes. They list 8800 mAh but I measure only just 1132 mAh on one and the other one a mere 676 mAh. They seemed to come from a seemingly reputable German company M2 Tec, but they delivered rubbish to me. Buyer beware! Not only can they be fake in terms of capacity, but worse they can have manufacturing defects that could cause catastrophic failures.
WARNING
Use only reliable suppliers and well known cell manufacturers.
Dual Battery Holders
I have ordered dual cell battery holders for both 18650 and 14500 cells with smd soldering lugs.
The Powerdown State-Machine Circuit
This is the beating hart of the UPS and is a circuit made from discrete parts that will turn off the Buck regulator after the Pi has powered down. This will provide a clean power-up when the main voltage returns. The State-Machine also has to take care of situations where the power returns while the Pi is still in the shutdown period. This is a key requirement for the clean startup procedure for all Pi models. There is also a watchdog to cut-in when the Pi is not reacting soon enough and there is protection when the cell voltage is too low.
The high current Buck regulator
I ordered this module that is specified for 300W at 9A with an input voltage of 5-40V while the output could be adjusted from 1.2 to 30V. The lowest input voltage of 5V is only 1V above the voltage when the cells get switched off, so that is a test I need to do. It should be sufficient for the Pi Model 5, so I tought...
Because I had to wait for some critical parts, I captured the complete design in KiCad, and used my Google AI friend in a browser to help out when I had questions. I typically do my research on an iPad and when done, transfer the info to my Linux laptop where I do the heavy lifting. I had to go back and forth to share the pdf versions of the KiCad schematics for the agent to use, but now that the conceptual design is mostly done, I can continue on my laptop.
Here are the various schematics of the complete conceptual(!) design. Keep in mind that we will most likely run into Mr. Murphy and that things will change. I will keep the diagrams up-to-date while I'm progressing, so keep en eye out for changes.
I asked the Google AI agent to create a summary of the conceptual Design (that I later modified a bit):
๐ฏ Project Master Documentation: 2S Li-ion/IMR DIY-UPS
Target Platform: Raspberry Pi all models (1, 2, 3, 4, and 5) (High-Current Deliverability)
Design Philosophy: Fully Surface-Mount (SMD) custom PCB using globally obtainable, hand-solderable footprints with external leads (SOIC-8, SOP-8, SOT-23, SSOP-10, PDFN56). Try to avoid difficult leadless QFN/DFN packages when possible. (sadly no longer the case)
1. System Specifications & Topology
๐ Battery & Input Profiles
- Cell Configuration: 2S (2 Series) High-Capacity 14500 Efest IMR Lithium-Ion Cells, hi capacity 18500 cells.
- Voltage Profile: Max float voltage is capped via trimmer between 7.8V and 8.4V total (3.9V to 4.2V per cell) to optimize health and lifespan.
- Hardware Under-Voltage Lockout (UVLO): Set sharply to a 5.6V cutoff voltage under load.
- Mains Input: 12V DC Wall Adapter via a heavy-duty screw terminal.
๐ Buck Power Output Profile
The design uses selectable output current configurations by using different parts to differentiate between the low power Pi models, and the heavy current requirements of the Raspberry Pi 5.
2. Comprehensive Input Power & Reverse Protection Stage
To
safe-keep the system against reversed polarity wall adapters,
protection is split across its individual branches to eliminate
unnecessary power losses:
๐ก️ Input Defense Component Matrix
- Overarching Transient Suppressor: An
SMBJ13CA (or SMAJ13CA) bidirectional TVS diode sits immediately behind
the input barrel jack pins. It clips microsecond inductive hot-plugging
spikes up to 35V before they can punch through the gate oxide layers of the on board's silicon. - Downstream Power Protection: Handled natively by the
LM74700-Q1 Ideal Diode Controllers on the main power lines. They block negative voltages up to -65V, isolating the buck rails effortlessly. - Localized Charger Protection: The
CN3795 charger sits before the ideal diodes and cannot tolerate negative voltages. An AO3401A P-Channel MOSFET (SOT-23) is placed right on its 12V branch line.- An
R_G = 100 kฮฉ pull-down resistor closes the channel under normal operation. - A
10V Zener Diode (ZD_G) sits in parallel with R_G to protect the delicate ±12V gate ceiling of the AO3401A from input transient voltage ringing. - The input of the charges will only be enabled when the cells are present to prevent backflow issues.
3. Battery Charger Circuit (Consonance CN3795)
An asynchronous buck topology running at 310 kHz in an accessible SSOP-10 footprint.
⚙️ Component Configurations & Overrides
- MPPT Disable Override: To prevent the solar tracker circuit from choking a fixed 12V mains supply, the
VMPPTpin (Pin 3) is held permanently above its 1.205V threshold using a 10 kฮฉ (Top) / 2.2 kฮฉ (Bottom) divider tied to VCC. This locks the pin safely at ~2.16V. - Constant Current (CC) Shunt: A 1206-size 60 mฮฉ (0.5W) power resistor (
R_CS) for 18500 cells or a 100 mฮฉ version is placed across the CSP and BAT pins to lock the constant charging rate to a steady 2.0A or 1.2A. - Adjustable Termination Voltage Divider (7.4V – 8.7V): Wired to the
FB pin (Pin 7) against its internal 1.205V reference loop:R_FB1 (Top Resistor): 150 kฮฉR_FB2 (Bottom Safety Stop): 24 kฮฉ (— Sets a hard maximum charging cap at 8.7V even if the trimmer is dialed to zero.VR_FB (Tuning Potentiometer): a 5 kฮฉ Single-turn Trimmer in series below R_FB2. Dialing it to max drops the charging limit cleanly to 7.4V.
๐ External Charging Power Loop
- Switching MOSFET:
A3401A (30V, 4A P-Channel in an easy SOT-23 package). At 2A charging, it generates negligible heat. - Power Inductor:
22 ยตH Sumida CDRH127LDNP-220MC (12x12mm
industrial footprint with large side-weld pads). Shifting up to 22 ยตH
ensures low current ripple at the 310 kHz switching speed. - Catch Diode:
SS34 or SS54 (3A/5A, 40V Schottky Diode in an accessible SMA/SMB flat-cap package).
4. Integrated Buck Regulator (TI TPS56C250 : 4.5V to 18V, 12A Synchronous Buck Converter)
A synchronous step-down regulator integrated directly onto the motherboard PCB layout running at 500 kHz unfortunately, is only available in a tiny VQFN-20-EP(3x3) package. Layout features a 1.5mm unmasked via in its center belly pad for backside solder iron manual back-filling to the ground plane.
5. Active "Virtual Ground" Shunt 2S Balancer
Replaces
the difficult-to-solder leadless WSON-8 BQ29200 with an indestructible,
fully hand-solderable active shunt balancer built from generic
footprints.
- The Controller: An TLV271 (SOIC-8) single rail-to-rail op-amp. It compares the real battery midpoint (
MID) against an ideal voltage reference created by two 100 kฮฉ (Strictly 0.1% tolerance) resistors (R1, R2). - The Switch Drivers:
AO3401A (P-Channel) and AO3400 (N-Channel) in standard SOT-23 housings. - The Shunt Bleed Elements: 47 or 20 ฮฉ (1W 1206 power resistors) (
Rb1, Rb2). When a cell drifts, the op-amp biases the corresponding MOSFET to bleed out an active ~90 or 210 mA from the higher cell. - Stabilizers: 0.1 ยตF ceramic capacitors are
placed on the reference divider and op-amp feedback loops to prevent
transient gate chatter or oscillation at the cell boundary.
- The balancer will only be active during the charging of the cells.
6. Power Management & Control Logic (The dual 555 Core)
๐บ️ Schematic
The timing, protection, and automatic shutdown sequencers operate as a discrete hardware state machine driven off a dedicated LM2931-5.0 (SOIC-8) low-dropout logic rail decoupled with a 10ยตF high-ESR aluminum electrolytic output capacitor (C8). The low-dropout is important because the cell voltage can become as low as 6V during the discharge process.
๐ง Audited Logic Node Configurations
๐ก️ Hardware Under-Voltage Lockout (TL431)
- Performance: Trips sharply at 5.68V under load to protect the cells from deep depletion, and locks the power path off until the cells recover all the way to a 7.50V rebound threshold before releasing power to the Pi again.
๐ Power Loss Glitch Filter (U1 CMOS TLC555xD)
- Passives:
R11 = 1.2 Mฮฉ and C2 = 100 ยตF (Electrolytic). - Action: Provides a 3-minute grace period following
a mains power cut to let the Pi ride out brief line cuts. If power is
not restored, its output drops Low to start the 2 min Watrchdog and signal a safe operating system
shutdown to the Pi via GPIO.
๐ Shutdown Watchdog (U2 CMOS TLC555xD)
- Passives:
R12 = 1.8 Mฮฉ and C3 = 100 ยตF (Electrolytic). - Action: Provides a 2-minute shutdown watchdog for the Pi to finish the shutdown before turning of the Buck regulator and eliminate discharge battery drain.
๐ Sensing the Pi shutdown
- The Architecture: Resolves zombie power states immediately. A TL431 is used to switch when the 3V3 from the Pi rail is gone, signaling a proper shutdown procedure.
- When the drop of the 3V3 ail is detected, the circuit forced an instant watchdog timeout and killing main system power early to preserve the cell charge.
Here are the schematic diagrams that follow the above conceptual design in full detail. They have been updated since the first upload, and I will continue to do so to keep everything current and up-to-date.
This is the Battery Charger circuit. Note that it will have to make changes after I had a catastrophic failure of the first module I was using.
This is the 2S Cell Balancer in the discrete version. This is a different version, and based on a design that my buddy Bud did a number of years ago. It has some nifty features.
This is the hart of the UPS, the dual 555 Controller section.
A conceptual design with two timers to create the 3 min grace period after a loss of the main voltage has been detected to signal the Pi to start the shutdown process, and then start a watchdog to monitor that process, and cut it off after 2 min, seems easy to do, but as usual, the devil is in the details.
Part of the complication is that the output of 555 timers act different from what you would expect when you factor in that they need to start behaving right after a power-up, besides the fact that the output levels are inverted to what the Buck needs, in order to shut the power off. Then there is the required protection for premature power returns when the Pi is in the middle of the shutdown period. It has to completely finish that and become powerless before the power-up can be reliably restarted when the mains returns. However, if it hangs for whatever reason, the power has to be cut regardless to protect the cells capacity and force the power off state to do a clean power-up again.
To preserve cell energy, there is a little circuit that monitors the level of the Pi 3V3 rail, which will decay after it finishes a shutdown. I use that "feature" to terminate the 2 min WD window.
By the time you add that all up, you get to the circuit above. Believe me, it went through many iterations, including LTspice simulation and double-checking. My buffy Bud was instrumental to get several of the kinks out of the circuit.
Below is the Ideal Diode OR circuit, that mixes the Cell voltage with the 12V main supply:
To protect for high temperatures of the 14500 cells during the discharge, I'm thinking of using a N.C. 65 degrees C temperature switch to cut the power from the ideal diode. The tab can be positioned in-between the two cells.
Here is the low-voltage protection for the cells, another nifty application of a TL431 that my buddy Bud designed. It's simple and does not use many parts.
And finally the on-board 5.1V Buck regulator for currents up to 8A that will power all the Pi models 1 through 5. There are optional component changes that can be made to lower the current requirements for the less power-hungry Pi Models. Unfortunately, Buck regulators that can provice 8A or more at 5V1 with an input voltage down to 6V are very rare and only available in a tiny VQFN-20-EP (3x3mm) package. I will do my utmost to make the soldering process for this chip as painless as possible.
Conceptual design done (for now)
Now that I have that conceptual design under my belt, I was able to order most of the critical parts. While waiting for them, I can continue with the modules.
I have already used the charger a few times with different cells, and tested the cell balancer. This was with the older Efest cells that were not ain a good shape, so discharge testing was minimal. I now have received two fresh Efest IMR 14500 cells, and fully charged them. Now I can run some tests with the ideal diode and the 5A discharge, using my DL in the Battery Test mode.
Testing the cell discharge curves.
These are made after the cells got fully charged by the CN3795 charger circuit. After that, they rested for several hours up to more than a day.
The discharge is done by connecting the Dynamic Load leads right on the battery cells themselves while also using the sense leads.
Later I will do the same with the Ideal Diode and the Buck regulator added, and connect the load to the output of the Buck regulator to account for all losses (mostly the Buck circuit).
14500 cells for the 5A version
Here is the Vapse F12 14500 cells with a 4A continous load. These are brand-new cells that have only been discharged and charged once. They got pretty hot at the end of the discharge, and they will need a temperature safety precaution that will terminate the load.
Here is a 5A discharge run for the Efest IMR 14500. This cell can deliver 9.75A peak. After the discharge ended, I measured 57C on these cells, so again they need to have a temperature cut-out feature, that I was planning to add anyway. These cells are new, but have been through this treatment a few times now.
18650 cells for the 10A version.
Here is a discharge curve for the Vapcel K30 18650 with a load of 8A. These cells only have been charged once. These cells only got warm, but no alarming temperature development.
My Dynamic Load does not allow a larger current than 8A, I need to change the firmware to let it go up to 10A. The 8A maximum in the Discharge Mode was a safety precaution for the unaware.
Just for kicks, to show you what rubbish is being manufactured and sold if you're not careful. Here is the attempt to get any capacity out of two cells from M2 Tec Germany with cells they claim to be 8800mAh. I had to go as low as 1A to get any meaningful results. Have a look before they are dumped in the battery graveyard.
(BTW, the hash in the beginning is a bug in my graphing code, added after completion.)
Broken charger board.
While testing the discharging of various 2S cells, I noticed an issue when I wanted to recharge the half-depleted cells again using the charger module. The charger would not charge them with the high current, but only use the trickle current of around 30mA. At first I was suspecting the CN3795 chip archtecture, and was led astray by an AI agent, that claimed that the CN3795 had a known issue with getting stuck in the trickle charge mode.
The explanation was that the window comparator for the cell voltage was stuck because my cells recovered to 7.4V after a complete depletion test down to 6V. No matter what I tried, I could not get it fixed. While investigating this, I used my DSO to look at the waveforms (PWM) from the chip, the MOSFET, the diode and the output and in principle, they all looked good and clean. That was reassuring.
I started to suspect an el cheapo XR5 capacitor for C4 that is in the COM path, so I replaced it with a X7R version, to no avail. The DSO showed that the MOSFET worked, the chip worked, the diode worked and the coil worked. I could still set the output voltage with no load, but didn't get any current out of the module.
Upon very, very close inspection with a very good magnifying lens, I noticed a very tiny brown pin-point on the sense resistor. Aha, sure sign of trouble. The value was supposed to be 0.12Ohm. It turned out it had changed personality and was now a 4.7Ohm imposter. Duh. Replacing it with a 0.1 Ohm 1206 resistor fixed it. On my own PCB I will increase the size to a 2512. The root cause is not clear to me, it may have happened when I inserted or removed cells from the cell holder, which I'm doing a lot. This may also have been causing the demise of the other charger, that blew the diode and a MOSFET and maybe even the chip itself.
First test with the complete chain of modules
So, for the next step, I connected the output of the charger and the 2S cells to one of the Ideal Diodes and connected the joint outputs to a high current Buck regulator, the one I was going to use externally for the Pi Model 5. The output was first set to 5.1V and the current limiting way up. The output of the Buck convertor was then connected to my Dynamic Load that was going to act as a Pi. Channel 1 of my Lab Supply was powering the charger with 12V at 1A. Channel 2 was also set to 12V, but with the maximum 3A and that supplied the 12V that went to the other Ideal Diode, acting as the mains connected wall-wart. So by simply turning the Lap Supply channels on or off I could simulate the drop of the main voltage.
I started with channel 2 off and channel 1 for the charger still on. For the first test I simply shut channel 1 off too, so the cells now supplied the voltage to the Buck regulator. While monitoring the cell voltage, I started applying the Constant Current of the DL and increased it all the way first to 3A, then 4A and finally 5A. It all worked, but the Buck regulator suddenly started smelling and got extremely hot, so I terminated the measurement.
After the heatsinks were cool enough, I toned down the current to 3A and tested the switch-over of the mains, by first applying the main 12V and then turning both channels off simutation a loss of the mains. I looked at the output of the Buck with a DSO and saw no glitches or anything else, as was to be expected. So in priciple it all seemed to work, expect for the Buck temperature issue.
Time to regroup.
The Buck was specified for 9A and 300W, with a minimum input voltage of 5V, that's why I bought it.
What actually happens is that when the Buck regulator gets an input voltage below say 7V, the MOSFET is fully turned on to supply the 5.1V output and will get extremely hot. Instead of a PWM signal for the internal MOSFET, it is fully turned on and has to pass the full current.
There is a real noticeable jump in the temperature when the cell voltage drops below a certain value and the PWM stops. This makes this specific Buck convertor design unfit for my application, and I am sending the unit back because the specifications are not correct and it is totaly unfit for this application.
The remedy is to use a different architecture for the Buck, one that is synchroneous and has a 4 switch Buck-Boost convertor system that can raise the input voltage when it is too low, and then regulate it down. The most common versions I found are based on the LTC3780 and I got one of these:
At least this vendor is more precise (honest) about the specifications.
Features:
Input voltage: DC 5-32V; (the LTC specsheet says 4V)
Output voltage: DC 1V-30V infinitely adjustable; the standard is a 12 V supply
Output current: 10A (max), long lasting within 8A
Output power: 80W, peak value 130W, more than 80W, strengthen heat dissipation
Output wave: 50mV (12V rotation on 12V, 5A measured)
Short circuit protection:
Reverse connection protection: no
Output prevents reverse polarity protection: no
Operating temperature range: -45 ~ +85 °C.
This is a simple version, and I have no hopes this will work for the pi Model 5. It does not have enough Wattage but I can use it all the way to the Pi Model 4 I hope. The design is interesting enough for me to study it.
There are other versions using the same LTC chip that have a large and thick heatsink on the bottom, but for my testing, this version will do.
The good news is that in principle, all the modules work together. No I need to add pieces from the controller section to add the automation to it.
I will soon show some more of the test results here.
Stay tuned, I'm only beginning...