eBike Wiring

Wiring and Battery Installation for Your EBike: A Step-by-Step Guide

Now that you have your motor assembled, it is time to wire everything and connect the battery. See the video attached to this article for a visual guide to installing the wiring and battery.

Speed Sensor on an eBike
Speed Sensor on an eBike

Installing the Speed Sensor

  1. Loosely attach the speed sensor to the non-drive side spoke. The smooth side of the sensor will face out. Select a spoke close to the chain stay. You will need a screwdriver or torx bit to attach the speed sensor. Tighten the sensor lightly giving you room to adjust it later.
  2. Assemble the speed sensor pickup to the mounting arm. Ensure the wiring connection is pointed toward the bottom bracket. Do not remove the adhesive backing. “Dry fit” the sensor to the chain stay. The magnet and sensor will have to be 2mm to 5mm away from one another. I have found the best spot to mount this is about 6 inches away from the wheel and tire on my bike frame.
  3. Now, clean off the chainstay with alcohol to allow adhesion of the strip on the back of the sensor. Pull the covering off the adhesive strip and stick the sensor onto the chain stay.
  4. Use a zip lockdown the sensor on the chainstay. I turn the zip tie lock down and out of sight for a cleaner appearance.

Main Wiring Harness and Handlebar Connections

One of the first steps when wiring the handlebar connections and main wiring harness is to plan out how your wires will route to your handlebars. Prepare the wiring and ensure nothing will be pinched or near any moving parts where they may be damaged. You can always reroute the wiring later if something is off.

Handlebar wiring on an eBike
Handlebar wiring on an eBike

RIDE e MTB Tip: Are you thinking about building an eBike? It isn’t very hard – Heck I’ve got step by step instructions with videos along with all the tools. Check it out 👉 How to Build a Mid-Drive Electric Bike

  1. Begin with the main wiring harness. Connect this harness to the main output wire from the eBike motor. This wiring allows the speed controller to work, which is housed inside the motor casing. Route the wire loosely up to the handlebars by either going up the seat tube and across the top tube, or along the down tube. Keep the wiring loose for now, as final tightening will come later once you have a clear overview of everything.
  2. You can loosely zip-tie the main wiring harness in place to make working on the remaining wiring easier.
  3. Starting on the left side of the handlebar, slip the thumb pad display control on. Next, slide the brake handle assembly onto the handlebar. Lastly, slide on the handlebar grip. Do not grease or oil your handlebar grip or you may encounter sliding and slipping of the grip. Tighten all components. You can always readjust them later.
  4. Now, attach the display to the handlebars. The kit will come with rubber grommets to secure the display and cushion it against vibrations. Generally, the display goes right in the center of the handlebars using a mounting bracket.
  5. Moving to the right side of the handlebars, slide the throttle on. Next, slide the brake assembly onto the bar. The shifter comes next in line. Lastly, install the grip. Keep everything loose enough that you can move them around if needed. As you install the throttle, think about how often you will use the throttle in order to better gauge its positioning on the handlebar. For me, I plan to use the throttle to help occasionally, not as a primary means of propelling the eBike. I plan to use pedal assist more than the throttle.
  6. Now we will connect the brakes. Stay on the right side and connect the brake cable to the brake lever arm. Reattach the brake noodle to the brake wheel. Repeat the process for the front brake, which comes off the left side of the handlebars.
  7. Pause here and consider how the main wiring harness will run up the handlebars. I have found that the cleanest way to route the wiring harness is along the down tube on the side of the battery. My wiring harness will run along the right side of the down tube. As you connect the wires, consider how yours will run to avoid tangling wires. Most kits will leave you with some extra wire that needs to be bundled up and stored. There is a small spot where the chainstay and the seat tube meet, just behind the bottom bracket shell. This space is generally large enough to bundle and neatly tuck away extra wire.
  8. Moving back up to the right side of the handlebars, connect the throttle wire, which is the yellow female wire. Next, connect the brake sensor cutoff wire, which is the yellow male wire.
  9. The right side will usually have four wires routing to the bike frame: brake cable, shifter cable, brake sensor, and throttle wires.
  10. The left side of the handlebars are typically easier. Connect the brake sensor wire, which is the yellow male wire, to the wiring harness. Again, keep everything loose so you can adjust as needed.
  11. The last wire we need to connect to the handlebars is the display. The display wire is shorter than the others, which makes tidying them up a bit easier.
  12. If you are installing a headlight, now is the time to hook it up. Keep the wire loose and route it where you think the best location will be. I am going to route my headlight wire on the down tube on the right side of the battery.
  13. At this point, I use blue painter’s tape to clean up the writing and pull the extra wire behind the bottom bracket. This method helps hold the wiring in place so you can secure it with zip ties once you have decided your wiring is where you want it.
  14. Always ensure you have left enough slack at the handlebars to be able to turn both directions as far as the handlebars allow without pulling wire or cables too tightly.
