Putting robotics at your service™

Free shipping on orders over $200

Cytron MD10C not working with arduino uno WHY?

Print view Share :
Previous topicNext topic

Page 1 of 1 [ 11 posts ]

New ( offline )
Posts: 4
Posted: 2012-04-24 18:01 
The problem is fix bad connection

I have a Cytron MD10C that is connected to a 12v dc motor and I would like to control the speed and direction of the motor with a arduino uno.

Connection:
The 12 volts battery is connected to the terminal ( + & - ) and the motor is connected to the terminal ( A & B ) on the MD10C.

The (Vin) is connected to the 12 volts battery for supplying the MD10C board.
The (DIR) is connected on pin 8 on the arduino uno. (DIR = direction of the motor)
The (PWM) is connected on pin 9 who is a (pwm).
The (GND) is connected on the ground on the arduino uno.
On the board there is two buttons A & B. When A is activate the motor will turn in one direction and when B is activate the motor turn's in the other direction. So the MD10C is working correctly.

SEE THE attachment.

The problem:
When everything is connected I’m sending a (1-HIGH or 0-LOW) to pin 8 for direction and a value between 0 and 255 to pin 9 for speed. Nothing work's included the led for direction A or B but the led for power is working. I tested the wires between the MD10C and arduino uno for continuity and everything look Ok.

Code on the back of MD10C board:

PWM DIR Motor A Motor B
1 x LOW LOW
1 0 HIGH LOW
1 1 LOW HIGH

Arduino uno code:

This code is just for testing the MD10C and arduino uno to run the motor.

Code:
int pinPwm = 9;
int pinRotation = 8;

void setup(){
Serial.begin(9600);
pinMode(pinPwm,OUTPUT);
pinMode(pinRotation,OUTPUT);
}

void loop(){
digitalWrite(pinRotation,HIGH);             // turn in one direction
analogWrite(pinPwm,200);
delay(2000);
digitalWrite(pinPwm,LOW);                    // stop motor
delay(1000);
digitalWrite(pinRotation,LOW);           // turn in other direction
analogWrite(pinPwm,100);
delay(2000);
}


I also try this code for the (loop())

Code:
void loop(){
digitalWrite(pinPwm,HIGH);                   // <<<<<<<
digitalWrite(pinRotation,HIGH);             // turn in one direction
analogWrite(pinPwm,200);
delay(2000);
digitalWrite(pinPwm,LOW);                    // stop motor
delay(1000);
digitalWrite(pinPwm,HIGH);                  //<<<<<<<<
digitalWrite(pinRotation,LOW);           // turn in other direction
analogWrite(pinPwm,100);
delay(2000);
}

If you have any suggestions why the MD10C is not working please let me know.
If you also have a Arduino code for running the motor with the MD10C.
Thanks again for your help.


User avatar
Expert ( offline )
Posts: 791
Posted: 2012-04-25 11:32 
Your code and connections look OK.

What if your try not to mix digital and analogue writes on the same pins?

Is this working?

Code:
void loop(){
digitalWrite(pinRotation,HIGH);             // turn in one direction
digitalWrite(pinPwm,HIGH);
delay(2000);
digitalWrite(pinPwm,LOW);                    // stop motor
delay(1000);
digitalWrite(pinRotation,LOW);           // turn in other direction
digitalWrite(pinPwm,HIGH);
delay(2000);
}


Also, is the logic side operating at 12V or at 5V. If it is operating at 12V then it will not detect the Arduino 5V HIGH signal.

_________________
Carlos Asmat
Lynxmotion

Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


New ( offline )
Posts: 4
Posted: 2012-04-26 16:14 
Quote:
Your code and connections look OK.

What if your try not to mix digital and analogue writes on the same pins?

Is this working?

Code:
void loop(){
digitalWrite(pinRotation,HIGH);             // turn in one direction
digitalWrite(pinPwm,HIGH);
delay(2000);
digitalWrite(pinPwm,LOW);                    // stop motor
delay(1000);
digitalWrite(pinRotation,LOW);           // turn in other direction
digitalWrite(pinPwm,HIGH);
delay(2000);
}


Also, is the logic side operating at 12V or at 5V. If it is operating at 12V then it will not detect the Arduino 5V HIGH signal.


Hi, try the code above but the problem is the same, no the logic side is not 12 volt.

Please need help


User avatar
Expert ( offline )
Posts: 791
Posted: 2012-04-26 18:04 
Quote:
On the board there is two buttons A & B. When A is activate the motor will turn in one direction and when B is activate the motor turn's in the other direction. So the MD10C is working correctly.


How did you test this?

_________________
Carlos Asmat
Lynxmotion

Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


New ( offline )
Posts: 4
Posted: 2012-04-26 19:44 
[quote]

Yes, i did,

I'm looking on the net but so far nothing. Thanks for try to help me.

If you ever think of something please let me know. I'm going to look around.


New ( offline )
Posts: 4
Posted: 2012-04-27 12:04 
To test the Cytron Md10C you don't have to connect to the arduino uno. I did this.

The 12 volts battery is connected to the terminal ( + & - ) and the motor is connected to the terminal ( A & B ) on the MD10C.

The (Vin) is connected to the 12 volts battery for supplying the MD10C board. I also try the power from the motor side to power the MD10C board by changing the a jumper on the board from (Vin) to PWR. Both method work.

The (GND) is connected on the ground on the arduino uno

On the board there is two buttons A & B. When A is activate the motor will turn in one direction and when B is activate the motor turn's in the other direction. So the MD10C is working correctly.


New ( offline )
Posts: 1
Posted: 2012-04-28 22:28 
I am having a similar issue. The Cytron board tests fine with 12v hooked up to vin and 12v to power, both grounds connected. I can push the buttons and my motor runs great, both directions.

When i fire up the arduino with some of the above sample code, it's a no go though. Has anyone resolved the issue or have some sample code to test out?

Many thanks!
mark


User avatar
Expert ( offline )
Posts: 791
Posted: 2012-04-30 08:53 
@markeyro serge is suggesting his issue was due to a bad connection, perhaps the same applies to you?

_________________
Carlos Asmat
Lynxmotion

Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


New ( offline )
Posts: 2
Posted: 2012-11-01 14:34 
I also have two MD10C board, and with only digitalWrites (no pwm). I can get one of my boards to work. However neither of my boards work with pwm from the Uno. I don't think there is a connection issue as I've tested all the connections. The two buttons on the board work for both boards.

Some help would be greatly appreciated.

Code


User avatar
Expert ( offline )
Posts: 791
Posted: 2012-11-01 15:49 
It seems that the PWM frequency on the Uno is not suitable for that board. Perhaps try other frequencies as described here: http://www.arduino.cc/playground/Code/PwmFrequency

_________________
Carlos Asmat
Lynxmotion

Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


New ( offline )
Posts: 2
Posted: 2012-11-01 19:28 
Ok, I'll try it. One of my MD10C doesn't work witn any input at all, the buttons work however. The working one, works with 5V High on the pwm pin and LOW on the direction pin. As far as I can tell both boards are the same, I tested most of the links and I think they are all the same.

Thanks


 

All times are UTC - 5 hours [ DST ]. It is currently 2014-10-21 17:38
Feedback Form
Feedback Form