Dual H-Bridge - L298 Breakout Board - Homemade
Intro: Dual H-Bridge - L298 Breakout Board - Homemade
This is my homemade Dual H-Bridge using the IC L298N.
For control DC motors or step Motors ao other purposes just like you need.
Others projects:
https://www.instructables.com/id/LINUSBot-Line-Follower-Robot/
https://www.instructables.com/id/Basic-Principles/
https://www.instructables.com/id/PINGBot-Explorer-Robot/
https://www.instructables.com/id/3x3x3-LED-Cube-1/
https://www.instructables.com/id/LINUSBot-Line-Follower-Robot-with-PID-control/
For control DC motors or step Motors ao other purposes just like you need.
Others projects:
https://www.instructables.com/id/LINUSBot-Line-Follower-Robot/
https://www.instructables.com/id/Basic-Principles/
https://www.instructables.com/id/PINGBot-Explorer-Robot/
https://www.instructables.com/id/3x3x3-LED-Cube-1/
https://www.instructables.com/id/LINUSBot-Line-Follower-Robot-with-PID-control/
STEP 1: Hardware and Materials
COMPONENTS:
1 x perf board 13x26 holes (3,5 x 7,0 cm)
2 x AK300/3 connector
1 x 8 Header female connector for Arduino
1 x L298N (Multiwatt15)
8 x 1N4001 Diode
2 x 100nF capacitor
2 x 0,47Ohm x 1W Resistor
Wire (green and blue colors)
1 x perf board 13x26 holes (3,5 x 7,0 cm)
2 x AK300/3 connector
1 x 8 Header female connector for Arduino
1 x L298N (Multiwatt15)
8 x 1N4001 Diode
2 x 100nF capacitor
2 x 0,47Ohm x 1W Resistor
Wire (green and blue colors)
STEP 2: Schematic
This is the basic schematic. It works perfectly.
A more advanced schematic and board for eagle cad, you can download from the link below.
http://www.4shared.com/file/T17oVW-z/PONTE_H_L298N.html
http://www.4shared.com/file/6VdOTgv5/PONTE_H_L298N.html
A more advanced schematic and board for eagle cad, you can download from the link below.
http://www.4shared.com/file/T17oVW-z/PONTE_H_L298N.html
http://www.4shared.com/file/6VdOTgv5/PONTE_H_L298N.html
STEP 3: 1st Step - Perfboard, Holes Location
Make a Board with 3,5 x 7,0 cm or 13 x 26 holes.
Locate in this board, all holes that we will use for the components.
Locate in this board, all holes that we will use for the components.
STEP 4: 2nd Step - Components
After sanding and cleaning the board, put all components in it according of the diagram above and schematic.
For this, bend components properly.
Do the soldering for each group of components independently, for example:
diodes first and then connectors and then capacitors and resistors and finally the L298N IC; or in what order you want or you are used to do.
For this, bend components properly.
Do the soldering for each group of components independently, for example:
diodes first and then connectors and then capacitors and resistors and finally the L298N IC; or in what order you want or you are used to do.
STEP 5: 3rd Step - Soldering and Wired Tracks
Following the schematic and diagram above, first of all make all soldered tracks in the bottom layer of the board.
After that, solder the jumper wires making the wired tracks.
Note.
Green wires are on the top layer and blue wires are on the bottom layer of the board.
After that, solder the jumper wires making the wired tracks.
Note.
Green wires are on the top layer and blue wires are on the bottom layer of the board.
STEP 6: 4th Step - Video and Tests
This is my first test of the "Dual H-Bridge" homemade, with the IC-L298N in a Breakout Board.
The cart was controlled by bluetooth (using the "Blue Control" application of the Android market).
Each time we hit in the controls (forward or backward) the DC motor run for 1s, in this way, if we hit twice the motors will run for 2s and so on .
For the left and right, each time we hit the control, the motors will run for 500ms. This temporization can be modified in the program below.
See the entire video for more information; ahh sorry for my English I am studying yet...
http://youtu.be/0conwkmiAoM
/*
#####################################################################################
# File: BlueTooth_Bot_R1.pde
# Micro controller: Arduino UNO ou Teensy++ 2.0
# Language: Wiring / C /Processing /Fritzing / Arduino IDE
#
# Objectives: A bluetooth controlled cart
#
# Funcionamento: Just a simple test of the home L298N breakout Board
#
#
# Author: Marcelo Moraes
# Date: 13/02/13
# Place: Sorocaba - SP - Brazil
#
#####################################################################################
This project contains code to the public domain.
The modification is permitted without notice.
*/
// definição de variáveis, constantes e valores
int inA1 = 10; // Pins for the PONTE-H
int inA2 = 11;
int inB1 = 5;
int inB2 = 6;
// Arduino initialization
void setup(){
// Serial communication initialization
Serial.begin(9600);
// at the beginning motors stopped
set_motors(0,0);
}
// loop principal do programa
void loop(){
if (Serial.available() > 0){// if serial data are available
char varC = Serial.read(); // reading the serial port data
if(varC == 'U'){ // move forward
set_motors(80,75);
delay(1000);
set_motors(0,0);
}
if(varC == 'D'){ // move backward
set_motors(-80,-75);
delay(1000);
set_motors(0,0);
}
if(varC == 'C'){ // stopped
set_motors(0,0);
}
if(varC == 'R'){ // turn right
set_motors(80,-80);
delay(500);
set_motors(0,0);
}
if(varC == 'L'){ // turn left
set_motors(-80,80);
delay(500);
set_motors(0,0);
}
}
}
//FIM DA COMPILAÇÃO
// running motors
void set_motors(int left_speed, int right_speed){
if(right_speed >= 0 && left_speed >= 0){
analogWrite(inA1, 0);
analogWrite(inA2, right_speed);
analogWrite(inB1, 0);
analogWrite(inB2, left_speed);
}
if(right_speed >= 0 && left_speed < 0){
left_speed = -left_speed;
analogWrite(inA1, 0);
analogWrite(inA2, right_speed);
analogWrite(inB1, left_speed);
analogWrite(inB2, 0);
}
if(right_speed < 0 && left_speed >= 0){
right_speed = -right_speed;
analogWrite(inA1, right_speed);
analogWrite(inA2, 0);
analogWrite(inB1, 0);
analogWrite(inB2, left_speed);
}
if(right_speed < 0 && left_speed < 0){
right_speed = -right_speed;
left_speed = -left_speed;
analogWrite(inA1, right_speed);
analogWrite(inA2, 0);
analogWrite(inB1, left_speed);
analogWrite(inB2, 0);
}
}
36 Comments
rafiquesarfaraz 3 years ago
What is the voltage of Capacitor ?
RohitK46 6 years ago
RohitK46 6 years ago
mertmkarakas 7 years ago
Hi,
I am having trouble with the arduino connections. I am thinking as:
Input1 = A1 in code
Input2 = A2
Input3 = B1
Input4 = B2
What are the Enable A & B for? In the video, I don't see them connected to a pin? How should I connect it to the Arduino? I couldn't see it in the video
RoMeS_ 7 years ago
Hi Marcelo,
Can you do the same shield with single or dual face PCB?
Or generate fritzing file.
Thanks.
Romildo
SadabM 8 years ago
hello sir is this same as the other modules on web?
AnuragV 8 years ago
Hi,
Are these capacitors mandatory? Power supply already has the needed capacitors right? is there any specific purpose for these two?
Thanks,
- Anurag.
attila.fulop.77 9 years ago
Hi.
If i have a dc motor 24v,do i have to change something or that circuit will work with my motor too?
thanks
gorthan 9 years ago
Hello, I have some resistance from 0.47 ohm 0.5W, ceramic capacitors 104Z LK and 1N4007 diodes. They go well? I need 2A output but I have to connect a single port and the power supply from 7.3 V
Regards
Gorthan :)
RPihacker 9 years ago
Hi BigDog1971 - excellent job with the H-bridge! Impressive presentation, you clearly worked hard to to share your work in a way people can understand and learn from.
My question is do you know of a micro-controller chip that can be added to the H-bridge motor driver board to provide PWM to control the L298N and take commands from a Raspberry Pi B+.
I am trying to build a Raspberry Pi robot from scratch, meaning the chassis and all support circuits, such as a motor control via an H-bridge are build from plans on perf-board instead of purchased.
So far I have been unable to identify a through the hole mirco-controller that can interface with the Raspberry Pi and provide PWM to the L298N.
Do you have any ideas or recommendations?
Thank you.
PaulG3 9 years ago
Strong recommendation for the Cypress Semiconductor PSoC4 processor. It can output PWM using pure hardware and has a 32bit ARM processor on the same chip. The development boards are $4.
BIGDOG1971 9 years ago
I am so sorry but I do not work with RaspBerry Pi and I do not know how to interconnect with arduino uno neither to the Dual H-Bridge.
So I cannot help you in this matter.
Regards
Marcelo
mykiscool 10 years ago
If you aren't doing this for the fun of building, this one is definetely worth buying premade since it is only like $2.00 on ebay if you do a search for lm298n dual h-bridge.
BIGDOG1971 10 years ago
No, I am not doing this for sale, just for fun and to know how it works.
Regards.
ved.alapati 9 years ago
Hi,
Can you please tell me what is the purpose of diodes. I tried using it with
a 1 Amp. DC motor it works fine initially but fails after couple of days.
I was wondering if its to do with diodes. Should I use diodes with higher
Ampere.
Hudaib 9 years ago
i am getting only 0.5 volt on all the output pins.. why its happening? i also changed my l298n to make sure the chip is fine. i am not using the capacitors. any suggestion. thanks in advance
BIGDOG1971 9 years ago
Check the "sense" pins connections, they must be connected to ground directly or via 0.5Ohm x 2W resistor.
The ground must be common for both +5V and +12V power source.
The capacitors are just for DC voltage decoupling.
This kind of issue is so difficult to check this problem remotely.
I hope I have helped you.
Feel free to send me your questions.
Marcelo Moraes
arduinobymyself@gmail.com
NickM2 9 years ago
can u create to me coding to control 2 motor, 1 motor left right and 1 motor forward backward i want use to h-bridge driver pls reply to my email nickmuzill@yahoo.com
ishan553 10 years ago
and can u plz send me the video of how to use them if ur free or plz instruct me because im just 12 years old and what about the other tamiya items
and sorry if i am bothering u
BIGDOG1971 10 years ago
Send me an email requesting the code and libraries.
You are not bothering me. Feel free to send me your questions.
arduinobymself@gmail.com
Cheers!
Marcelo Moraes