Power Supply A Guide to 12V PSU

CC Ricers

Shrink Ray Wielder
Bronze Supporter
Nov 1, 2015
2,234
2,557
Wonder if you can help me with this even though it's not technically 12V but I have some trouble understanding USB-C PD for providing power to devices via USB bus.

I want to use Li-Ion batteries as a portable power source, and in the past it's worked with Intel NUCs and other small computers. Those used a barrel DC connector. With USB-C and PD protocol it's more complicated as it needs to do a "handshake" to settle on an appropriate voltage otherwise the device won't charge or power on. I bought this exact USB PD trigger board and connected the ends of my battery pack (with balance board) to the board.

Tried connecting the battery to both sides of the trigger, and the laptop motherboard I'm trying to use doesn't power on. The trigger board does seem to work though, with the LEDs indicating what voltage it can support (my pack outputs 15.5V at full charge so 5, 9, 12, and 15 V are all acceptable)

With another USB-C wall adapter the motherboard does power on. So I'm not sure what I'm missing here to make my DIY battery pack USB PD compatible.
Hmmm. I did a tad of searching to see if there exists a USB-HID battery monitor of some kind. I didn't find anything directly relevant, but this might be of interest to you?


This is way beyond what I'm able to understand, but it seems to provide documentation for USB-based battery charging and monitoring for PC applications using cheap and easily available microcontrollers? Making custom hardware (and firmware for it) like this sounds rather daunting, but possibly doable? And if using a separate charge circuit, not that I know anything at all about programming, but it sounds kinda-sorta doable to make a simple microcontroller-based voltage measurement device that reports this to Windows as a HID-compatible battery readout?

Edit: here's someone using an Arduino to "smartify" their dumb UPS, doing something similar.

I might do something similar to that, but instead of using the microcontroller to send data to the PC to monitor via PC software, I'll just use an onboard hardware to indicate the charge level. Basically making a simple voltmeter with a mini OLED display that I'm familiar with. It can read voltage from one of the analog pins and it should do fine, just as long as I use a proper voltage divider and diode to not accidentally fry the microcontroller.
 

msystems

King of Cable Management
Apr 28, 2017
804
1,405
Just a guess, but I thought USB dummy triggers are for when you have USB-PD compliant source and you want to turn it into "dumb power" at a fixed voltage where the dummy trigger acts as the Sink.

But I think what you are trying to do the opposite... connect "dumb power" to a device that expects a USB-PD compliant handshake. Is the fixed voltage dummy trigger board capable of doing that handshake to become the voltage Source instead of the Sink?

This was a 100w bi-directional Usb-pd module I found a while back. It's a little larger than a dummy trigger and all the charging protocols are listed on the page. Maybe you need something like this which has the full auto-negotiation capability?

Edit: Or another idea, here's a pre-assembled bank which could be easily disassembled and batteries re-arranged in whatever kind of spaghetti configuration best fits the enclosure profile
 
Last edited:

CC Ricers

Shrink Ray Wielder
Bronze Supporter
Nov 1, 2015
2,234
2,557
Just a guess, but I thought USB dummy triggers are for when you have USB-PD compliant source and you want to turn it into "dumb power" at a fixed voltage where the dummy trigger acts as the Sink.

But I think what you are trying to do the opposite... connect "dumb power" to a device that expects a USB-PD compliant handshake. Is the fixed voltage dummy trigger board capable of doing that handshake to become the voltage Source instead of the Sink?

This was a 100w bi-directional Usb-pd module I found a while back. It's a little larger than a dummy trigger and all the charging protocols are listed on the page. Maybe you need something like this which has the full auto-negotiation capability?

Edit: Or another idea, here's a pre-assembled bank which could be easily disassembled and batteries re-arranged in whatever kind of spaghetti configuration best fits the enclosure profile
Ah, looks like you're right about that dummy trigger. So it would only work for the case where I might want to charge those batteries using the USB wall adapter. I would instead need a PD charge module, not a trigger module.

The PD module you linked to is not too big and will still work for my portable project. Do you happen to know what the L1, L2, etc. terminals are for, that are to the side of the battery + and - terminals? I see that for anything else besides 2S you will have to do some resistor modifications.

