More newbie questions about USB ports and lights.

Raider

100 mW
Joined
Sep 7, 2020
Messages
38
Hiya, folks.
Hope you all are doing ok.
I have a question about taking power from USB port and use for lighting on my e-bike project.

But first some background.
This project vas built last summer and I have quite a few kilometres on it by now.
Call it a rolling build if you will.
It started its life as a average MTB. 27 gears, dampers in front and disc brakes on both 26 inch wheels.
Then I bought a kit, a 1500W hub motor, a 45A controller, throttle, KT LCD9 and a 52v 20ah battery pack. All very much illegal to use here in Norway, of course. :wink:
Threw it all together and after a few teething problems, it ran quite ok. If a little on the slow side. Only 1840W reached the motor on assist 5 and full throttle upphill. And a max of about 50 km/h on level roads.
Nothing at all to write home about and quite disappointing, really.
So, next step was one more battery, another 52v 20ah, and connect both in parallel. That did help a lot, even if the bike got about 5kg heavier. Now I get about 2500w to the motor on full throttle, and I guess that is the max of what the 45A controller can give me. Top speed increased to a little over 60km/h but I limited back to max 55. It'll still do over 70 km/h down hill and that's WAY more than enough for this feeble, old man.
The batteries was attached side by side in the frame with velcro strips and I felt that was a little wonky. And looked odd too. So this year I have gotten a 3D printer and made a new, bolted, attachment rig for the batteries to fit better inside the frame triangle. I was even able to make a new box for the controller and locate it in another place so it looks a LOT better. Some new attachements for lights, display and other odds and ends have also been constructed and printed.
And now for the thing I would like some help with:

Since late in the summer it gets dark kind of early around here, I decided to get some lights on the bike. From the seller it was claimed that the controller had a light function that could deliver up to 150mA, and I kind of figured that would be enough to use as on/off power for a relay. And then run 5V from the USB port in one of the batteries as the main power to the lights. But no.. That light circuit gave up with a small fzz and a tiny smoke cloud and died. And so did the entire controller.
Nothing works if you let the smoke out, we all know that. And bogus info from chineese is nothing new either.
So I built the lighting circuit another way, and mixed together something with a dual light switch to have on/off and high/low beam functions. control from the brake lights was taken from the regen circuit switches on the brake handles and some relays. The dumb thing about that was that the regen stopped working all together. Only brake light from that time on.
The power to all of this was taken from a the USB circuit and it all worked like a charm.

Now I am rebuilding it all. Hiding a web of cables, constructing connection boxes and have also constructed a new tail light/reflex/brake light combo. Incredible what Fusion 360 and a 3D printer can do :D I have also constructed a couåle of amber marking lights that goes inside the ends of the handle bars. Not much visible until they light up.
The thing is, even if all of this is just LEDs it's starting to draw some power. I've been told that the USB circuit can only supply 1.5A. So I was thinking: What if I used the USB ports on both batteries? I see a problem there right away. Power going from one USB port into the other battery via the USB port. We can't have that. Tried to ask the seller if the USB circuit was made in a way to let the power OUT only, not in to the battery from the port but the answer was ... Que?? :confused:
So I stopped asking and just suppose that the power CAN go the wrong way.
So, Cables from USB circuits on both batteries connected together in a three way connection that goes on to the lighting system. Like a upside down Y.
Would it be enough to use a Schottky diode on each oth the Y's legs to prevent power to go across between the batteries?
Or would someone have a better solution? Mind you, I am also a bit of a newbie when it comes to electronics, or at least the calculations and stuff :D
As of right now I have 3 LEDs of 3.1v in the head light along with a few red in the rear and a couple of amber LEDs. And thinking about adding another 3, 3.3v Creel LEDS to the high beam. And it's no way to add more batteries for the head lights. No room. Even if I have the battery packs that they was delivered with.
I'd be very greatful if anyone had a good and rather easy to make, solution to the USB problem.
 
Rather than bodging together the ports with diodes (which may work, but risks damaging both ports and whatever electronics in the batteries drive them) I would recommend simply using a DC-DC converter that takes your battery voltage and converts it to the lighting voltage. They're not really expensive, and can even be found as "isolated" which means the output has no common wires with the input, in case that is useful. They do add another little box to your system, but it's also something you can easily replace if it fails.


