Ryobi Powered DIY E-Bike


Last summer I got into road biking, and this summer I decided to build an electric bike. My goal was to build an e-bike for under $500 CAD, and sell it after. I have successfully built a low cost and unique commuter e-bike, and it has been a joy to ride to work. The key feature of the e-bike is that it is powered by Ryobi 40V batteries which are readily available from Home Depot. The components that were 3D-printed went through many iterations and many lessons were learnt along the way. There were many design considerations for this project and some sacrifices were strategically made to save costs. In this post, I outline the key decisions made and the lessons learnt along the way. 

Skills Utilized & Learning Outcomes:

  • CAD design for custom 3D-printed parts with threaded inserts,

  • optimizing and troubleshooting 3D-prints,

  • soldering,

  • learned about e-bike components and structure, 

  • tuning rear derailleur and brakes,

  • truing tires,

  • designing with limitations and for marketability, 

  • learned about designing for weather resistance.


Tools Used:

  • 3D printer,

  • soldering iron,

  • heat gun to contract heat shrink,

  • crank remover,

  • file,

  • wrench,

  • allen keys.


PART SELECTION

Battery:


A major concern while building my e-bike was the battery pack. I needed an affordable, safe, and accessible battery option. Safety was the main driving factor as I planned to sell my e-bike on Craigslist or FaceBook Marketplace afterwards and did not want any major liability. I considered the following options for the battery pack:


  • DIY 18650 battery pack,

  • premade e-bike battery packs,

  • LiPo battery packs, and

  • drill/power tool batteries.


Creating a DIY battery pack from Li-ion 18650 cells would be cost effective, but would require more work and place greater liability on myself. Buying a dedicated e-bike battery was eliminated as an option due to availability. Most batteries would have to be purchased from China and the costs were high. LiPo batteries posed a fire hazard if impacted and generally are not the best at repetitive deep cycling. Drill batteries were the best option for my case due to the inherent rugged design for consumers. In addition, most drill batteries are powered by Li-ion 18650 cells which is perfect for e-bikes due to the long lifespan under demanding loads.  



Affordability (1-5 where higher is more affordable)

Safety (1-5 where higher is safer)

Accessibility (1-5 where higher is more accessible)

DIY 18650 Battery Packs

4 - About $8 per cell from vape shops, and assuming capacity of 2800mAh per 3.6V cell → would cost $160 for 10S 2P configuration (36V, 5.6 Ah) → $0.80/Wh

1 - High liability for myself if I want to sell the e-bike

1 - Need to obtain 18650 cells, BMS, and construct battery packs

Premade Battery Packs

AliExpress

5 - Lowest cost per watt-hour. Would cost around $250 for a 36V 10.4Ah battery→ $0.67/Wh

3 - Safety features depend on the battery purchased but generally cheaper options have no hard casing and little information on safety

1 - To get the low cost, I would have to order from China and wait months

LiPo Batteries

Amazon

4 - Around $150 to build a 9S 1P configuration (33.3V, 5.2Ah) → $0.87/Wh

2 - Explosive if impacted which could occur even on accident

4 - Can easily buy from Amazon and minimal work to connect

Drill/Powertool Batteries

Home Depot

1  - A new Ryobi 40V (actually 36V nominally) 6Ah battery would cost $240 → $1.10/Wh

5 - Durable by design and intended for rough applications

5 - Can purchase immediately from Home Depot


I ended up buying a 40V 4Ah Ryobi battery for $120 from FaceBook Marketplace. The battery was in new condition and the charger was an additional $30. This lowers the cost from $1.10 per watt-hour to only $0.83/Wh. Another advantage with used power tool batteries is that they can be easily hot swapped with a spare to allow for further range. The estimated range with the 40V 4Ah Ryobi battery is about 17km. This is assuming an efficiency of 15 Wh/mi (9.32 Wh/km) which was obtained from Maya Román’s Github. Maya posted documentation and a video on how their group from the University of Pittsburgh created an e-bike using Ryobi batteries. The 3D-printed Ryobi battery mount was adapted and improved from Maya’s original design (discussed below). 