I also found another module, the SW2303 which is not bi-directional but with it, a voltage as low as 12V can be boosted to 20V, to provide the full 100W (though I will only require about half). The barrel connector is for the charge source.

I won't need to get a full power bank, though, since I already have my own batteries to use.

Edit: Found an even smaller charge board that can provide 60W total. Maybe I'll try both.
 
Last edited:

msystems

King of Cable Management
Apr 28, 2017
804
1,405
Yeah, the bi directionality feature on the usb-pd port itself is pointless because you are just charging the mainboard. I think the board I found is designed for a power bank that doesn't need to simultaneously charge and discharge.

So the pd charger you found looks brilliant.
 
Last edited:

Thehack

Spatial Philosopher
Original poster
Creator
Mar 6, 2016
2,811
3,669
J-hackcompany.com
Batteries -> BMS ->USB-C voltage regulator module> trigger board-> device is what you’re wanting to accomplish.

a simpler implementation is you just take the output from the BMS or battery and just use a regulator module.

the BMS is supposed to keep the cells balance so they will use a separate charging circuit that takes a higher power input.

the battery can be hooked up directly to your voltage regulator if you intend to only discharge or charge separately.

if you want to combine charge and discharge you need a pretty complex charge module that has pass through or load balancing.
 

CC Ricers

Shrink Ray Wielder
Bronze Supporter
Nov 1, 2015
2,234
2,557
Batteries -> BMS ->USB-C voltage regulator module> trigger board-> device is what you’re wanting to accomplish.

a simpler implementation is you just take the output from the BMS or battery and just use a regulator module.

the BMS is supposed to keep the cells balance so they will use a separate charging circuit that takes a higher power input.

the battery can be hooked up directly to your voltage regulator if you intend to only discharge or charge separately.

if you want to combine charge and discharge you need a pretty complex charge module that has pass through or load balancing.

The device I'm powering has its own buck-boost charger built in that accepts a wide input of voltage. Can the voltage regulator be removed from the chain? This is what I had thought, but with Batteries -> BMS -> trigger board it wouldn't power on or show signs that it is on standby power.

I do intend to make the batteries recharge in a way that they can be used like a uninterrupted power supply. Simply put, the device should be able to switch between wall power and battery power depending on whether a power brick is connected.
 

msystems

King of Cable Management
Apr 28, 2017
804
1,405
@CC Ricers I also found out that there's a wierd bug that can happen if the Mainboard is left unpowered for too long. Just in case that's the issue.

Edit- ok I'm sure its not this. But maybe useful to you

 

Thehack

Spatial Philosopher
Original poster
Creator
Mar 6, 2016
2,811
3,669
J-hackcompany.com
The device I'm powering has its own buck-boost charger built in that accepts a wide input of voltage. Can the voltage regulator be removed from the chain? This is what I had thought, but with Batteries -> BMS -> trigger board it wouldn't power on or show signs that it is on standby power.

I do intend to make the batteries recharge in a way that they can be used like a uninterrupted power supply. Simply put, the device should be able to switch between wall power and battery power depending on whether a power brick is connected.

you will need a load balancer then.

if the voltage from the batteries is close to the nominal voltage of your load device (motherboard, pc, etc) yes you can hook it up directly.

the load balance or some kind of load source switching is required for a UPS. It needs to switch source fast enough while also diverting some power to keep the battery pack at a certain pack voltage.

a trigger board is a power negotiator. It needs to be a usb-c spec on both sides. The trigger board sets it up as a receiver and requests a certain voltage, and current ratings. If the sender can achieve the requested specs then it will send. If not, it will not. Trigger board only applicable if you have a usb power delivery spec on the battery side. This module should have clearly defined specs, like “20V 3A PD.”

if you have a Power Delivery regulator, it should be clear when you bought it. It’ll have an input spec and output spec. powered devices are getting pretty smart nowadays.

this should cover what you’re working and clear up the power setup. You should link or post the exact BMS you’re using. Most BMS are not set up to provide output. Commercial power banks can do it but they’re very tightly integrated and not usually available for resale.




——