Regarding the relay problems: if you were not using a reverse-biased diode across the relay coil, the voltage spike from the coil turning off can damage the driving electronics. :(

(if the USB power conversion is part of the BMS, damaging that may damage the rest of the BMS functions, perhaps in unpredictable ways).

Note that the original USB specification would be only 500mA per port; anything above that is specific to each device that provides it. So if each battery is exactly the same, and they specify 1500mA per port, then you could get up to 3A total...but if they are not exactly the same and use different electronics to provide the USB power, then the limit may be different for each one.
 
Thanks a lot for taking the time to answer. :D

amberwolf said:
Rather than bodging together the ports with diodes (which may work, but risks damaging both ports and whatever electronics in the batteries drive them) I would recommend simply using a DC-DC converter that takes your battery voltage and converts it to the lighting voltage. They're not really expensive, and can even be found as "isolated" which means the output has no common wires with the input, in case that is useful. They do add another little box to your system, but it's also something you can easily replace if it fails.

Well, that's just the problem.. It ain't no more room left. Or rather, I don't want anything to look "hacked" on. So I'm trying to hide as much as possible. I'll have a look at the size of a DC-DC converter to see if it can be fitted inside the triangular, original battery box, but in that case, I' gonna need two of them. One for each battery since my setup is such that I can run on only one battery at a time if I want to. To extend the milage.
Since the lighting system already are built and calibrated for 5v, I need to stick to that power. Problem with the quality converters I have found is that they are 150mm or more in length, by 60-70 mm width. WAY to big to use on a ebike for my taste.

amberwolf said:
Regarding the relay problems: if you were not using a reverse-biased diode across the relay coil, the voltage spike from the coil turning off can damage the driving electronics. :(
Yeah, I know now, lol.. Who let the smoke out... :wink:
I have reconnected the original regen system, though. I decided that I missed the braking effect of the regen, so now I have some other micro switches I'm going to use for the brake lights so it will be a part of the existing 5v system. Don't want to mess with the controller any more than I have too. It runs on magic I don't understand so best left alone.

amberwolf said:
(if the USB power conversion is part of the BMS, damaging that may damage the rest of the BMS functions, perhaps in unpredictable ways).

Note that the original USB specification would be only 500mA per port; anything above that is specific to each device that provides it. So if each battery is exactly the same, and they specify 1500mA per port, then you could get up to 3A total...but if they are not exactly the same and use different electronics to provide the USB power, then the limit may be different for each one.

The USB conversion are a part of the battery pack, yes. When I open up the case I see a specific board for the USB circuit in there, connected to the USB plug.
And yes, it was the manufactorer that told me that those USB ports are rated for 1.5A. And I was thinking exactly what you said, that both USB ports would give me 3A to play with. And that would be plenty. I am thinking that even 1.5A would do, and it isn't a problem right now, but if I add another 3 of the 3.3v 1W leds to my high beam, it would be too little or just at the limit.
And both the batteries are of course identical. Otherwise I wouldn't taken the chance of running them in parallel. The way the setup works in that I can run on both batteries if I whish, or I can run on only one at a time. If I need longer range. In theory, based on the 2080 kw/h I have the max range could be as much as close to 200km. If the calculations I can find online are correct.
But that's one of the things that are going to be tested this summer. So the way it is now is that I can use the USB from any of the two patteries. It's just a 5.5mm plug to connect to what ever battery I'm using.
I'm also building for easy maintainance or repair, so every component can be easilly disconnected and replaced.
I don't know. In my head, the best solution is to be able to draw 5v power from both batteies at the same time. Also to keep the voltage balance the same when both are in use.
So, a circuit like a inverted Y seems to me to be the best solution. Also the easiest to hide away. Isn't it a safe and small (size) way to ensure no power transfer between USB ports?
How could the diodes damage the ports, btw? Could you explain? In simple terms if possible :wink:
 
Btw.
In my circuits I have about 25 red LEDs. But only half of them draw full power (brake lights) The rest goes on about 70%. And they are "stolen" from a 12v led strip. I have used only the leds, though. Not the resistors. On a 5v circiut, how many mAh would that draw?
And my headlights consists of 6 x cree XM-L T6 leds. That would draw more than 1.5A, right?
Tried to find some calculators to figure this out, but the more I look, the foggier it gets :?
 
I connect two batteries to controller and DC convertors using a 4 way patch lead and added a fuse to the battery side of the DC convertor. I can't think of a better way.

Sounds like you are talking about something similar.

Built in USB ports on battery or controller are probably best used only for low current gadgets like mobile phones and cameras.
 
TDB said:
I connect two batteries to controller and DC convertors using a 4 way patch lead and added a fuse to the battery side of the DC convertor. I can't think of a better way.

Sounds like you are talking about something similar.

Built in USB ports on battery or controller are probably best used only for low current gadgets like mobile phones and cameras.

Thanks for answering.
Well, yes. Similarities are present, lol..
The thing is, though. I got no more room to attach any more gadgets. Or cables for that matter. It already looks like a spiderweb. I whish it was possible to hide most of it inside the frame. But..
And that is my biggest headache. Everything has to be as tiny as possible.. I hate the "hack" look..
 
Molex P/N 84729 / 84727

or a

MOLEX P/N 795405004

I love building harnesses. I am getting very good at it.
 
DogDipstick said:
Molex P/N 84729 / 84727

or a

MOLEX P/N 795405004

I love building harnesses. I am getting very good at it.

Nice. Waterproof too.
I'm using theese. The male a little modified with a 3d printed enclosure for a 5mm magnet to hold it in place. Mounted in the underside/front of each battery case.
Don't like water much so I stay well away from any rain. Waterproofing not needed in my case :D
And I was thinking, since only power is needed, two cables was good enough.
 

Attachments

  • 5.5 female.jpg
    5.5 female.jpg
    10.8 KB · Views: 324
  • 5.5 male.jpg
    5.5 male.jpg
    20 KB · Views: 324
Raider said:
Thanks for answering.
Well, yes. Similarities are present, lol..
The thing is, though. I got no more room to attach any more gadgets. Or cables for that matter. It already looks like a spiderweb. I whish it was possible to hide most of it inside the frame. But..
And that is my biggest headache. Everything has to be as tiny as possible.. I hate the "hack" look..

I agree with you on the mess of wiring and gadgets. I like to consolidate all wires into a single run, everything cut to the right length. Still very difficult and mistakes are made. Constant evolution. I use lots of heat shrink, connectors, spiral wrap, silicone tape, double sided mounting tape, even hot glue. It is cluttered, but not too messy.
It is possible to drill holes in a frame with no ill effect. I am not there yet.
 
This will give me more gray hairs, I swear :D
So I guess I'll do it the easy way.
Not mount the extra high beam light I was going to, just simply replae the LEDs in the existing headlamp with the slightly more powerful cree XM-L T6 leds. After all, it lights up very nicely quite far in front of the bike, and I get a little better low beam.
And then I can use the setup I aleady have, simply move the plug between batteries if I decide to run on one at a time, or leave it be when I run on dual batteries. It doesn't draw a lot of power and doen't matter at all when it comes to the balance between the two batteries.

Thanks for the tips and help, folks.
Have a nice spring weekend and enjoy your bikes.
Cheers.
 
TDB said:
Raider said:
Thanks for answering.
Well, yes. Similarities are present, lol..
The thing is, though. I got no more room to attach any more gadgets. Or cables for that matter. It already looks like a spiderweb. I whish it was possible to hide most of it inside the frame. But..
And that is my biggest headache. Everything has to be as tiny as possible.. I hate the "hack" look..

I agree with you on the mess of wiring and gadgets. I like to consolidate all wires into a single run, everything cut to the right length. Still very difficult and mistakes are made. Constant evolution. I use lots of heat shrink, connectors, spiral wrap, silicone tape, double sided mounting tape, even hot glue. It is cluttered, but not too messy.
It is possible to drill holes in a frame with no ill effect. I am not there yet.

Seems like we're doing pretty much the exact same things. :D
Since a lot of my cabelling are signal cables only it's possible to use rather thin wires. And I also use RC servo connectors where evern possible. They are small and easy to stack. And also, they are directional, so it's not possible to connect them the wrong way.
Due to the fact that I can use Fusion 360 and a 3d printer I can also construct connection boxes to hide all the cable junctions. I have one screwed to the stearing head, in the same shape as the pipe, only 30mm wider and then I made some shields to screw on under the frame down to the crank ( where the pedals are.. Not sure if that was the right word since english isn't my 1st language) Same curve as the pipe, only stands out from the pipes 15mm to cover the cable on the way down.. It works.
Then I have a connection hub printed for the real lights, mounted under the package holder in back.
But still.. Man it's a lot of cables. lol...
 
A led doesn't work on a voltage, it should be current driven. The led voltage is a minimum voltage you need before the led will start to conduct current. If you connect your led's directly to a 5V source without a current driver in between, the current will only be limited by the maximum that 5V source can deliver. So, your led's might burn out real fast. That's the reason why led strips have some resistors to limit the led current.

I don't see why you need 2 converters if you use the voltage converter approach. Just take the voltage going to your motor controller that comes from wathever battery you are using at that moment.

2 diodes should work to prevent backfeeding from one usb port to the other.
Diodes have a voltage drop and heat up due to that. So, depending upon your needed current, the diodes might need some heatsink attached to them.
 
Back
Top