Tinkercad: tutorial dc motor with rotary encoder

Sdílet
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

Komentáře • 27

  • @DARKGOAL
    @DARKGOAL Před rokem +1

    Hello, Great tutorial, is it possible to turn right, then stop and turn left in the same sequence using if condition?

  • @OS-kd3vm
    @OS-kd3vm Před rokem +1

    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?

    • @MauroAlfieri77
      @MauroAlfieri77  Před rokem

      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?

  • @MrPrasanth12
    @MrPrasanth12 Před rokem

    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?

    • @MauroAlfieri77
      @MauroAlfieri77  Před rokem

      Yes, you can find many examples in my blog: mauroalfieri.it

  • @harirohithnp4139
    @harirohithnp4139 Před měsícem

    Where can i get this code

    • @MauroAlfieri77
      @MauroAlfieri77  Před měsícem

      Hi @harirohithnp4139 you can find the code on my Blog: mauroalfieri.it under section "Corso Tinkercad".

  • @General12578
    @General12578 Před 4 měsíci

    How do you make it go faster

    • @MauroAlfieri77
      @MauroAlfieri77  Před 4 měsíci

      Simply, increase the PWM value in the analogWrite.

  • @najmiaz-zahraferyputri653

    Hello, i try it but it didn't work for me, the motor didn't move. Do you know what happen..?

    • @MauroAlfieri77
      @MauroAlfieri77  Před rokem

      Hi Najmi, check the correct connection between motor and driver L293D and between driver and Arduino Uno

  • @demka9773
    @demka9773 Před rokem

    Why you do analog write to digital pin motorA(5)? Is it related to driver working principle?

    • @MauroAlfieri77
      @MauroAlfieri77  Před rokem +1

      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.

    • @demka9773
      @demka9773 Před rokem

      @@MauroAlfieri77 thank you

  • @andrewwhite310
    @andrewwhite310 Před 2 lety +1

    When I try to run the code on your TinkerCAD, its full of errors and wont run

    • @MauroAlfieri77
      @MauroAlfieri77  Před 2 lety

      Hi Andrew, what kind of errors do you receive?

    • @andrewwhite310
      @andrewwhite310 Před 2 lety +1

      @@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.

    • @MauroAlfieri77
      @MauroAlfieri77  Před 2 lety

      @@andrewwhite310 it would be a very interesting bug to document and report to the platform.
      Is my code working for you now?

  • @GenesisZeroTechnology
    @GenesisZeroTechnology Před rokem +1

    variable long lastEncoderValue = 0; //is never used

  • @sidharthm1579
    @sidharthm1579 Před 2 lety

    Bro is this a stepper motor

    • @MauroAlfieri77
      @MauroAlfieri77  Před 2 lety +1

      No, this in a DC motor with an integrated encoder

  • @SoloBrainCell
    @SoloBrainCell Před rokem

    How I can download the same software you are using ?

    • @MauroAlfieri77
      @MauroAlfieri77  Před rokem

      Hello, the software is online, you can find tinkercad in Google.

  • @Raquelbps
    @Raquelbps Před 11 měsíci

    eu nao falo ingles