concerning the RTC bug, I can confirm this is real. I also get it on my lenovo laptop. It is weird, pc won’t boot even with power. Lenovo does have a full reset button that worked but require multiple attempts. It’s trial and error and I don’t know what exactly works to reset the rtc. Not sure if it is applicable to your build or not.
 
Last edited:
  • Like
Reactions: NinoPecorino

Valantar

Shrink Ray Wielder
Jan 20, 2018
2,201
2,225
This is what I had thought, but with Batteries -> BMS -> trigger board it wouldn't power on or show signs that it is on standby power.
If I'm reading you correctly, you're misunderstanding what a PD trigger board does. A PD trigger board is not a power source, but a drain. It does not regulate and distribute voltages, it simply has some very basic circuitry to perform the necessary handshake with a PD output controller (charger or other source) to identify itself and tell it which voltage to output. It's a thing that when connected to a PD charger says "Hey how you doing? I'm John. Can I have 20V please? Thanks." And then does nothing except pass power through until either a new connection cycle or a voltage change is requested (some trigger boards have voltage selector switches). On a PD trigger board, the USB-C is an input only, and the DC connectors are an output only.
 

CC Ricers

Shrink Ray Wielder
Bronze Supporter
Nov 1, 2015
2,234
2,557
If I'm reading you correctly, you're misunderstanding what a PD trigger board does. A PD trigger board is not a power source, but a drain. It does not regulate and distribute voltages, it simply has some very basic circuitry to perform the necessary handshake with a PD output controller (charger or other source) to identify itself and tell it which voltage to output. It's a thing that when connected to a PD charger says "Hey how you doing? I'm John. Can I have 20V please? Thanks." And then does nothing except pass power through until either a new connection cycle or a voltage change is requested (some trigger boards have voltage selector switches). On a PD trigger board, the USB-C is an input only, and the DC connectors are an output only.

I think the confusion started when I mixed PD trigger with PD charger, thinking that they would be interchangeable. It started from watching this video tutorial on making an uninterruptable power delivery source with some 18650 cells like I have, and a USB-C converter which did the trick. As previously mentioned, I already did buy a bare PCB that provides up to 60W output with USB-C so I'll see how that goes.

Curiously, in that tutorial I did not notice any use of Schottky or other diodes for his UPS in power switching to handle low voltage drops. It is just a simple daisy chain soldering two wires to each of the barrel terminals.
 
  • Like
Reactions: Valantar

Thehack

Spatial Philosopher
Original poster
Creator
Mar 6, 2016
2,811
3,669
J-hackcompany.com
Holy crap that is some bad engineering.

1. The USB-C converter linked needs to be a socket, not a plug for the power input. A plug is for "output" and a socket is for input.

2. You need a load balance/load switch device. You can't just put in two different voltages from two different sources all willy nilly. The BMS output is a full series voltage from the battery. The charger is a different voltage which means you'll get reverse flow when you don't want to.

3. Based on the video setup, you don't need a trigger board. If your mainboard uses USB-C charging, just plug it into the white adapter thing. If it uses a regular barrel charging, just plug it straight in instead of using the white adapter. There's no difference.

4. If you always have a load device, like a NUC, the ac adapter won't kick into CC/CV mode for battery charging.

5. A Schotty is not what you want. An actual power management set up is what you want.

----
You need a load balance/load switch.

The load balancer/switcher is should be designed to do the following things:

1. Divert high loads to the primary power input (DC from power adapter)
2. Output a steady state long term battery voltage to the BMS. So voltage equivalent to about 80% battery capacity.
3. When AC mains turn off, switches to battery power while ensuring hold-up time.
4. When AC mains turn on, switch to primary power, and output a CC/CV charge cycle for the battery bank.

That looks like a cheap BMS, which means it probably just take a look at the overall input voltage and divides evenly between the 4 cells. There is no block diagram, no user manual that describes the features. This BMS is designed for separate charge/discharge cycles.
 
Last edited:

CC Ricers

