Let's make an #e-bike out of garbage. You will need.

* One dumpster bike (free)
* One cargo rack (free)
* One hub motor (dumpster dived, but about $200 new)
* One motor controller (about $20-$50 new)
* A battery (recycled, but about $100 new)

I'm going to rewire some used 12v lithium batteries to make a 36v battery with a smart battery management system (monitor charge from your phone).

I started by installing the front wheel, installing the cargo rack, mocking up where I'll mount the battery, controller and throttle.

Next I'll wire the key components, get the wheel turning, then look at which of the other wires need to be connected. (Some brake cutoffs, pedal sensor, maybe a key lock to see if a wild @alice appears).

This happens to be a folding bike, because that's what was at the front of the bike pile.

@Unixbigot you should use your awesome e-bike powers to develop a way to charge the batteries over USB-C! It would greatly increase the range of all existing e-bikes and make me personally very happy.
@danielquinn I could totally make you a usb-c bike charger out of parts i have on hand. It’s gonna take 8-10 hours to charge your bike tho. (The difficult we do immediately, violating the laws of physics takes a little longer).

@Unixbigot assume for a moment that I know nothing about electricity (this isn't too far from the truth). Where does this limitation come from, and how might we reduce that from 8-10 down to around 6?

I mean, my laptop has a 110W USB-C power supply. Isn't that good enough?

@danielquinn USB-C chargers are often 65w, 100W or 140W. I presumed 100W. My bike battery is 36volts with an advertised¹ capacity of 30Ampere-Hours. Assuming a perfectly spherical electron, thats 1080 watt-hours so at 100W it would take 10.8 hours to charge from dead flat. But you never run it dead flat voltage regulators are only maybe 90% efficient and there is always heat loss, so 6-10 hours is a ball park figure for an end of trip charge. Not impossible over USB.

¹ lies

@danielquinn @Unixbigot The limitation comes from the wires used. USB Type-C connectors can only safely pass about five amps. Same for the wiring in the cables. More current, and you’re at risk of the cable or connector heating up too much and causing an electrical fire.

The other option to provide more power is higher voltage. USB-PD now allows up to 48 volts at five amps for a total of 240 Watts. Most Type-C power supplies can’t do voltage that high, though, so you would end up with a bike which can only charge with special chargers (defeating the point of using Type-C), or much more complex power regulation circuitry on the bike end (significantly increasing cost).

@bob_zim honestly, I'm less interested in being able to use any USB-C charger and more in being able to use the same charger for my phone, laptop, and bike.

If for example I can just have a standard (compact?) model I can buy and leave two at work, carry one for travelling and have a bunch around the house, it's much more convenient. Also, not having to buy & carry the bulky bike charger around would be a huge bonus.

@Unixbigot @danielquinn 8-10 hours... Bike home from work/university, plug into charger. Hang out at home doing usual stuff, sleep, wake up, do usual morning stuff...bike might be fully charged by then. Maybe.