Motor:


A hub motor was chosen for my e-bike due to availability. I found a used 350W hub motor for $40 on Facebook Marketplace. The motor was dirty and definitely looked used, however it was still functional. Replacing the ugly white wall tire with a new black tire for $33 made a noticeable difference. I went with 350W since the Ryobi 40V batteries are relatively low capacity when compared to full sized e-bike batteries. Also, from my readings, I found that 350W would be adequate for the typical commuter. 


Motor Controller:


Finding a e-bike controller is a fairly simple task. Most controllers are around the same size and offer the basic features such as low voltage detection, throttle control, and pedal assist sensor (PAS) support. I couldn’t find a 350W controller on the used market so I decided to go with Amazon. I chose to order from Amazon to avoid long shipping times from China. I found a bundle on sale for $90 that included the controller, LCD, PAS, brake levers, throttle, and an external speed sensor. This was a decent price considering that it would cost around $50 to just buy the controller and LCD from China.


3D-PRINTED PARTS DESIGN

Ryobi Battery Mount:

As mentioned before, the Ryobi battery mount design was adapted from Maya Román’s design found on Github. I originally printed Maya’s design for prototyping, but then recreated the design using the key dimensions to better suit my needs. I re-modelled the design using SolidWorks and made the follow improvements:


  • reduced length, 

  • made one of the mounting holes a slot to avoid over constraining,

  • added a large curve to fit my bike frame and improve stability,

  • added a slight angle for easier battery removal,

  • cover design to prevent slipping of power contacts, and

  • added holes on side wall to allow water to escape.






The reduced length was required to improve the installation and removal of the Ryobi battery. This is only necessary for my case due to the frame size on my bike, but this also doubles to reduce printing time. One of the water bottle mounting holes was changed to a slot to allow slight deviations between bike frames and prevent over-constraining the design. A curvature piece was added to fit the bike frame and improve the stability of the battery. The curvature piece also contained a slight angle to improve access to the battery’s release button. The reason for splitting the curvature piece into its own part is to improve the printability. If the design was a single piece, the angle would make it more difficult to produce smooth prints in the vertical orientation, and printing flat would require more support material. By splitting the parts, I was able to print on a smooth flat surface and minimize the use of support material. Lastly, holes were added to the side of the battery mount to allow for any water build up to escape before flooding the power contacts. I still need to test the bike in the rain, but currently I am unsure about the weather resistance of the Ryobi battery. 


The same power timer contacts were used as recommended in Maya’s post, but I decided to not put an extra male XT60 connector on the battery mount. Instead, I routed the wire directly to the controller to reduce the length of the mount. M5 threaded inserts were installed to secure the lid. 



Controller Enclosure:

Next, I had to create a design to mount the controller. I did not want to just shove the controller into a frame bag as this bike needed to be presentable to sell. Therefore, I modeled a simple enclosure to hide the controller and wires. This enclosure also featured a custom fit curvature to match the bike’s top tube. The curvature was implemented into the lid design and holes were added for zip ties. A velcro strap was also used to hold the enclosure to the bike’s stem and prevent sliding down the top tube. The lid is secured using M5 screws into threaded inserts as well. 



Pedal Assist Sensor (PAS) Bracket: 

The last part I had to 3D print was an adapter for mounting the pedal assist sensor (PAS). The included bracket did not fit my frame since there was not enough clearance between the bike cranks and the bike frame. I originally thought it would fit and attempted to use JB Weld to attach the sensor bracket to the bike frame. However, after re-installing the crank arm, it was clear that interference was occurring between the magnet disk and the sensor. So, I ended up taking some measurements and designing a new mount for the sensor. This mount attaches to the seat tube precisely aligns with the magnetic disk. To get the correct hole positioning for the sensor, I decided to try modeling from a picture in SolidWorks. This worked flawlessly and the final parts fit together. The design still went through three versions to get the perfect fit.