Shrink Ray Wielder
Bronze Supporter
Nov 1, 2015
2,234
2,557
@Thehack I never heard of a load balancer in the context of charging batteries, but I've just seen "switch mode" for charge boards, like the TP5100, which that converts an input voltage to 4.2V or 8.4V for Li-Ion charging. Here's one circuit using it, which I hope is a better example of a DIY UPS. (this circuit has nothing to do with USB-PD, it's just the UPS)

I have also found this power management board that is designed for 4S Li-Ion which is what I am currently using, with charge/discharge indicators, and I have a 19V brick that I can use for AC charging. I assume that this is a more complete solution. Both the input and output are sockets, though.
 

Thehack

Spatial Philosopher
Original poster
Creator
Mar 6, 2016
2,811
3,669
J-hackcompany.com
@Thehack I never heard of a load balancer in the context of charging batteries, but I've just seen "switch mode" for charge boards, like the TP5100, which that converts an input voltage to 4.2V or 8.4V for Li-Ion charging. Here's one circuit using it, which I hope is a better example of a DIY UPS. (this circuit has nothing to do with USB-PD, it's just the UPS)

I have also found this power management board that is designed for 4S Li-Ion which is what I am currently using, with charge/discharge indicators, and I have a 19V brick that I can use for AC charging. I assume that this is a more complete solution. Both the input and output are sockets, though.

this is because UPS is a different use than normal power banks.

the goal of a UPS is to maintain equipment uptime. For example, you should know that LiIon charges at a variable voltage. Starting at around 3.4V per cell up to 4.2V. Your load device wants a expects a certain voltage.

how would you both charge your batteries and power your pc?

your batteries want to be used as little as possible at around 80% SOC, what circuitry allows you to set the SOC for the back up battery?

your load device might peak more than your power supply can provide, how does the UPS configure so that your psu doesn’t get stressed and pulls from the batteries as augmentation instead?

UPS power management is quite complex. It must have good uptime and proper battery maintenance to ensure a long and safe life. Plugging in two different voltages without any regard for circuit protection is a big no-no.

will a jerry rigged kit work? Yes. But you’ll probably get some “back flow” and it would be hella unreliable long term. LiIon batteries that are stressed are fire hazards.

the power management board is definitely what I’m talking about. It is still missing proper specs so shoddy engineering. A decent power management board will give you a proper charge graph for their cc/cv implementation.

load balancer is used whenever you have more than one power source if you want to use power sources in parallel. In this case, batteries + ac adapter.

switch mode concerns that it is a switching dc regulator, as opposed to a linear dc regulator. A load switch switches on/off power sources/loads.

the wifi project is cheating. It is using a charge board as the source for both the router and the charge, with diodes to prevent backflow. the issue is that is not how you charge a battery. You should not put the load device on the same circuit as your batteries when it’s charging. That’ll mess up the cc/cv charge cycle. The charge board also doesn’t have an option for an 80% state of charge.

(I also do apologize for suggesting a load balancer, that’s a pretty advanced feature that allows you to sum battery and ac/dc power. A load switch is a simpler implementation. Might have caused more confusion than I cleared up).
 
Last edited:

Thehack

Spatial Philosopher
Original poster
Creator
Mar 6, 2016
2,811
3,669
J-hackcompany.com

That is a commercial product that may fit your needs, as long as the pc you’re powering fits the specs.

if I were to build a simple cobbled kit I would do the follow:

1. ac adapter output strong enough to both charge the batteries and run the device.

2. Ac adapter connects to charge module that I can set to 80% charge. It also has a delayed 2 seconds on.

3. Charge module connects to BMS

4. BMS connects the sch diodes and fuse, then a two source one output load switch. AC adapter also connect to load switch in parallel. Load switch logic is powered by BMS. Load switch will instantly switch from ac adapter to BMS source if there is power outage. Load switch outputs to your device.

5. Load switch has a 1s time out before switching back to ac adapter.
 

CC Ricers

Shrink Ray Wielder
Bronze Supporter
Nov 1, 2015
2,234
2,557
I used to power NUCs off battery, but that was just simple with a BMS and its variable voltage fed directly into the NUC's power jack. It worked only because I wasn't charging and discharging at the same time, and because those motherboards accepted variable voltage from 12V to 19V making things simpler. I would power off and disconnect the battery and plug it with a AC adapter for Li-ion to recharge.

What I have now is a laptop motherboard from Framework, and given what you've shown me I may have to reconsider the custom power solution, especially with the cost involved. At first I decided to refrain from using its own laptop battery, going with an alternative if it didn't meet my case constraints (it will be portable like a laptop, but different dimensions). I'm still waiting on more parts to arrive (in particular, a LCD panel) before I can come to a final conclusion with how to use available space and whether or not I will choose to use something like this. But more likely I will choose the laptop battery and re-design around that.

I've already known about single all-in-one boards that will charge, manage the battery, and boost while running low powered devices like Raspberry Pi and such. Though it doesn't seem as straightforward when you're dealing with higher power applications and higher charge voltages.

The other option might just be to use something like the SW2303 for a DIY power bank as it's simpler than a UPS and well enough for a portable device. This won't be a need for power failures, but just a portable source of power.

Still, it's been helpful to see what UPS products are there for more general purpose needs. The NUC-UPS and OPEN-UPS 2 both look like good integrated solutions for other small projects besides the laptop-based one, that would use different sized cases.
 
Last edited:

Thehack

Spatial Philosopher
Original poster
Creator
Mar 6, 2016
2,811
3,669
J-hackcompany.com
I used to power NUCs off battery, but that was just simple with a BMS and its variable voltage fed directly into the NUC's power jack. It worked only because I wasn't charging and discharging at the same time, and because those motherboards accepted variable voltage from 12V to 19V making things simpler. I would power off and disconnect the battery and plug it with a AC adapter for Li-ion to recharge.

What I have now is a laptop motherboard from Framework, and given what you've shown me I may have to reconsider the custom power solution, especially with the cost involved. At first I decided to refrain from using its own laptop battery, going with an alternative if it didn't meet my case constraints (it will be portable like a laptop, but different dimensions). I'm still waiting on more parts to arrive (in particular, a LCD panel) before I can come to a final conclusion with how to use available space and whether or not I will choose to use something like this. But more likely I will choose the laptop battery and re-design around that.

I've already known about single all-in-one boards that will charge, manage the battery, and boost while running low powered devices like Raspberry Pi and such. Though it doesn't seem as straightforward when you're dealing with higher power applications and higher charge voltages.

The other option might just be to use something like the SW2303 for a DIY power bank as it's simpler than a UPS and well enough for a portable device. This won't be a need for power failures, but just a portable source of power.

Still, it's been helpful to see what UPS products are there for more general purpose needs. The NUC-UPS and OPEN-UPS 2 both look like good integrated solutions for other small projects besides the laptop-based one, that would use different sized cases.

The laptop battery is handy is because the mainboard should already have all the circuits for using the battery like a UPS. It's $60 for 55WH. Which is a pretty good price in my opinion. And since it's an OEM design, you know it won't be shoddy engineering.

If the laptop battery was a standard 2 or 3 pin, you could just wire a separate BMS instead of the stock battery for the framework. However, based the high number of wires, I think the BMS is on the mainboard instead of on the battery.

Not sure how framework's battery management is, but I remember lenovo laptop has a feature where it can limit max battery charge. This is particularly useful since the laptop battery acts like a built in UPS.

Some commercial powerbanks also have pass-through charging and a high wattage output, so those are also safer options but still not good for long term use if used as a UPS. If there is a smart company how there, they should add a UPS mode to their battery banks.
 
Last edited:

CC Ricers

Shrink Ray Wielder
Bronze Supporter
Nov 1, 2015
2,234
2,557
The laptop battery is handy is because the mainboard should already have all the circuits for using the battery like a UPS. It's $60 for 55WH. Which is a pretty good price in my opinion. And since it's an OEM design, you know it won't be shoddy engineering.

If the laptop battery was a standard 2 or 3 pin, you could just wire a separate BMS instead of the stock battery for the framework. However, based the high number of wires, I think the BMS is on the mainboard instead of on the battery.

Not sure how framework's battery management is, but I remember lenovo laptop has a feature where it can limit max battery charge. This is particularly useful since the laptop battery acts like a built in UPS.

Some commercial powerbanks also have pass-through charging and a high wattage output, so those are also safer options but still not good for long term use if used as a UPS. If there is a smart company how there, they should add a UPS mode to their battery banks.
Because of its 10-pin connector I didn't think trying to make a custom battery that would work with that connector would be worth the trouble, and thus have been trying the USB-PD input.

If a powerbank has pass-through charging that could work for me. There are also some boards for DIY powerbanks, since I already have a couple batteries laying around, but can't be sure on their long-term reliability.

The current BIOS for Framework does have a setting to let you change the battery charge limit.

Opting to just go with the laptop battery, the only reason I held back is because my enclosure design would have a small footprint, like a Steam Deck or 60% keyboard, about as half as the laptop's footprint. Which means the battery has to go somewhere else, some place right above the motherboard. I have concerns about doing this too because of the heat output from CPU, RAM and VRMs. In this layout, the battery won't be touching the board, but have an air gap of a few millimeters separating it.
 

Valantar

Shrink Ray Wielder
Jan 20, 2018
2,201
2,225
If the laptop battery was a standard 2 or 3 pin, you could just wire a separate BMS instead of the stock battery for the framework. However, based the high number of wires, I think the BMS is on the mainboard instead of on the battery.
I don't think so - at least it doesn't have any provisions for balancing or detailed battery management through the battery connector. Here's the pinout from Framweork's Github, and as you can see, it has 6 power pins (BAT+/GND), two for SMBUS (data and clock), and a BATT_PRS and SYS_PRES pin. In other words "all" you'd need is a BMS with the correct presence pins that was capable of communicating with the system controller chip over SMBUS. I don't know whether there's a standard for how laptops communicate with batteries over SMBUS (though apparently that is one of the major uses of SMBUS), and I doubt most BMSes have that capability, but this sounds hackable, no? Searching for "SMBUS BMS" certainly brings up some options (though I haven't found any compact 4S boards in my two seconds of looking).

This makes me rather curious whether most or many laptop batteries might be interchangeable outside of the different connectors and pinouts.
 

Thehack

Spatial Philosopher
Original poster
Creator
Mar 6, 2016
2,811
3,669
J-hackcompany.com
Because of its 10-pin connector I didn't think trying to make a custom battery that would work with that connector would be worth the trouble, and thus have been trying the USB-PD input.

If a powerbank has pass-through charging that could work for me. There are also some boards for DIY powerbanks, since I already have a couple batteries laying around, but can't be sure on their long-term reliability.

The current BIOS for Framework does have a setting to let you change the battery charge limit.

Opting to just go with the laptop battery, the only reason I held back is because my enclosure design would have a small footprint, like a Steam Deck or 60% keyboard, about as half as the laptop's footprint. Which means the battery has to go somewhere else, some place right above the motherboard. I have concerns about doing this too because of the heat output from CPU, RAM and VRMs. In this layout, the battery won't be touching the board, but have an air gap of a few millimeters separating it.
I don't think so - at least it doesn't have any provisions for balancing or detailed battery management through the battery connector. Here's the pinout from Framweork's Github, and as you can see, it has 6 power pins (BAT+/GND), two for SMBUS (data and clock), and a BATT_PRS and SYS_PRES pin. In other words "all" you'd need is a BMS with the correct presence pins that was capable of communicating with the system controller chip over SMBUS. I don't know whether there's a standard for how laptops communicate with batteries over SMBUS (though apparently that is one of the major uses of SMBUS), and I doubt most BMSes have that capability, but this sounds hackable, no? Searching for "SMBUS BMS" certainly brings up some options (though I haven't found any compact 4S boards in my two seconds of looking).

This makes me rather curious whether most or many laptop batteries might be interchangeable outside of the different connectors and pinouts.

my lenovo is just a simple 2 lead. BMS is on the battery itself.
 

Valantar

Shrink Ray Wielder
Jan 20, 2018
2,201
2,225
my lenovo is just a simple 2 lead. BMS is on the battery itself.
Hm, that must mean that the BMS is not responsible for voltage/charge level measurements etc., but that this is handled by something on the motherboard? And you've got no option for temperature reporting or other error reporting? Doesn't sound like the best solution to me. What Lenovo model is that?