Bafang Mid-Drive Electric Bike Conversion
Bafang Mid-Drive Electric Bike Conversion

Did you Know You Can Convert a Regular MTB to Electric?

Bafang a leader in DIY electric bike conversions has a mid-drive kit that will fit on most regular bikes. I’d recommend the BBSHD kit, it’s a complete setup with a huge capacity battery and a 1000 watt motor. Why this setup?

  • Heavy duty 1000 watt motor (built for cargo bikes)
  • +50 volt 17.5 Ah battery for speed and distance
  • Easy installation with provided tools.

If you’re considering a conversion, do what I’m doing get the BANFANG BBSHD 1000w eBike Conversion with Battery

PRO TIP: Check and recheck handlebar functions. Do the brakes work? Can you fully turn the handlebars without pulling the wiring too tight or tearing them out?

Battery Installation

At this point, we are very close to being able to take a short test ride on our newly converted eBike! We need to mount the battery and connect the remaining wiring and we can test out the eBike. As with the handlebar and main wiring harness wires, I will use painter’s tape and zip ties here to leave everything loose enough to change if needed. You need to ensure nothing will get caught in the pedals or wheels before committing to a final wiring scheme.

eBike battery installation
eBike battery installation
  1. If you have tested your bike frame with a cardboard battery template, you know your battery will fit in the space you have selected. Check out this article to make a template for your battery.
  2. Slide the battery off the cradle. You may need a key to unlock the battery from the cradle.
  3. My battery will sit along the down tube water bottle mounts. My battery came with 2 plastic mounts that give lateral stability to the battery while it is on the frame. If you have these, I suggest using them. They help a great deal!
  4. Find some washers that will fit the water bottle bolts and fit into the cradle mounting slots.
  5. Position the cradle along the down tube of the bike frame as low as you can. Account for the battery when installed.
  6. Tighten down the 2 bolts and test fit your battery. Ensure you do not pinch any wires.
  7. Readjust the battery if necessary and allow the battery to slide on with enough room below the cradle to route the wires.
  8. Remove the battery from the cradles and tighten the bolts. You want these tight, but not so tight they are stripped.
  9. Tape everything up with the painters’ tape, ensuring the wires will not get caught in any moving parts like the pedals, chain, or wheels.
  10. Double check the handlebars turn properly and temporarily tape things down. Painters’ tape makes it easy to remove and reattach without much effort.
  11. Clip any zip ties you have installed.
  12. Rotate your pedals to check that nothing is touching in such a way as it could bind or break.
  13. Install the battery.
  14. Turn on the battery and power the display.
  15. Test the throttle.
  16. If everything on the handlebars feels good, tighten everything down.
  17. Take a short test ride.

Finishing Up

If everything seems like it is in a good place, you are happy with the wire routing, and nothing will be pinched or bent, tighten everything down and place the zip ties in their permanent locations. When test riding, do not go far or push it too hard as the wiring is not fully secured.

David Humphries Author at Ride e MTB

Hi David Humphries here the guy doing all the pedaling behind the scenes with this blog. I’ve been in the MTB world for a while and recently started getting into eMTBs. You can check out more about me HERE and on my other passion project – DIYMountainBike.com