Tinkercad: tutorial dc motor with rotary encoder
Vložit
- čas přidán 5. 09. 2024
- This video tutorial on Tinkercad shows how to control a dc motor with arduino and L293D reading a rotary encoder connected to the interrupts pin 2 and 3 of arduino.
With the code in the examples you are going to stop the motor when the encoder reads a definde value of hits.
More info: www.mauroalfie...
Tinkecad: www.tinkercad....
#tinkercad #tinkercadtutorial #tutorialtinkercad
Hello, Great tutorial, is it possible to turn right, then stop and turn left in the same sequence using if condition?
Yes!! It is possibile.
Can someone explain me why we couldnt set the Encoder A and B to INPUT? Because normally if the Motor is rotating the Encoder should send an Impulse, i mean thats how it works in real... Has Tinkercad a problem with the DC Motors or something?
Hello,
from minute 5:53 to minute 6:20 I set pin 2 and 3 in INPUT mode, digitalWrite: HIGT and attachInterrupt CHANGE.
Which sketch are you referring to?
If i am using 2 Dc motors and I need to run one in clockwise and another one in Anti-clockwise can I know how supposed to be program?
Yes, you can find many examples in my blog: mauroalfieri.it
Where can i get this code
Hi @harirohithnp4139 you can find the code on my Blog: mauroalfieri.it under section "Corso Tinkercad".
How do you make it go faster
Simply, increase the PWM value in the analogWrite.
Hello, i try it but it didn't work for me, the motor didn't move. Do you know what happen..?
Hi Najmi, check the correct connection between motor and driver L293D and between driver and Arduino Uno
Why you do analog write to digital pin motorA(5)? Is it related to driver working principle?
Because pins 3,5,6,9,10,11 of Arduino Uno are able of sending PWM signals. This special function allows you to use the analogWrite command.
@@MauroAlfieri77 thank you
When I try to run the code on your TinkerCAD, its full of errors and wont run
Hi Andrew, what kind of errors do you receive?
@@MauroAlfieri77 I'll have to try it again, I may have found a bug with tinkercad and there may be no errors in your code. I think tinkercad has an issue running a different circuit following a previous circuit being left open after it had been running previously. I opened yours to compare it to mine because mine code wasn't working, which is when I ran into errors with your code. I then found someone else's tinkercad a little bit later and the first time I tried running theirs, it also errored out again. I simply tried running the code a second time, and the errors all disappeared.
@@andrewwhite310 it would be a very interesting bug to document and report to the platform.
Is my code working for you now?
variable long lastEncoderValue = 0; //is never used
Correct, you can remove it.
Bro is this a stepper motor
No, this in a DC motor with an integrated encoder
How I can download the same software you are using ?
Hello, the software is online, you can find tinkercad in Google.
eu nao falo ingles
llllllllllul