line following robot with arduino big problems
hello guys,
After countless hours of research without any helping advice
i hope you can help me out.
I'm building a line following robot with these components:
Arduino duemillanove
2 motors (3V)
http://bit.ly/dOeOXN
4 QTI sensoren von parallax (5V)
bit.ly/fyMSTQ
the sensors are positioned in a semicircle
this is the robo:
http://bit.ly/hfqmmp
wiring:
http://img827.imageshack.us/g/bildschir ... 0106u.png/
My code should be right, but the motors are not working properly.
In fact they are reacting to the black line, but they run way too fast
and sometimes take time till the start moving, so i couldnt even build
a proper test-parcour yet...
I believe that the mistake i made is that i didnt use a h-bridge-
is it possible to run them properly without a h- bridge? i already soldered all parts![icon_sad.gif](http://forums.adafruit.com/images/smilies/icon_sad.gif)
and maybe i got the wrong motors? should i use servos instead?
in our class we learned to run motors with a transistor and a "diode"...
or maybe i got the code wrong...
hope you can help me out, iam already pretty desperate...
thank you,
julia
[code]const int motor1Pin = 9; //
const int motor2Pin = 11; //
int sensorPin2 = 2; //sensor 1
int sensorPin3 = 3; //sensor 2
int sensorPin4 = 4; //sensor 3
int sensorPin5 = 5; //sensor 4 // 220 or 1k resistor connected to this pin
int sDigi2=0; //digitale Werte f
After countless hours of research without any helping advice
i hope you can help me out.
I'm building a line following robot with these components:
Arduino duemillanove
2 motors (3V)
http://bit.ly/dOeOXN
4 QTI sensoren von parallax (5V)
bit.ly/fyMSTQ
the sensors are positioned in a semicircle
this is the robo:
http://bit.ly/hfqmmp
wiring:
http://img827.imageshack.us/g/bildschir ... 0106u.png/
My code should be right, but the motors are not working properly.
In fact they are reacting to the black line, but they run way too fast
and sometimes take time till the start moving, so i couldnt even build
a proper test-parcour yet...
I believe that the mistake i made is that i didnt use a h-bridge-
is it possible to run them properly without a h- bridge? i already soldered all parts
![icon_sad.gif](http://forums.adafruit.com/images/smilies/icon_sad.gif)
and maybe i got the wrong motors? should i use servos instead?
in our class we learned to run motors with a transistor and a "diode"...
or maybe i got the code wrong...
hope you can help me out, iam already pretty desperate...
thank you,
julia
[code]const int motor1Pin = 9; //
const int motor2Pin = 11; //
int sensorPin2 = 2; //sensor 1
int sensorPin3 = 3; //sensor 2
int sensorPin4 = 4; //sensor 3
int sensorPin5 = 5; //sensor 4 // 220 or 1k resistor connected to this pin
int sDigi2=0; //digitale Werte f
Comments
You do need some kind of motor driver. An H-bridge allows you to reverse the motors. If they just need to go forwards, you can use a transistor and diode (and a resistor or two), but you need something to control the amount of current needed. A microcontroller I/O pin can't handle the motor's current requirements. You can use servo motors (modified for continuous movement) like those used in Parallax's BoeBot. Your 3V motors are what are called DC motors.
Nuts and Volts Column #6 discusses high current drivers for microcontrollers. It's written for Parallax's Stamps, but the same thing applies to the Arduino (see here).
Hi mike,
ok i understand that, but the parallax sensors can be used for different microcontrollers and are the main component of this robo. I didn't order the Boe Bot because we have to build it our own.
What can i do so that the microcontroller can handle the motors current requirements without using servos? I have already soldered all parts so i would prefer using the dc motors if possible.
thanks for the link, i will take a look at it.
http://www.instructables.com/id/How-to-make-an-H-bridge/
http://www.cwhaticando.com/view/?t=Build%20the%20L298%20H-Bridge%20Motor%20Control%20&itemParent=118
http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/603-00019-L293D-Datasheet.pdf
http://en.wikipedia.org/wiki/H-bridge
Here's a link for an Arduino "Power Shield" with MOSFET high current drivers.
http://www.sparkfun.com/products/10305