INSTALLATION OVERVIEW

To get the hub motor to fit within my front spokes, a bit of filing was required. Quite a lot of work was done with soldering wires. I had to extend the hall effect sensor and the brushless motor wires. I also soldered an XT60 connector onto the controller and created the cable to connect to the battery through the power timer contacts. Wire sleeving was used to neatly hide the wires and zip ties were used throughout to keep wires to the frame. The left hand bike crank had to be removed to install the pedal assist sensor and as mentioned before, I needed a custom mount to fit the sensor to my bike. I added some dielectric grease to any exposed leads from the battery to prevent shorting in the case of rain. In addition, I added Loctite to the screws holding the battery mount and to the nuts on the hub motor axle. I found that vibrations would cause these parts to come loose over time. 


CONCLUSION


The final product improved upon existing designs for using power tool batteries for e-bikes and I was able to create a budget e-bike that is safe and reliable. While I haven’t sold the e-bike yet, it is still a great commuter bike for myself. I have ridden the bike over 150 km as I write this post, and it has allowed me to cut my commute time by 30% (40 min bike ride versus 1 hour bus ride). The range is around 15 - 20 km using a single 40V 4Ah Ryobi battery and the range can be extended by purchasing a spare battery to hot swap. The top speed is around 30 km/h. 


For the future, a larger frame bike can be selected to allow for larger Ryobi batteries. The largest 40V Ryobi battery I can fit is 4Ah. With a larger battery, a more powerful motor and controller can be used to enhance uphill performance while maintaining sufficient range. The used hub motor is noisier than a new motor, but does not significantly hinder performance. I would also use a thumb throttle over a twist throttle to prevent accidental acceleration while attempting to squeeze the brake levers. Lastly, waterproofing of the Ryobi battery would allow this project to be adapted for riding in the rain.  





Mistakes:



Here is a picture of some of the early prints and my poor method of matching the bike geometry. I spent a lot of time re-printing and adjusting the curvature for fitting the Ryobi mount to the downtube on my bike. This could have been avoided by cutting a piece of cardboard to obtain the downtube cross section. Then, I could have taken a picture of the cardboard with a ruler for reference and used that to create the correct fit. I didn’t think of this until after learning to use the image reference for the PAS bracket. 


Another mistake is using a lighter to contract the heat shrink. While this method works, it is less effective than using the heat gun. In addition, if the lighter is held for extended periods it can cause burn marks. 


Helpful Resources:

Ryobi Powered E-Bike by Maya Román's Team from The University of Pittsburgh:

Power Tool Batteries for E-Bike Comparison:

BILL OF MATERIALS

ItemSourceQuanityUnit Cost (CAD)Total (CAD)
Hub MotorFaceBook Marketplace1$40.00$40.00
40v 4ah battery + chargerFaceBook Marketplace1$150.00$150.00
Gary Fisher BikeFaceBook Marketplace1$150.00$150.00
Hub Motor ControllerAmazon1$91.25$91.25
XT60 connectors (10 pairs)Amazon1$15.86$15.86
Power timer contact (10)Digi-Key1$4.90$4.90
M5x0.8x10 mm threaded insert (10)Digi-Key1$3.55$3.55
14 Gauge WireCanadian Tire1$20.00$20.00
bullet connectors2$2.69$5.38
26x2.1" TireCanadian Tire1$33.60$33.60
KickstandAmazon1$12.30$12.30
Dielectric GreaseAmazon1$6.15$6.15
LoctiteCanadian Tire1$12.00$12.00
Cable SleeveAmazon1$20.00$20.00
Misc - screws, electrical tape, heat shrink, PLA, crank tool, zip ties
Total$564.99

 








Comments