I just finished and tested my first non-breadboard circuit. I know it's not pretty but you have to cut me some slack... I've only owned an Arduino for a little over a week and I've only been soldering for a week as well so I'm an extreme noob to electronics! ;D
Basically my first project is going to be a little tank that can navigate a room using an ultrasonic sensor.. nothing crazy but something to get my feet wet. I picked up a small, two motor set of Tamiya tank tracks to use for my base and I needed something to control the motors. I didn't want to buy a motor controller since I'm trying to learn as much as I can, so I made my own. I prototyped it up on my breadboard and once I tested it I decided to move it onto a circuit board since I need my breadboard to test other circuits.
Hopefully it doesn't catch fire once I start using it regularly ;D
You should be aware though that the H bridge you used only outs 1A per motor, so you might not be getting all the power from the motors (they might be built for 3A, or something)... just something to keep in mind if you see that the motors move slower than you hoped.
Why don't you tell the other track to either move a little forward, thus increasing the turning radius, or have it move a little in reverse, thus shortening the turning radius - both of these would allow for faster turning.
That's a good idea, I never thought of that. I'll just apply a small throttle to the "non-turning" track so the turning motor doesn't have to work so hard. Thanks for the suggestion!
I got confident and added a spot to hookup a servo on my board (full size image: http://i33.tinypic.com/29ay9fp.jpg). I can control the servo just fine when the motors aren't engaged, but if I engage the motors my servo goes hard left and stays there. Can you see anything obvious?
Row 5 on my board is power from a 6V battery pack btw.
You say it goes full left on its own? Double check the code, maybe there is some strange interference there. If not, make sure you wired the servo correctly. If not, you may be lacking the power to run the servo (makes sense, since it doesn't work when the motors are operating).
Code seems ok from what I can tell. Power could be an issue. I'm going to try only running one motor at a time and see if the servo still does the same hard left. Now that I think of it, I'm running two 1.5V motors and (what I assume) a 5V servo off of a 6V power supply.
Actually, now that I think about it, power shouldn't be an issue as I don't ever plan on running the servo at the same time as the DC motors. If the servo would just stay put instead of pulling left when the motors run, I'd be fine.
I've been doing some investigating and noticed something and I'm not sure why it's happening or if it's related to my problem.
On my L293 (http://focus.ti.com/lit/ds/symlink/l293d.pdf) I have my external power supply running to pin 8 and the arduino 5V running to pin 16. When the Arduino is powered on and the external battery pack isn't, pin 8 is putting out 1.9V ... is that normal?
Sorry to be posting so much but I'm trying to figure this out :-[
I just did a controlled test. I made my sketch do the following:
set servo to position 78 (just so happens to the position I want it aimed in)
then loop:
enable motor one at 1/2 power
delay for 3 seconds
turn motor one off
As expected, when the motor turns on the servo get's jumpy and heads hard left. When the motor turns off the servo returns to the proper position. Using a multimeter on the servo's signal wire I see that the voltage when the motor is off is a solid 0.34V yet when the motor engages it drops to 0.33V.
I also tried the same test with the motor running full power and I see the same 0.01V drop on the servo signal pin. Does this point to anything obvious?