Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited

L298n Motor Driver

I ordered this before my stroke and now I can't remember how to wire it up? I attac hed pics and diagram. Any help would be greetly appreciated.
Lloyd
User-inserted image


User-inserted image


User-inserted image


User-inserted image

AI Support Bot
Related Content
Synthiam
PRO
Synthiam
#1  
Hey Lloyd!

Good to see you remembered how to upload photos!:) You're almost back to your old self! Just like riding a bike!

I drew a diagram for you. And in summary, this is how it works...

1) Connect L298 VCC to your battery supply positive
2) Connect L298 GND to your battery supply negative
3) Connect L298 +5 to a +5 pin on the EZ-B (in the diagram I used +5 from Pin D0)
4) Connect L298 IN1 to EZ-B Pin D1
5) Connect L298 IN2 to EZ-B Pin D2
6) Connect L298 IN3 to EZ-B Pin D3
7) Connect L298 IN4 to EZ-B Pin D4
8) Connect L298 OUT1 to Motor 1
9) Connect L298 OUT2 to Motor 2

User-inserted image


In ARC, use the HBridge Motor Control. Press the Config button and select the pins that you connected the L298's INPUT Pins too (example D1, D2, D3, D4).

If the directions are reversed, simply go back into the CONFIG menu of the HBridge Control and change the configuration around to D4, D3, D2, D1. You may need to try a few combinations to get it right. Sometimes it confuses me too!

PS, the only reason i didn't begin the connections of the L298 INPUTS to the EZ-B at port D0 in the diagram was because there wasn't much room when drawing it:) haha
#2  
Thank you for your help DJ. I'm a long ways from being back to myold self. I know its going to be a long road back. I know , I recovered from my first one so I know it can be done. I'm determined to overcome. You once said you would lik my story so in the near time I will write it all down for you.
I have a friend that has offered to give some of his time to hep me with my robot progects. Thanks again for answerrig my call for help.
Lloyd
PRO
Synthiam
#3  
I'd very much like your story - you are a great inspiration to many people, driven by your determination to never give up. Your passion for Robotics is admirable and I think your story should be shared. How many other people are building their own robot arm or robot wheelchair or robot assisting device? Just you man!:)
#4  
Much thanks to you DJ. I've always been a very determined individual. You will seee in my story some of the things I have had to over com in my life. It would please me so very much if I could enspire anyone, in any way. One of my tennents in life has been .............. as I age I never want to find myself saying "I wish I would have............"
If I find I have difficulty doing something, I just find a new or different way to do it! If that meens I have to build a device to enable me then thats what I attempt to do. Enough of that for now. I have another questiion about the L298N driver. The driver still doesnt allow for controlling motor speed. Could I put linear taper pots in between the motor outputs and the motor itslef? Motor power will be from 12 volt, 9 aMh battery. What value would I use for this? 5K, 10K, or what? Would this work at all?
Thanks again,
PRO
Synthiam
#5  
To control the motor speed, you can use the new PWM control in ARC (if you have the latest version).

Connect the one pin from the PWM of the EZ-B to the ENABLE pins of the HBridge. To figure out what pins to connect on the HBridge, first pull the jumpers off. Then probe with a volt meter to see what pin does NOT have voltage. Do not connect the EZ-B to the pins with +5. Instead, connect the EZ-B PWM to the two pins that do not have +5.

The one PWM will control both enable pins of the HBridge
#6  
@DJ - is this the same motor controller you are now offering? And it takes 4 DO ports to operate? Does the one you sell also take 4 ports function?
#7  
Thank you for your help DJ. Much appreciated.
@ bret.tallent: This is not the motor controller that DJ is selling, that only takes one connection to the EZ B.
Ecuador
#8  
@Dj thanks! mm!... How many volts and amps should be the energy source? Would it work with a 9 volt 2 amp?
:)
#9  
DJ,
"PWM of the EZ-B" is it simply any digital port???
#10  
@ Bookmaker ,

I would never speak for DJ..but I am very sure the answer is....'YES'. All the digital port signal pins can provide PWM.

Question I have is how you control PWM control in an EZ script...do I use servo(DX,XX)?

Also, will VB script work in next ARC version?

v/r

Kevin
#11  
@Robotz012248 - I just hooked up my motor controller (just like your but the layout is a little different) and it works brilliantly. I did find a couple of tricks that may help you. I soldered a female plug to the end of two servo cables. One end I plugged onto the motor controller and the other end plugged onto the EZ-B. The way I plugged it onto the board I only used two servo cables and two extra female ends. See Pics.
User-inserted image


User-inserted image


User-inserted image
#12  
@bret.tallent: I see what you did, however...........I'm a bit confused on the PWM that DJ added. I need more info on it. DJ told me to prob for the pins that DO NOT have +5 volts on them. On my controller I have 4 pins that are marked: ENA - 5v - 5v - ENB. these pins have a jumper on them from the factory.
I'm thinking these are the "ENABLE PINS" Does that sound right? So the PWM would be connected to the enable pins????????
The other question. It looks like you attached only the (red) 5 volt pin on the three terminal screws that are motor voltage ( ie. VCC - Gnd - 5v ) Wouldn't the battery power leads (12 volts in my case) got to VCC, which would be positive, and battery ground to the GND terminal?
#13  
Yeah, I am unsure of the PWM pin he was referring to. I did not use that as I am only driving a small omnibot with this and his speed is acceptable as is. The PWM is only for changing the speed in this instance and I don't need that. And yes, good eye. I hadn't connected the power or motor wires yet as I did not want to convolute the image too much. I just wanted to show how I wired it to the EZ-B.

So that single red wire from the EZ-B powers the circuitry in the board, and thr connections from the battery power the motors. This is a pretty good set up but it takes 5 ports to run your motors. Not bad if you don't have too much other stuff, or are using more than one EZ-B.
#14  
Thanks for clearing it up for me.. Actually, I would have missed the 5 volts from the EZ B to the driver. You saved me on that one! Thank you bret. I guess I'll have to try to get DJ's attention on this and the PWM.
#15  
Actually DJ sent me a wirng diagram that showeed the 5v pin.
#16  
I received my motor controller from Dj and hooked it all up. The robot turns great but i cannot seem to get it to run forwards or backwards. When I select forward or backward, I can hear the motors engage on the gear for a split second then it will stop providing power to the motor. I am wondering if any one has run into a similar situation.

When setting up the controller I had to configure the ports so that it would turn in the correct directions. Before I had configured the ports to turn the correct direction, the robot was able to move in all 4 directions. but the directions were incorrect. ie left was forward, forward was turning right, backwards was right, and right was backwards. I wouldn't have a problem with it but it effects the radar control while the robot is moving.

I can also configure the ports so the the robot will go forwards and backwards correctly but not be able to turn.

I have double checked all my connections and am not seeing any loose wires, or wires plugged into an incorrect port on the board.

thank you for the help!

Aaron
#17  
@robot56 - I had to play around with mine for a while before I got them functioning the way I wanted. This included changing ports around, and which motor wires hook up to which connector. Are you working on an omnibot? When I get home I can give you the low-down on how mine is wired and how it is set up in ARC if that will help?
#18  
That would be a big help! I too am working on an omnibot. Looking at the pictures of of yours has been a huge inspiration to get mine done

Thank you so much
#20  
It is a 2.5 amp motor controller that Dj had on the website for a week or so. I think it was on backorder after the first few days of being posted on the website! It's the same one that Dj posted the wiring schematic for on the first page. Robotshop.com has a very similar one for around $20