I hope i'm posting this question in the right section. I wasn't sure if this belonged in the MOTORS section or the INTERFACING section, but i'm going to go ahead here.

I'm building an autonomous rover (i know, how creative!). My electronics knowledge is quite poor, so i'm almost certain the problem is with my wiring. I'm just hoping i haven't blown something up.

I'm using this motor driver/controller circuit:http://www.ebay.com/itm/200659789109?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649

To power these motors:http://www.ebay.com/itm/4WD-Robot-Smart-Car-Chassis-Kits-car-with-Speed-Encoder-DC-3v-5V-6V-for-Arduino-/171122633517?pt=LH_DefaultDomain_0&hash=item27d7b42b2d

I've got 471pF ceramic caps across the leads of each DC motor. I was advised to do this to reduce the jerky-motion of the motors. (How accurate was this advice?)

and an Arduino UNO R3.

I realised that the motor controller that i had purchased only supported upto 2 DC motors, so i connected the two LEFT motors in parallel and the same on the RIGHT. I ran the two leads of each motor setup into the MOTORA and MOTORB inputs of the motor controller.

I decided to power the motor controller circuit (VMS) with a 9V battery and the GND to the -ve obviously. The 5V in was left empty. The ENA and ENB are connected to the PWMs of the Arduino Uno and the IN1,IN2,IN3,IN4 are connected to DIGITAL pins of the Arduino.

On the Arduino-end, i've got a 9V battery with a 2.1mm plug to supply power, and i created a common ground between the Arduino and the Motor Controller by connecting the GND pin on the Arduino to the GND of the Motor Controller on a mini breadboard (Am i doing this right?).

And i'm using the 5V from the arduino to power the Servo and the Ping(ultrasonic) sensor, with both their ground wires connected to the common ground at the breadboard.

I tried to run a small test code to see if the motors are working, but they don't seem to be:

1. You spent to much. http://www.electrodragon.com/?product=l298n-stepper-motor-driver-controller-board-for-arduino

2. The product you bought does not have a data sheet that I could find

Anyway try connecting 5v to the 5v pin on the motor driver. See if that helps. Also I don't see any PWM in your code. From my experience the PWM will control the speed. Try disconnecting the motors and just test with a multimeter after you make the changes and see how different PWM values affect the voltage.

1) As already noted, you need to connect the 5 volt line on the L298 driver - the driver has both logic voltage (5 volts) and motor voltage inputs that are separate.

2) You mentioned hooking up 9 volts to the (motor?) input on the L298? If you are using one of those small 9 volt batteries for this (PPA3), you won't get very far; those will not be up to the task. If you must use a 9 volt battery, go with a 9.6 volt NiMH R/C pack or similar.

Hmm - something I noticed on that board, in regards to #1 above - it looks like it has a built-in method to supply a regulated 5V to the L298 (there is a jumper labeled "5V_EN") - but it is unclear whether that needs to be bridged to enable the on-board 5 volts, or unbridged (without a schematic - who knows). You might try contacting the seller for a schematic to figure it out. Or, trace it out yourself. Another possibility would be to hook up your 9V source to the board (disconnect it completely from the Arduino), then use your multimeter to measure the voltage at the 5 volt logic input voltage pin on the L298; if you don't measure 5 volts, hook up the jumper ton the "5V_EN" pin - you should have 5V then.

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

1) As already noted, you need to connect the 5 volt line on the L298 driver - the driver has both logic voltage (5 volts) and motor voltage inputs that are separate.

2) You mentioned hooking up 9 volts to the (motor?) input on the L298? If you are using one of those small 9 volt batteries for this (PPA3), you won't get very far; those will not be up to the task. If you must use a 9 volt battery, go with a 9.6 volt NiMH R/C pack or similar.

Hmm - something I noticed on that board, in regards to #1 above - it looks like it has a built-in method to supply a regulated 5V to the L298 (there is a jumper labeled "5V_EN") - but it is unclear whether that needs to be bridged to enable the on-board 5 volts, or unbridged (without a schematic - who knows). You might try contacting the seller for a schematic to figure it out. Or, trace it out yourself. Another possibility would be to hook up your 9V source to the board (disconnect it completely from the Arduino), then use your multimeter to measure the voltage at the 5 volt logic input voltage pin on the L298; if you don't measure 5 volts, hook up the jumper ton the "5V_EN" pin - you should have 5V then.

