Charging/powering electronics from battery...safely?

Joined
Nov 18, 2024
Messages
10
Location
Tucson, Arizona, USA
Hello! I'm adding some additional functionality to my ebike to power and charge electronics. I've set up a system below, which I've basically tested and works as expected. The idea here is simply to provide usb and dc out at 12v which I can then use for laptops, phones, my bike lights, etc. I realize that my battery has a USB-A port but this is a low power port, and I'd like to run other things that are potentially up to 100W.

Overall it is working on a test with the bike stationary and I'm not pedaling or anything. I don't have regen on the bike yet, but do plan to add it, mainly to improve braking (its a cargo bike).

So my questions is: how safe is this system? Do I need a fuse between the battery and the buck converter? Or something else? My thought is that normal biking should be fine, and it should draw current from the battery ok. I'm wondering what will happen if I enable regen, and if the rush of current back towards the battery would indeed go to the battery like I want, or if it would perhaps do something nasty to my buck converter.

Thanks for any feedback!

theseus_electrical.jpg
 
Good ideas, I do similar things with my e-motorcycle.

Your battery already has a BMS, so any fuse or protection you add won't necessarily be needed to protect it. By adding a fuse in between your battery and the 12v buck converter, you would be adding protection to the buck. If you feel that you need to add that protection, go ahead, it won't hurt. I would use an inline automotive fuse, like this.

To size the fuse, you'll need to consider the amount of power you plan on drawing. You said up to 100w, so let's call it 100w. At 12v, that'll be 8.3 amps on the 12v side. If I were you, I would go ahead and use a converter that says it's rated for 15A, because you never know with these ratings, always good to have overhead. Once you've decided on your converter amperage, let's call it 15A, you can size your fuse for the input side. If you have a 48v battery, assume it's lowest rated running voltage, I'm gonna say 40v at the absolute lowest. 100w/40v = 2.5A, assume 20% inefficiency, means you'll want a 3-4 amp fuse on the input side. Make sense?

Personally, I wouldn't bother fusing the output side: most converters already have built in short-circuit and reverse current protection, and you wouldn't need to worry about drawing too many amps, the voltage will collapse when it draws too many amps anyway.

May I ask what your custom 12v computer is?
So my questions is: how safe is this system? Do I need a fuse between the battery and the buck converter? Or something else? My thought is that normal biking should be fine, and it should draw current from the battery ok. I'm wondering what will happen if I enable regen, and if the rush of current back towards the battery would indeed go to the battery like I want, or if it would perhaps do something nasty to my buck converter.
This is indeed one thing you need to watch out for. Under normal circumstances, stationary or not, the converter doesn't care about regen or changing voltage or whatever, all it cares about is whether it's within its rated voltage. However, something that's happened to me twice: I've been moving, some incident happens during regen, and the BMS cuts off battery charging to protect the cells. If that happens during regen, the controller will still try to dump current into the battery, and if the battery isn't there because the BMS shut off charging, the controller will try to dump current into the converter. Since it's not a battery and can't act as a dump load on the input side, the "charging" voltage just spikes really high, and fries the fets in the converter. Fusing the input side doesn't protect against that, because this is an overvoltage situation, not an overcurrent situation.

To protect against this, I've done two things on my current builds. First is that I order converters that can take a higher rated input voltage than what I actually expect them to get. In your case, consider ordering 72v-to-12v converters. Second line of protection is just to buy 2 converters, and keep your spare handy in case you need to swap it in.
 
The solution to the case above (overvolting the converter when BMS cuts off the battery during regen) could also be to connect the converter before the BMS (directly to battery terminals). Then you're always connected with the battery and cant be cut off. And then a fuse would be useful to protect the battery from short circuits.
 
The solution to the case above (overvolting the converter when BMS cuts off the battery during regen) could also be to connect the converter before the BMS (directly to battery terminals). Then you're always connected with the battery and cant be cut off. And then a fuse would be useful to protect the battery from short circuits.
Good idea, if you have access to the battery terminals before the BMS, this is another option.
 
Thanks for the additional info. I hadn't thought through the scenario where the bms might cut off charging and then suddenly all this power could go to the buck converter. I looked back at the listing on the converter and it does mention in the listing
  • Intelligent protection: built in overload, overcurrent, overtemperature and short circuit protection.
