DC motor driver shield newbiew help plizz :(

Autonomous Robot, Manual Robot, DC Motor Driver, Stepper Motor Driver, Servo, Multi PWM chip.....

DC motor driver shield newbiew help plizz :(

Postby armienz30 » Mon Mar 25, 2013 11:39 am

the situation:
i am doing project for FYP, a mobile robot using arduino mega 2560 r3 as a microcontroller. i want just it to move forward and backward, and the movement is respond to a switch automatically.
mechanism movement: if it moving forward continously until it trigger the button infront when hitting the wall the mobile robot will stop for a while and backward and vice versa.

my problem is i donno which driver motor and switch should i buy on cytron plus programming code, i have arduino mega 2560. really need help please.
armienz30
Freshie
 
Posts: 6
Joined: Mon Mar 25, 2013 11:18 am

Re: DC motor driver shield newbiew help plizz :(

Postby gadgetng » Tue Mar 26, 2013 9:03 am

armienz30 WROTE:the situation:
i am doing project for FYP, a mobile robot using arduino mega 2560 r3 as a microcontroller. i want just it to move forward and backward, and the movement is respond to a switch automatically.
mechanism movement: if it moving forward continously until it trigger the button infront when hitting the wall the mobile robot will stop for a while and backward and vice versa.

my problem is i donno which driver motor and switch should i buy on cytron plus programming code, i have arduino mega 2560. really need help please.


If you don't know programming.. then no one can help you.
Try search on the Cytron's tutorial for the DC motor, mobile robot and arduino example project.
gadgetng
Discoverer
 
Posts: 97
Joined: Tue Jul 24, 2012 11:20 am

Re: DC motor driver shield newbiew help plizz :(

Postby armienz30 » Thu Mar 28, 2013 9:11 am

thx you for replying me..
i have study alittle bit and follow the tutorial.
but i have problem occur, my new 2A driver motor shield seem not working or have respond to my code. how can i fix this. the 2A driver motor didnt need power source if it supply from aruino using USB cable right?

int E1 = 9;
int M1 = 8;
int E2 = 10;
int M2 = 12;
void setup()
{
pinMode(M1, OUTPUT);
pinMode(M2, OUTPUT);
}
void loop()
{
int value;
for(value = 0 ; value <= 255; value+=5)
{
digitalWrite(M1,HIGH);
digitalWrite(M2, HIGH);
analogWrite(E1, value); //PWM Speed control
analogWrite(E2, value); // PWM Speed control
delay(30);
}
}

above is the code i try to upload to arduino and the shield didnt respon.. can someone help?
Attachments
shield copy.jpg
armienz30
Freshie
 
Posts: 6
Joined: Mon Mar 25, 2013 11:18 am

Re: DC motor driver shield newbiew help plizz :(

Postby shahrul » Thu Mar 28, 2013 9:42 am

What motor driver you use? Make sure use the right pin and right jumper setting.
Then the power can't use USB, must use external power to drive motor. If hardware correct, then motor should running.
Anyway I use Cytron Motor Driver Shield, no problem.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: DC motor driver shield newbiew help plizz :(

Postby yonghui » Thu Mar 28, 2013 10:22 am

agree with what sharul said. u need external power for the motor. usb cant provide motor's power.
i am not so sure if there is selector jumper on the shield to select internal motor power from the vin. u will need to plug 12V to the arduino main board power jack in this case.
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: DC motor driver shield newbiew help plizz :(

Postby armienz30 » Thu Mar 28, 2013 10:37 am

thx for help me, iam using 2Amp motor driver shield, i bought from cytron, i afraid the motor driver is not functioning. i have try and use 1.5V x 4 battery to supply the motor shield. but from the admin i bought say it can be power up if attach to arduino board. and the jumper i have check it correctly. the jumper is near the red female pin near the power source for arduino board. iam new for this arduino hardware. it seem the motor didt power up and not move my single small dc motor.
armienz30
Freshie
 
Posts: 6
Joined: Mon Mar 25, 2013 11:18 am

Re: DC motor driver shield newbiew help plizz :(

Postby joliza » Thu Mar 28, 2013 3:50 pm

The problem is at your PWM pin control.
int E1 = 9;
int M1 = 8;
int E2 = 10;
int M2 = 12;

On your DC motor driver shield, PWM pin used is E1=5, M1=4, E2=6, M2=7. Try to change your PWM control and reload the code.
joliza
Novice
 
Posts: 22
Joined: Mon Jun 22, 2009 10:56 am

Re: DC motor driver shield newbiew help plizz :(

Postby armienz30 » Sat Mar 30, 2013 8:47 am

joliza WROTE:The problem is at your PWM pin control.
int E1 = 9;
int M1 = 8;
int E2 = 10;
int M2 = 12;

On your DC motor driver shield, PWM pin used is E1=5, M1=4, E2=6, M2=7. Try to change your PWM control and reload the code.


thx joliza it working i change it to 5,6,7 and 8 tqvm.. appreciate your advice :D
armienz30
Freshie
 
Posts: 6
Joined: Mon Mar 25, 2013 11:18 am

Re: DC motor driver shield newbiew help plizz :(

Postby armienz30 » Thu Apr 18, 2013 8:04 pm

can any one help me how to build program code for below picture.

iam try to change the motor rotation when the pushbutton is push once. the push button is act as like a sensor.
and the detail for the pushbutton is it on when is push and release it will off. the condition is only push the button once and not hold it. plizz cannot find any solution.


iam understand that if want to change direction of motor direction just change high or low on digitalwrite.
my problem is how to write/ give instruction to arduino mega.

the initial program

int E1 = 5;
int M1 = 4;
int E2 = 6;
int M2 = 7;
void setup()
{
pinMode(M1, OUTPUT);
pinMode(M2, OUTPUT);
}
void loop()
{
int value;
for(value = 0 ; value <= 255; value+=5)
{
digitalWrite(M1,LOW);
digitalWrite(M2, HIGH);
analogWrite(E1, 255); //PWM Speed control
analogWrite(E2, 255); // PWM Speed control
delay(30);
}
}


the above run normally, credited to jollax
Attachments
push.jpg
armienz30
Freshie
 
Posts: 6
Joined: Mon Mar 25, 2013 11:18 am

Re: DC motor driver shield newbiew help plizz :(

Postby armienz30 » Fri May 03, 2013 11:28 am

armienz30 WROTE:can any one help me how to build program code for below picture.

iam try to change the motor rotation when the pushbutton is push once. the push button is act as like a sensor.
and the detail for the pushbutton is it on when is push and release it will off. the condition is only push the button once and not hold it. plizz cannot find any solution.


iam understand that if want to change direction of motor direction just change high or low on digitalwrite.
my problem is how to write/ give instruction to arduino mega.

the initial program

int E1 = 5;
int M1 = 4;
int E2 = 6;
int M2 = 7;
void setup()
{
pinMode(M1, OUTPUT);
pinMode(M2, OUTPUT);
}
void loop()
{
int value;
for(value = 0 ; value <= 255; value+=5)
{
digitalWrite(M1,LOW);
digitalWrite(M2, HIGH);
analogWrite(E1, 255); //PWM Speed control
analogWrite(E2, 255); // PWM Speed control
delay(30);
}
}


the above run normally, credited to jollax

i have solve the problem.. i just using swap command later i post it
armienz30
Freshie
 
Posts: 6
Joined: Mon Mar 25, 2013 11:18 am


Return to Robot Controller

Who is online

Users browsing this forum: No registered users and 4 guests

cron