The motors are receiving more power (about 1V) , but still not enough to move. They start to rotate slowly if i give them a push, so i'm starting to believe it's a power issue. But i assumed the 9V battery would be enough to power them (I'm using two of these - one to power the arduino and one to power the motors via the motor controller [vms] : http://3d4me.files.wordpress.com/2009/02/9v-battery.jpg).

This is what i was told regarding the 5V_EN:

Quote

The 5V_EN jumper enables the onboard 5V regulator. If EnA and|or EnB are left floating it will enable bridge A and|or B. To disable, EnA and|or EnB should be put to 0v. The CSA and CSB are current sense pins and are used to sense the motor current. So if you're not using current sense, leave them jumpered to the ground

As of now, the 5V_EN and all the CSA/CSB/U1/U2/U3/U4 are jumpered to the ground.

A 298 chip loses a minimum of 2v between input and output (1.8 in fact), and if you look at the datasheet (2nd last line on page 3) you'll see that can rise to almost 5v under high current. With your motors doubled up, you could be drawing quite a high current and be incurring quite a voltage drop. That wouldn't explain the drop right down to 1v though, but as pointed out those 9v batteries are not renowned for their longevity.

Thanks guys! I finally managed to get the wheels moving - all i needed was more current. I added a 4 AA Duracells in parallel with the 9V and it's working fine. I'm going to try pick up a 11-12V LiPO if i can get my hands on one. It's almost impossible to find one locally.

Here's a video of the little monster moving back and forth:http://youtu.be/3n3RRiuhwts

I don't think putting 6v in parallel with 9v is the right way to go, but I'm not sure why , and I'm sure someone will explain. That said, glad you've made progress.

Just check though, that you don't provide too much voltage to the motor simply because you get hold of a nice big battery. Check the motors' datasheet for maximum allowed: yes the 298 will chomp volts, but make sure it's not too high. Under no load conditions remember it's only losing about 2v.

I don't think putting 6v in parallel with 9v is the right way to go, but I'm not sure why , and I'm sure someone will explain. That said, glad you've made progress.

Just check though, that you don't provide too much voltage to the motor simply because you get hold of a nice big battery. Check the motors' datasheet for maximum allowed: yes the 298 will chomp volts, but make sure it's not too high. Under no load conditions remember it's only losing about 2v.

I did realise that connecting the 6V in parallel with 9V might damage the 6V because the 9V might drive current into the 6V pack. What i'll do is get hold of two better quality 9Vs and run them in parallel. I don't think that would pose any problems right?

Thanks for the tip, i'll make sure i pick a battery that suits the motors!

I did realise that connecting the 6V in parallel with 9V might damage the 6V because the 9V might drive current into the 6V pack. What i'll do is get hold of two better quality 9Vs and run them in parallel. I don't think that would pose any problems right?

Connecting batteries in parallel is not wise. If 6V is enough to turn the motors, why not run the whole thing from 6V? Alternatively, use a bank of 6 AA cells to get 9V, and use this instead of your 9V battery.

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

I did realise that connecting the 6V in parallel with 9V might damage the 6V because the 9V might drive current into the 6V pack. What i'll do is get hold of two better quality 9Vs and run them in parallel. I don't think that would pose any problems right?

Connecting batteries in parallel is not wise. If 6V is enough to turn the motors, why not run the whole thing from 6V? Alternatively, use a bank of 6 AA cells to get 9V, and use this instead of your 9V battery.

Thanks for the heads up, i had no idea connecting voltage sources in parallel was such a bad idea.

Might I suggest this set-up, which is driving a bot similar to the one above.

I have 2 x ~300mA motors, I'm using just a L298N IC with a 5v Low Drop out regulator.I'm using 4 x NiZn 2500wAh 1.6v AA size so total volts is 6.4v

6.4v attached to voltage regulator goes down to 5v to power the logic on the L298N and there is another connection on the L298N, which gets the battery voltage which supplies the high current to the motors.The Arduino is powered by a 7.4v 1600mAh RC NiMH pack.

Using PWM on the EN-Pins is not working very good.The Motors will not only drive slower ( like they should ) but they also get significantly weaker.This behaviour makes it difficult to calculate curve radiusses. It is more like: trial and error.It gets impossible on rough ground.I've had better results with switching off one side for a short time instead of using a higher frequency PWM Signal.

I haven't tried the pwm library yet, but the original analogWrite doesn't work well.

It's not my fault when my Posts are full of Errors. This stupid autocorrection from my browser is set up for german grammar.

Hi All, My last couple of bots have been driven by 6x AA Nimh giving me 7.2V, this is used to drive the motors, then when connected to the Adruino Vin, gets converted to 5V to power it.

I have also used the L293 & L298 but as pointed out they do lose power, and drop a couple of volts across the output transistors. I found using PWM on the Enable pins, gave poor results with anything less then about 70, depens on motors I'm sure. My current build uses a Pololu driver module that uses the TI DRV8833 this uses FETs so, very little power is wasted, if any, and it's only about 1"x.07"..Here's a link: http://www.hobbytronics.co.uk/motor-control/drv8833-motor-driver

Hope it helps.RegardsMel.

Open your mind! But not too far, your brains might fall out.Also like Photography, model building and my 300+ Cacti and Succs.