So that feels like hopefully that should be effective. We will see. I think your point of having a spare also makes sense so I'll look into it.
The solution to the case above (overvolting the converter when BMS cuts off the battery during regen) could also be to connect the converter before the BMS (directly to battery terminals). Then you're always connected with the battery and cant be cut off. And then a fuse would be useful to protect the battery from short circuits.

I don't have easy access to the battery terminals, just connecting it from the normal output via XT60. But...maybe this is the same thing? I'd have to crack open the battery to try to remember. (and probably take photos this time!)

So yeah, I think the inline fuse may be overkill here, and I'm fine. I think overall I'm worried about these little edge cases in case I want to, say, charge something or run 12v lighting, etc.

May I ask what your custom 12v computer is?
I've built my own small form factor pc. Its essentially a laptop replacement I call the 'portadeck'. I am tired of crappy laptops and so a while back I 3d-printed a laptop replacement which is a lot chunkier but with quality components I can replace as necessary. It has dual barrel jacks and additional power circuitry so I can run anywhere from 10-24v and hot swap between a laptop power brick at 20v and a 12v battery. In general it pulls about 30-40w in a single monitor setup, but can spike up to 100, even 120w gaming or with a second monitor.

Here's a pic from last night of it running off the ebike battery!
portadeck_powered_by_ebike.jpg


Thanks for the replies! I think I feel a bit more comfortable with this setup now.
 
If you need to prevent regen from damaging the buck converter under worst-case circumstances**** then you can add a zener diode or TVS of sufficient current capability wired across the input of the BC, that is spec'd above the normal system and charging voltages, but is below the BC's input voltage limit, so that it at least damps the worst of the votlage spike that can happen in that situation.

But if you have any situation (long downhill, etc) that will cause regen for longer than a moment, the protection device might fail and the voltage may get thru to the BC.

You can also add protection devices on the output of the BC so that it can't output a voltage higher than what the devices it's powering can handle, just in case the BC fails in a way that passes the input votlage to the output (depends on it's design; if it's an SMPS that shouldn't be possible, but few of these cheap products have *any* protections built in...)


A fuse only protects something from too high a current flow--it can't protect against too high a voltage (unless that voltage induces a high enough current thru the fuse to blow it, which won't happen under most circumstances / designs).

So you can use a fuse to prevent the BC from drawing too much current from the battery, but a fuse can't protect the BC from bad inputs of whatever kind.


****when the BMS disconnects the battery to protect it for any reason, the current flwoing thru the motor coils and the controller FETs will make a much higher voltage back out of the controller's battery input terminals and across all the parts on the battery bus inside the controller. That can also blow up the controller, as it normally has no protections against this (it depends on the battery to deal with that).
 
I have a vision of a fellow on a bike slowing down holding a spinning electric drill.

How real is the scenario of both using power and invoking regen? I suppose if you are charging a battery in a device apart from the bike's battery, then there is an issue.
 
How real is the scenario of both using power and invoking regen? I suppose if you are charging a battery in a device apart from the bike's battery, then there is an issue.
Have to wait for the OP to answer for sure, but since the OP is using a computer and a USB device off the DC-DC that runs from the pack, and is worried about the issue of regen, then it's presumably going to be running those devices while riding, and thus could be affected by a regen-induced situation.

If they're not used during riding and are not connected to the DC-DC, then the only risk is to the DC-DC itself, which could be left disconnected / switched off, and then the only risk is to the controller itself (and any display or other battery-voltage-powered devices still connected when the BMS disconnects the battery during regen, if that ever happens, which would only occur in very specific situations).
 
How real is the scenario of both using power and invoking regen? I suppose if you are charging a battery in a device apart from the bike's battery, then there is an issue.
Its not very realistic that I will be using power and invoking regen like this. The most likely scenario is that I'll be taking a journey and my lights will be low, and I want to recharge them on the ride somewhere with the intent of riding back in the dark. I am mainly just wanting to ensure that I am aware of the pitfalls of this kind of setup, because this is my first time doing it.

I have a vision of a fellow on a bike slowing down holding a spinning electric drill.
:D if only i had a dc-powered drill i would take a pic for ya :D.
 
Back
Top