Shop OBEX P1 Docs P2 Docs Learn Events
line following robot with arduino big problems — Parallax Forums

line following robot with arduino big problems

JujuliaJujulia Posts: 2
edited 2011-01-06 18:40 in Robotics
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
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

  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-05 20:35
    This is a support forum for Parallax products. You're using some QTI sensors from Parallax, but everything else (including the microcontroller) is made by someone else. We can help you with questions about the QTI sensors, but really cannot help you with the programming or the hardware other than the QTI sensors. Sorry.

    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).
  • JujuliaJujulia Posts: 2
    edited 2011-01-06 12:42
    Mike Green wrote: »
    This is a support forum for Parallax products. You're using some QTI sensors from Parallax, but everything else (including the microcontroller) is made by someone else. We can help you with questions about the QTI sensors, but really cannot help you with the programming or the hardware other than the QTI sensors. Sorry.
    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-06 13:08
  • Martin_HMartin_H Posts: 4,051
    edited 2011-01-06 18:40
    Also, if you have specific questions about programming the Arduino, there's a forum (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl) that can help you. The QTI sensor is fairly close electrically to other line sensors that are popular with the Arduino crowd. So you might be able to get a pointer to code to compare yours to.
Sign In or Register to comment.