Hybrid E Bike or Electric Bike making & Motor Driver designing
Table of Contents
Description:
Hybrid E Bike or Electric Bike- In this tutorial, you will learn how to make a low-cost Hybrid Electric Bike from an old bicycle. In this tutorial, you are going to learn a lot of things and at the end, you will be able to convert any old or new bicycle into an Amazing Hybrid E Bike or Electric Bike or Electric Bicycle.
In almost all, the electric bike projects readymade motor controllers are used, which really does not help the beginners in making their own electric bike motor controllers.
In this tutorial, we are going to make our own electric bike motor controller using mc33151 dual Mosfets driver IC, high ampere Mosfets, a potentiometer, and Arduino. To reduce the price and to explain the extreme basics I am going to use the potentiometer to control the speed of the Electric Motor.
This tutorial is divided into two parts.
In Part1 I completed the mechanical work while in Part2 I covered the motor driver circuit explanation, programming and testing. Detailed video tutorials are available at the end of this article.
Without any further delay let’s get started!!!
If in case you want to check my latest work on
Salvage Hoverboard Motors from a dead Hoverboard
500 watts Ebike BLDC Motor Wiring
How to make a Trike Electric Scooter using Hoverboard motors and 500 Watt Motor controllers
Amazon Links:
433 MHz Transmitter and Receiver Modules:
500 Watt 24v Electric bike Motor:
Double sprocket Gear wheel Hub:
12v 12AH Rechargeable Battery:
Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.
As part1 is about the mechanical work only in which I have practically demonstrated how to change the tires, wheel Hub and how to install the motor. For the step by step explanation, I recommend you should watch the video tutorial given at the end. In part1 the only important thing is the wheel hub selection and how to install the motor.
While part2 is about the circuit explanation, connections, interfacing, programming, and testing. Part2 is really important which I am going to explain. Let’s start with the circuit diagram.
Circuit Diagram:
This schematic is designed in Cadsoft Eagle 9.1.0 version. If you want to learn how to make a schematic and PCB then watch my Tutorial.
The MC33151 Eagle library can be downloaded from my website. First, let’s start with the Power Supply.
This Power Supply is based on the famous LM7812 voltage regulator. J1 is the female power jack and this is where we connect 12 volts from the battery or solar panel. Two 470uf capacitors are connected at the input and output of the voltage regulator. 1 kilo-ohm resistor is connected in series with the 2.5v led. This is a current limiting resistor. the output of this voltage regulator is connected with the VCC pin of the MC33151 MOSFET driver.
Pin number 2 and pin 4 which are the logic input A and logic input B are connected together and will be connected with the PWM pin of the Arduino or Mega. Pin number 5 and pin number 7 are used to control the MOSFETs. As you can see the Drains are connected together and the sources of both the MOSFETs are also connected together. With motor-1 and motor-3 we connect the motor while with E_Supply-1 and E_Supply-3 we connect the 12volts. Before making the PCB I checked this circuit on a Vero board, and performed all the tests, after I was satisfied with the result, then I designed a PCB, generated the Gerber files and placed an online order on the NextPCB official website.
Download Gerber files: electric bike gerber files
Download Eagle PCB Board File: arduino motor driver
Download the mc33151 eagle library: MC33152
The online order placement is explained in the video tutorial given at the end.
This is the PCB which I received from the nextpcb, as you can see the quality is really great, the silkscreen is quite clear and the blue soldermask looks amazing. I am really satisfied with their work.
As you can see, the circuit is ready. J1 is the dc female power jack. IC1 is the LM7812 voltage regulator. Two capacitors are connected with the regulator. At the output of the voltage regulator, a 1k ohm resistor is connected in series with a 2.5v led. The 8 legged IC is the mc33152 dual Mosfets driver IC. R2 and R3 are the 100-ohm resistors connected with the gates of the Mosfet drivers; with the upper side terminal block, we connect the power supply while the motor will be connected with the lower side terminal block.
As you can see I installed a Heatsink, this is really important, otherwise, the Mosfets will really get hot. Use a large Heatsink.
Interfacing:
As you can see two 12v batteries are connected in parallel. The grounds of both the batteries are connected together and the positive terminals are connected together. One wire is soldered with the Ground and the other wire is soldered with the positive. The power supply wires are connected with the upper side terminal block. The two wires coming from the motor are connected with the 2nd block terminal. if the motor spins in the wrong direction you can interchange the motor wires. So, this is how the batteries and electric motor are connected with the controller board.
On the Arduino side, the connections are really simple; pin number 3 which is the PWM pin is connected with the PWM female header and the blue wire is the ground. The variable resistor or potentiometer is connected with the analog pin A0 of the Arduino while the remaining two wires are connected with the 5v and ground of the Arduino. This variable resistor will be used to control the speed of the Electric Motor.
Hybrid E Bike Arduino Programming:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
int resistor = A0; int PWMV = 3; void setup() { Serial.begin(9600); pinMode(PWMV, OUTPUT); pinMode(resistor, INPUT); } void loop() { int data = analogRead(resistor); data = map(data,0,1023,0,255); analogWrite(PWMV, data); } |
Program Explanation:
This is a very simple and basic program. A variable resistor is connected with the analog pin A0 of the Arduino. Pin number 3 of the Arduino which is the PWM pin will be used to control both the MOSFETs. The PWMV is set to output while the resistor is set to input.
In the void loop function, we simply read the variable resistor, then using the map function we limit the value from 0 to 255 and then finally we use the analogwirte function which you are quite familiar with.
For the practical demonstration watch video tutorials given below.
CityRabit GT is value for money Electic Scooty, 100% Eco-friendly, Attractive look, New Design, Good space, Easy to charge, Low maintenance and Easy to ride Scooty. Power is suitable for all ages.CityRabit GT is value for money Electic Scooty, 100% Eco-friendly, Attractive look, New Design, Good space, Easy to charge, Low maintenance and Easy to ride Scooty. Power is suitable for all ages.