How to Build a Robust DIY Electric Bike for a Budget
by Romdu421 in Outside > Bikes
2533 Views, 40 Favorites, 0 Comments
How to Build a Robust DIY Electric Bike for a Budget
If you are like me, you hate coming all sweaty at school or at work in the morning because riding your bike was difficult. So I decided I needed an electric bike. I looked at the prices and... way too expensive for a student. So I looked at the kits with an electric wheel, but they were also expensive and... Where's the fun of building that? So the only solution: build my own. With all the material and if you adapt your own bike, you can build it for under 250€, which is quite reasonable for an electric bike, and less expensive than electric wheels. Unlike other projects, it's driven by a chain which allows it to have much higher efficiency.
I've so far traveled 250 km with it, with no major problems, so it's quite resistant.
Warning : this bike is adapted to the French law. If you plan on using the code and the hardware on another country, be sure to check that your design is OK with the law.
Supplies
-10k Potentiometer
-Magnets : what you want as long as they are 8mm wide and powerful enough.
-Wiring : I used old RJ45 cable, it worked pretty fine. For the power, I used 1.5mm2 copper wire.
-Jumper cables : a lot (at least 100), anyway you'll need them to test your sensors, your code...
-Voltage regulator : What you want, you need one DC DC converter which can convert 24V into 6.5V with 1A.
-3D printer and ABS filament : around 300g. (As it will be used on the outside, PLA isn't the best idea)
-Steel tube : 1m of 20x20mm tube, thickness 1.5mm.
-Aluminium : 1m of 2mmx20mm profile.
-Screws ans bolts...
-Motor : 250W MY1016 with a 1/8 inch sprocket and 10 teeth.
-Wheel sprocket and chain : 1/8 inch chain and sprocket with 68 teeth.
-Poly carbonate plate.
-Batteries : 18V and at least 15Ah if you want a 25km autonomy.
-A water proof box to put the electronics in, 25cmx20cmx10cm should be enough
-Various connectors and small electronics...
Assembly of the Sensors
There are 2 sensors on this bike : a pedaling sensor, which senses when pedals are turning, and a speed sensor. In both case, they are hall effect sensors. The pedaling sensor has 2 sensors, so it knows the direction of the pedaling.
First, print the 5 parts : magnetic wheel (2 parts), pedaling sensor box, wheel magnet support, speed sensor box.
Then, we will focus on the pedaling sensor. Put the two hall effect sensors in the box, wire them, and seal the box. For me, gluing a piece of plastic bottle on the top and hot glue to waterproof the wire worked fine. Keep careful to have wires long enough to go to your electric box. Glue the magnets into the wheel, but be careful, magnets will trigger the sensors only if they are placed in the right direction, so test them before gluing them. Then, install the box and the wheel as on the picture.
This is the same process for the speed sensor, except this time you'll install the box on the rear wheel, as on the picture. This box is also smaller, since only one hall sensor is required, and the plastic part which goes on the wheel only has 4 magnets (but 2 is enough).
The Screen
For the screen, you will need to print the two files below.
On the screen, you will see your speed, your battery level, and the current which is drawn by the motor. The potentiometer next to the screen is used to control how much electric assistance you need.
You 'll need 9 wires to wire the screen and the potentiometer.
Then, wire the screen as explained in this site. You'll need to wire the potentiometer as well, simply use the +5V and the ground from the screen, and the ninth wire to transmit the signal.
For the lid, glue a transparent piece of plastic, screw the potentiometer, and close the box with 4 screws. Water proof the wires coming out of the box with hot glue.
The Batteries
Here you have the choice for the battery. In order it to be compatible with the electronics, it has to be between 18V and 24V nominal, lithium-ion. I personally used power tools batteries, since they already include a Battery Management System (BMS) and a protection, they are already water proof... If you want to use Parkside ones, you can print the part I designed to plug them in, and wire them as in the picture.
If you want to use 18650 or 21700 lithium-ion cells, remember that with these a BMS and a temperature protection is mandatory. To connect it to the bike, I used this sort of 3 pin connector usually used with 220V and rated to 40A.
Downloads
Attach Gear on the Wheel
The most efficient way to attach I found to attach the gear to the rear wheel was to use a plastic piece to hold everything in place. It's attached to the wheel by 5 screws, and to the wheel by 10 screws and 5 aluminium plates. As you can see on the picture, I initially used plastic plates but they turned out to be not resistant enough. Also, you don't need all the screws, I designed it to hold the forces applied with only 80% of the screws.
Print the plastic plate with a 100% infill or it will simply be destroyed on the first try.
Downloads
The Motor Structure
This part will be the longest to build.
I won't explain in details how to build it because it strongly depends on the tools you have.
You have the 3D file of the total of the assembly so you'll be able to study it.
There are 4 major parts : the motor support platform, consisting of 4 steel tubes held together with plastic brackets, and an aluminium plate to hold the motor. Then, the arms and the connection linking the bike frame to the motor platform, consisting of 2 steel tubes, plastic parts, threaded rods, aluminium plates to reinforce. The anti-tilt bar, whose length can be adjusted, allows the motor platform to not turn around the axis the support are screwed onto. Finally, the chain goes through a small plastic guide (visible on the last picture), in order it not to jump out of the gear (you can choose not to use it, but then the tension will have to be much higher and the mechanical losses will be much higher).
Finally, you can build a polycarbonate casing for the motor, to protect it from water. The motor is supposed to be already water proof it's better to protect it a second time.
Electronics
For this part, it depends on the box and the components you have. The wiring and the PinOut is detailed in the program, so it shouldn't be very difficult to wire. This is simple : the battery goes into the DC DC converter, on the motor driver, and on the 1:5 voltage divider bridge. The DC DC converter has to be set to 6.5V out, and it must go into the Vin port of the arduino. Then use the arduino 5V to power anything else with 5V. The current sensor must be put on the wires going to the motor, make sure you plug it in the right way. If you have any problem with that, ask in the comments and I will be happy to help!
PS : on the picture the wiring is quite messy, I improved it afterwards, but try to do a better job than me.
The Arduino Program
The program is attached below. Of course it can be improved, this is just a program to run it with no problems. If any of you makes another program, feel free to share to share it!
The basis of this program is to detect when the pedals are turning, and if they do, the system will send the amount of current, which is chosen by the user between 0 and 25 Amps, to the motor. This requires a system control loop, I will not get in the details here but the parameters in the program seem to work just fine.
Downloads
Conclusion
Congratulations, you now have a working electric bike! The design is pretty robust, and personally I have a 30 km autonomy with it, which is quite decent for my use. So far I've traveled 250 km with it, I'm waiting for it to break, to improve the design knowing how it failed. I will post the improvements on this instructables. Thank you!