help with h-bridge dc motor

hello,

for my project i want to control the direction of a small dc motor, that runs best with 3 volts. Because I read that the amperage can burn your arduino I am using an external power source supplying max 2 amperes and 3 volts (can also switch to 5). I have the same thing with another h-bridge, which isnt exactly the same but should do the same. the not working h-bridge is an L293DNE. below is the way i connected it. the code im using to test is analogWrite(10,255) analogWrite(11,0); . Very basic, just to try. grounds and supllies are properly connected. sorry for my poor english and graphic skills.

Thanks!

hbridge.jpg

update:
tried with the exact same h bridge that worked on the other one, still nothing. is it at current/voltage problem?
I have no idea what it can be. putting the power directly on the motor makes it go

Can you post your actual sketch, and a drawing or picture showing details of how everything is connected, including the power supplies?

Make sure your enable pin(1 on the chip) is HIGH or 5V, and your Vin (pin 7) is also 5V. Now looking at your code, you have analogWrite(10,255) analogWrite(11,0);

I have had simular issues in the past, and I found out that they both can't be analog signals. Try this.

analogWrite(10,255) digitalWrite(11,LOW); // forward

analogWrite(11,255) digitalWrite(10,LOW);// reverse

Added: You can also just have analogWrite(10,255) for forward and analogWrite(11,255) for reverse with Pull down resistors, this way you just need to call one of those function without needing both.

Now if this still does not work, then check your wiring.

HazardsMind:
I have had simular issues in the past, and I found out that they both can't be analog signals.

Given that the values written are 255 and 0, you might just as well call digitalWrite instead. However, I don't see why analog writes wouldn't work just the same - what problems are you referring to?

Well I found out that when I used this same setup, (different PWM pins 6 & 9) analogWrite(10,255) analogWrite(11,0); My motor would not run. It wasn't until I changed analogWrite(11,0); to digitalWrite(11,LOW); and then it finally ran the motor. Same output pin, different function.

Maybe that is his issue too.

HazardsMind:
Well I found out that when I used this same setup, (different PWM pins 6 & 9) analogWrite(10,255) analogWrite(11,0); My motor would not run. It wasn't until I changed analogWrite(11,0); to digitalWrite(11,LOW); and then it finally ran the motor. Same output pin, different function.

Maybe that is his issue too.

I don't understand why that would be. The implementation of analogWrite includes this logic:

	if (val == 0)
	{
		digitalWrite(pin, LOW);
	}
	else if (val == 255)
	{
		digitalWrite(pin, HIGH);
	}
	else
	{
	... on to setting hardware timers etc

I know, thats what was driving me nuts. I even tested it a few times and every time I used analogWrite(9,0) it would not work. However that was back in version 0019, so maybe there was a bug then. I haven't tried it with 1.0.4, but as you said, and as it is written, it should work.