Control DC MOTOR + Encoder with DC Motor Shield for Arduino - DFRobot

preview_player
Показать описание
This video is about Control DC MOTOR + Encoder with DC Motor Shield for Arduino

DC Motor Shield :: ➡︎➡︎ 🛒🛒

Metal DC Geared Motor w/Encoder :: ➡︎➡︎ 🛒🛒

Arduino UNO R3

Arduino Sketch

::::::::::: SUPPORT CHANNEL ========

→ Don't forget to subscribe!

🌟Love you all! 💕

Song: MBB - Feel Good (Vlog No Copyright Music)
Music provided by Vlog No Copyright Music.
Рекомендации по теме
Комментарии
Автор

hello may i know which connection of yellow and black wire in motor power connection coming from? 1:40

nurulain
Автор

the encoders are not connected! This video shows nothing, than the motors are turning connecting voltage.

sebaschtl
Автор

Looks like the Arduino sketch link no longer worked.

jimmykan
Автор

Wha if I aplly a high torque (less of its maximum) to this motor, the current will be greater than 2A, so the shield will burn??

ronaldolaureano
Автор

Any idea if the motor shown in this video is shunt, series or compound type please?

andremizzi
Автор

Do you use the same shied to do the PWM control and encoder? put the code together?

hankkobe
Автор

Hello there, can I control dc motor with encoder by 2 line the first one is pulses for steps and the second one is (0, 1)for direction?

xzero
Автор

Hello, how can I interface same with raspberry pi instead of Arduino ?

shingrutashish
Автор

when one compare the price of a driver like vnh5019 or the l298n, price of an encoder is not the problem,
but the time spent to implement it...and multi-use of a driver is far more reaching than ANY encoder( which is single use ... one motor at a time )

unglaubichuberlieber
Автор

question. your code doesn't say that the pins are connected to pin 2 or 8. how are getting them to work?

solodobo
Автор

hi maker tutor! I am fan of your youtube channel and like your videos, because they are easy to follow. Regarding this video, I have some issues. Is it possible to show what you are doing after assembling? I do not get the motors running, after transferring your code to my Arduino.

aymanmustafa
Автор

Nice video
Query
I have 12V DC motor with encoder by cytron .
L298N motor driver
Arduino UNO
My requirement is to control the motor at particular angle means i want to rotate my motor at particular angle only, so how can i do that. Please reply
And how can i measure the pulse with above hardware.
Please madam reply i really need help

Thank you

Deshbhakt_Indian
Автор

have you connected both of the encoders to the same pins?

ayhanakyuz
Автор

int E1 = 5;
int M1 = 4;

int E2 = 6;
int M2 = 7;

const byte encoder0pinA = 2;
const byte encoder0pinB = 4;

byte encoder0PinALast;

int duration;

boolean Direction;


void setup()
{

Serial.begin(57600); // initialise the serial port
EncoderInit(); // initialise the module

pinMode(M1, OUTPUT);
pinMode(M2, OUTPUT);

digitalWrite(M1, LOW);
analogWrite(E2, 100);

digitalWrite(M2, HIGH);
analogWrite(E2, 250);


}

void loop()

{
Serial.print("pulse:");
Serial.println("duration");
duration = 0;
delay(100);
}



void EncoderInit()
{
Direction = true;//default -> Forward
pinMode(encoder0pinB, INPUT);
attachInterrupt(0, wheelSpeed, CHANGE);
}

void wheelSpeed()
{
int Lstate = digitalRead(encoder0pinA);
if((encoder0PinALast == LOW) && Lstate==HIGH)
{
int val = digitalRead(encoder0pinB);
if(val == LOW && Direction)
{
Direction = false; //Reverse
}
else if(val == HIGH && !Direction)
{
Direction = true; //Forward
}
}
encoder0PinALast = Lstate;

if(!Direction) duration ;
else duration--;
}

yMilan
Автор

Das ist pure Irreführung ! Fake und zwar zum zigten Mal ! kein Zugang zum Code usw...!

superabbasalmani
Автор

Donde puedo conseguir ese motor :'v?

alessandrapezetmartell
Автор

//sketch_mar10b
//Arduino PWM Speed Control:
int El = 5; // MOTOR_1
int Ml = 4; // MOTOR_1
int E2 = 6; // MOTOR_2
int M2 = 7; // MOTOR_2

//The sample code for driving one way motor encoder
const byte encoder0pinA = 2; //A pin -> the interrupt pin 0
const byte encoder0pinB = 4; //B pin -> the digital pin 4
byte encoder0PinALast;
int duration; //the number of the pulses
boolean Direction; //the rotation direction

void setup() {

Serial.begin(57600); //Initialize the serial port
EncoderInit(); //Initialize the module

pinMode(Ml, OUTPUT);
pinMode(M2, OUTPUT);

digitalWrite(Ml, LOW);
analogWrite(El, 100);

digitalWrite(M2, HIGH);
analogWrite(E2, 250);
}

void loop()
{
Serial.print("Pulse:");
Serial.println(duration);
duration = 0;
delay(100);
}

void EncoderInit()
{
Direction = true; //default -> Forward
pinMode(encoder0pinB, INPUT);
attachInterrupt(0, wheelSpeed, CHANGE);
}

void wheelSpeed()
{
int Lstate = digitalRead(encoder0pinA);
if((encoder0PinALast == LOW) && Lstate==HIGH)
{
int val = digitalRead(encoder0pinB);
if(val == LOW && Direction)
{
Direction = false; //Reverse
}
else if(val == HIGH && !Direction)
{
Direction = true; //Forward
}
}
encoder0PinALast = Lstate;

if(!Direction) duration++;
else duration--;
}

adiletskwaer