Using 28BYJ-48 Stepper Motor Push button Speed with 8 projects: Ultimate Video Tutorial Lesson 107

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 มิ.ย. 2024
  • In this lesson we learn how to use 28BYJ-48 with 8 practical projects. First I introduce the mini motor, the driver board chip and the datasheet. then we learn about waveform and how it controls the motor then we have projects. We will use push buttons to control the motor, direction, speed and revolution and finally in project 8 we will use potentiometer or variable resistor to control the speed of the motor.
    Project 1: Running motor
    Project 2: Controlling stepper motor from Serial Monitor
    Project 3: Controlling stepper motor using push button STPB-1
    Project 4: Controlling using push button STPB-2 keep pressing
    Project 5: One Revolution using push button STPB-3
    Project 6: Push button Any Angle and speed STPB-4
    Project 7: Use multiple buttons to any angles STPB-5 angle, speed and direction
    Project 8: Controlling Stepper Motor using potentiometer
    This lecture is part of Arduino Step by Step course that starts here • Lesson 00 What is Ardu...
    The best thank you for me is to not to skip ads and Subscribe 🔔 to my channel, like 👍 the video It is greatly appreciated. 🔔 😊.
    I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊 .
    *********
    Download Arduino code for this video:
    robojax.com/course1/?vid=lect...
    **** Purchase 28BYJ-48 motor (Affiliated stores):***
    Amazon USA: amzn.to/2TrmIU1
    Amazon Germany: amzn.to/2HD4QTl
    Amazon Canada: amzn.to/3e41bdC
    Amazon UK: amzn.to/34yc0kQ
    Amazon Italy: amzn.to/2TuxBUV
    Amazon France: amzn.to/2TrnnVv
    Amazon Spain: amzn.to/34ycdEE
    アマゾンジャパン:amzn.to/2TuxNn7
    ** Purchase Arduino Start Kit **
    Amazon USA: amzn.to/3z88F9G or just UNO board amzn.to/3aY7KOL
    Amazon Canada: amzn.to/31an88J or just UNO board amzn.to/3pYxSNN
    Amazon Europe (all Europe): amzn.to/3pMCHge or Just UNO board amzn.to/2PgGItD
    AliExpress: s.click.aliexpress.com/e/_9uc7Xe
    Banggood: www.banggood.com/custlink/3GD... or UNO board www.banggood.com/custlink/vKm...
    eBay: ebay.us/B1JWLi
    ***** Purchase Authentic Arduino Uno from ***
    Amazon USA: amzn.to/2KApAwK
    Amazon Canada: amzn.to/37LZ8sW
    All Europe Amazon: amzn.to/36YDSzn
    Click on the player timeline to select different chapter
    00:00 Start
    02:03 Introduction to stepper motor
    07:40 How motor is controlled
    13:08 Wiring explained
    15:43 Project 1 code
    20:12 Project 1 demonstration
    22:23 Project 2: Controlling motor via Serial Monitor
    32:03 Project 2 Demonstration
    43:13 Project 3: Controlling using push button STPB-1
    35:48 Project 3: Wiring explained
    37:45 Project 3: Code explained
    39:59 Project 3: Demonstration
    41:07 Project 4: Controlling using push button STPB-2 keep pressing
    42:29 Project 4: Wiring
    45:31 Project 4: Code
    49:38 Project 4: Demonstration
    51:20 Project 5: One Revolution using push button STPB-3
    52:15 Project 5: Wiring
    55:40 Project 5: Code
    1:03:30 Project 5: Demonstration
    1:05:48 Project 6: Push button Any Angle and speed STPB-4
    1:07:43 Project 6: Wiring
    1:11:04 Project 6: Code
    1:17:34 Project 6: Demonstration
    1:20:18 Project 7: Push multiple buttons to any angles STPB-5 angle, speed and direction
    1:21:40 Project 7: Wiring
    1:25:35 Project 7: Code
    1:32:43 Project 7: Demonstration
    1:39:24 Project 8: Controlling Stepper Motor using potentiometer
    1:40:58 Project 8: Wiring
    1:44:04 Project 8: Code
    1:53:19 Project 8: Demonstration
    Tutorial by Ahmad Shamshiri form Canada
    ****************************
    Worth $200 Arduino Step by Step Course (over 100 lectures) Starts here • Lesson 00 What is Ardu...
    ****************************
    If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link bit.ly/donate-robojax
    Power Supply I use:
    DC 30V 60A Power supply: s.click.aliexpress.com/e/_98Ah5c
    DC 60V 30A Power supply: s.click.aliexpress.com/e/_APyPJ0
    Follow me on Facebook robojaxTV
    Follow me on Twitter: / robojaxtv
    Follow me on Instagram: / robojax
    Follow me on TikTok : tickTok.com/@robojaxtv
    Tutorial by Robojax.com
    Get other projects code and learn Arduino
    robojax.com/
    #robojaxArduinoCourse #robojax28BYJ48 #robojax_Stepper
    *** AFFILIATE PROGRAM ***
    We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 69

  • @billreynolds3539
    @billreynolds3539 ปีที่แล้ว +6

    Thanks!

    • @robojax
      @robojax  ปีที่แล้ว +2

      That is very kind of you. Thank you.

  • @mikenoad2494
    @mikenoad2494 8 หลายเดือนก่อน

    Perfect for what I need!

  • @easy_3d
    @easy_3d 10 หลายเดือนก่อน

    Great work man, i loved it, the code is helpful. Keep making more videos. How can we connect two stepper motors and multiple push buttons with led display such that , when i press A push button, the number should increase in display and when i press B push button, the number should decrease, and when i press start/stop button, the stepper motor has to rotate those many times as the number in the display?

  • @norbo1536
    @norbo1536 ปีที่แล้ว +1

    can the control for a DM542 be used for larger stepper motors?
    continue o Robo, track your projects.
    A control for photovoltaic solar tracking would be great.

    • @robojax
      @robojax  ปีที่แล้ว

      No. This code is for this particular motors

  • @jeffreycashen6416
    @jeffreycashen6416 ปีที่แล้ว

    Hello, I am using project 4.
    How would i transfer this circuit to a pcb, i have tried to do it myself and i think i killed the controller board ?
    Is it only used on the arduino uno's as i tried to connect to an arduino nano ?
    I am trying to use the 2 button control.
    After re-connecting through the breadboard, it now comes up with "drivestepper was not declared in this scope", and i copied the code from yours and included the stepper library. When i very first hooked this up, it worked perfectly and now it doesn't. Is there something that i am missing ?
    If you like, i can take a screenshot of the error for you to view.
    Your help with this would be greatly received.

  • @joshitoshi9835
    @joshitoshi9835 ปีที่แล้ว +1

    Thanks once again for such informative video, im halfway watching it and cant resist to write this.
    Im just thinking to use stepper motors to control sunshade cover/uncover (made of cloth fabric) at my home pergola, so i have few questions.
    1. Can we make maximum steps a motor can run in CW or CCW? so tht when we press CW/CCW button the motor should only run for predefined maximum steps and then stop automatically.
    2. In my case, i will need two motors to run synchronized in such a way when i press CW button the First Motor should run CW and other Second Motor should run CCW and vice versa.
    3. It would be nice if you make this project in real and share everything related to coding or hardware stuff.

    • @robojax
      @robojax  ปีที่แล้ว

      I tried to make in my mind all possible scenarios so people can use them with their projects. 3-all the codes have been provided in the resource page. I checked it and the are there.

  • @adventurejeep5504
    @adventurejeep5504 ปีที่แล้ว

    Project 5 on this I’m having a problem with. So i hooked everything up exactly to your diagram and copied and pasted the coding and it works. Until….it randomly turns itself on every 30 seconds and then spins for exactly 38 seconds and stops. Any idea what is wrong with it?

  • @jeffreycashen6416
    @jeffreycashen6416 ปีที่แล้ว

    Project 4 2 button control - I have setup the exact same way that you have and it works perfect. If i wanted to setup a second motor running from the same arduino, what things would i have to change. i did set the second one up using the same wiring but on different pins on the arduino (obviously), when i went to change the code, it came up with an error. i have since then gone back to one motor on the arduino. all the help you can give me, would be very much appreciated. i do not know much about coding as yet but i am working on it, bit by bit. The project that i will be using it for is push button to open up 2 light doors on a shelf that i have.

    • @robojax
      @robojax  ปีที่แล้ว

      Hi,
      The pins have been defined as variables and all instances of actions like move, stop ,run etc have variables and I mentioned each. you may learn about variables from this video th-cam.com/video/n0z6fjww8eA/w-d-xo.html

  • @glecaillier
    @glecaillier ปีที่แล้ว

    Hello ! Thanks a lot, very interesting, is there a way to merge project 4 (keep pressing CW or CCW) and project (control speed with portentiometer) ? Thanks :)

    • @robojax
      @robojax  ปีที่แล้ว

      Hello, I believe I have explained every line in the code from the first project. So if you pay attention, you can easily combine them. Some of them need more attention than other if time control is involved. But doable.

  • @amirhosseinsalmani7668
    @amirhosseinsalmani7668 ปีที่แล้ว

    Dear Mr. Shamshiri engineer, please include the control tutorial for 2 stepper motors and push button،Thanks

  • @arduinomaquinas
    @arduinomaquinas ปีที่แล้ว +2

    Like 187 👏👏👏👏

  • @chanchalsakarde2768
    @chanchalsakarde2768 3 หลายเดือนก่อน

    how to control steps movements, like lets say we have 400 circular points to move one by one and i need to move pointer in following example sequence starting from 0->10->240->45->28-> .......... -> 400 . How can we automate this ..

  • @sw1ftyboi
    @sw1ftyboi ปีที่แล้ว

    Hello, Again thank you for your videos and past help.
    I have got my project working as i wanted, but my next question can i run 2 steppers with one arduino? I just want to use the one button i have got working with limit sensors, but i want duplicate on another stepper and limit switches but still all controlled with the one button. I am using a Nano every.
    many thanks

    • @robojax
      @robojax  ปีที่แล้ว +1

      Hello, yes you can. Because I have explained it fully as how it works, it would be very easy to do so. just duplicate all variables for one motor, and make 2nd variable for each. For example if we have a variable like int Pin1 =10; then you define int Pin1_2 =6; and connect motor to to pin 6, so simply add _2 or _3 if you want 3rd motor. and do this for all variables. Then inside the loop or anywhere else, make sure to refer to that variable. this is lesson 107 and if you don't did not get what variable is then watch this data type video th-cam.com/video/n0z6fjww8eA/w-d-xo.html good luck

    • @sw1ftyboi
      @sw1ftyboi ปีที่แล้ว

      @@robojax perfect thank you, i thought i did see a 2 stepper video a while ago but could not find it.
      many thanks

    • @sw1ftyboi
      @sw1ftyboi ปีที่แล้ว

      @@robojax I have understood defining the pins for the second motor, but i do not understand refering them in the loop, i can not see this in lesson 107.
      many thanks

  • @alirahimi9472
    @alirahimi9472 ปีที่แล้ว +1

    Hi Mr Shamshiri, I used your code for project #5 with NEMA17 and L298N driver to do the same job as you did in project #5. But, my project did not work as you demonstrated in your video. Do you have any suggestion to fix this issue? My stepper motor is making noise but is not moving in any direction; my switches are working, I checked the wiring of my stepper motor with its driver and nothing seemed wrong with that. I appreciate your help.

    • @robojax
      @robojax  ปีที่แล้ว +1

      Only works with the motor shown in video. I have separate video for l298n

    • @engineeringworld9455
      @engineeringworld9455 ปีที่แล้ว

      @@robojax can you please send me the link for that if you access to it? Thanks

  • @musahodzic9732
    @musahodzic9732 ปีที่แล้ว

    Hello sir, I have the same motor in 12V inside my star-light light source that spins the wheel for the twinkle effect. Even on the lowest speed it is a bit too fast for my liking. Is there an easy way to modify this on the lowest speed wire by adding a resistor, rheostat, voltage regulator, diode, etc without causing any damage? I would appreciate your advice. If so, could you point me in the right direction please and which wire is used for the slowest speed?

    • @robojax
      @robojax  ปีที่แล้ว

      How come lowest speed is fast for your need? You can do single rotation to be 24 hours. Please watch fully

    • @musahodzic9732
      @musahodzic9732 ปีที่แล้ว

      @@robojax I am so sorry, I watched the video twice and couldn't figure it out. I don't use Arduino. I just need to know a way to make it turn slower please? Which wire? Which electronic components best to use please?

  • @Home-Artisan
    @Home-Artisan ปีที่แล้ว

    what if we want to try same projects with micro stepper tb6600 + Nema17, 200, which runs by 2 poles signal only, will change in pole(s) section of code make Nema to works as 28BYJ-48 like your projects? thanks for your time.

    • @robojax
      @robojax  ปีที่แล้ว

      Here is video on NEMA th-cam.com/video/csf_G1pi0ps/w-d-xo.html, this code is needs full rewriting to work with different stepper motor.

  • @shyamjithkariyil2928
    @shyamjithkariyil2928 4 หลายเดือนก่อน

    spr

  • @charlieharris5254
    @charlieharris5254 ปีที่แล้ว

    Wanting top change a standard toy dc motor with a 28byj-48 or similar. Model train transfer table. Problem is the stepper as is with 64:1 is way too slow. Can I use the 28byj-48 without the gearbox? Are they available without gearbox? Not a big load to drive. Thanks

    • @robojax
      @robojax  ปีที่แล้ว

      Hi, I have explained how the speed is controlled at the begining in first of 2nd project. This stepper is geared and it is slow. only you can slow it further. The first example shows the normal speed.

  • @iwebexp
    @iwebexp ปีที่แล้ว

    can you help with using a "rocker" switch in place of the 3 button. Rock up to move motor 1 direction, center to stop the motor, Rock down to move motor opposite direction. then when let go, it goes back to center for stop. Add hall effect sensors to both ends of "ball drive screw" to set limits. Using the Stepper Motor Driver DM542T. Can you help with this specific programming and wiring diagram? I will purchase for the work.

    • @robojax
      @robojax  ปีที่แล้ว

      Please contact me via Robojax.com@gmail to discuss it.

    • @iwebexp
      @iwebexp ปีที่แล้ว

      @@robojax I did

  • @lucasavalos2943
    @lucasavalos2943 ปีที่แล้ว +1

    In the project 3, i copied the code and driveStepper, when I compilate, the down thing say "driveStepper was not declared in this scope" how can I fix it? Thanks

    • @robojax
      @robojax  ปีที่แล้ว +2

      any time you see ' not declared" it means that portion of the code is missing. meaning if library is needed you have no installed it. So get that portion of the code or library.

  • @strix124
    @strix124 ปีที่แล้ว +1

    Hello sir! You made a very good and useful video. The examples you have shown are great. Can you help me with an example. I know this will be simple for you and will take you almost no time. Can you share some code where on start the arduino the motor returns to home position (hall sensor will be used as a limit switch) then on a button press the motor goes 200 (for example) steps and stops. After pressing the same button again, it will return to the home position. I would be grateful if you could help me with this example. Greetings

    • @robojax
      @robojax  ปีที่แล้ว

      Hello, I believe the same features that you want in this video. Just watch them all. you should be able to make it.

  • @adventurejeep5504
    @adventurejeep5504 ปีที่แล้ว

    There’s something wrong with your code on #5. It randomly turns on every 30 seconds for 38 seconds. Please help.

  • @namnguyenlehoang8368
    @namnguyenlehoang8368 ปีที่แล้ว

    although disable ENA pin and Pul pin, the step motor cannot stop immediately . Please tell me the reason why it cannot run PLEASE Sir.

  • @thomaskuehn6490
    @thomaskuehn6490 ปีที่แล้ว

    Hello Sir,
    I want to turn the motor with the poti in the other way and stopp the motor .
    And than the Motor run in the same way or return it.
    We can I do that?
    Thanks for the answer
    Thomas

    • @robojax
      @robojax  ปีที่แล้ว

      Hi, did not understand. So you want this to work in the opposite? if so just switch the two wires of the variable resistor (potentiometer) and the direction of knob will be reversed. keep the middle wire . do not change it.

    • @thomaskuehn6490
      @thomaskuehn6490 ปีที่แล้ว

      @@robojaxHi,
      that the way. Thank you sir,
      I take a switch between the cabeles and with them i can change the two pins .

  • @joshitoshi9835
    @joshitoshi9835 ปีที่แล้ว

    so can we control the stepper motor with push buttons with attiny?

    • @robojax
      @robojax  ปีที่แล้ว

      If you have that number of pins available, yes

  • @saranyadevi6122
    @saranyadevi6122 ปีที่แล้ว

    Hi sir, here we use ESP32 micro controller board but we can't able to control the stepper motor rotation and also the coding was doesn't support. please give the suitable solution for it

    • @robojax
      @robojax  ปีที่แล้ว

      Hi, search for ESP32 to find video related to that.

  • @CJFromGroveStreet
    @CJFromGroveStreet 11 หลายเดือนก่อน +1

    Hi sir. great video . I have a problem in project 8 . My stepper motor is vibrating and not turning . Any solutions ???

    • @robojax
      @robojax  11 หลายเดือนก่อน +1

      bad wriing.

    • @CJFromGroveStreet
      @CJFromGroveStreet 11 หลายเดือนก่อน +1

      @@robojax Still vibrating

  • @namnguyenlehoang8368
    @namnguyenlehoang8368 ปีที่แล้ว

    when using step motor with driver. how can you stop the step motor by stop button. if using attachInterrupt after releasing stop button the CODE will still run continuously

    • @robojax
      @robojax  ปีที่แล้ว +1

      we have 8 projects and I there is a project with the stop.

    • @robojax
      @robojax  ปีที่แล้ว

      you didn't reply? did you watch all projects and found one?

    • @namnguyenlehoang8368
      @namnguyenlehoang8368 ปีที่แล้ว

      @@robojax sorry about that, unfortunately I cannot find out a project with 3 button control step motor as Start run from A to B and comeback A, Reset return B and stop will stop immediately. That’s my difficulty

  • @CJFromGroveStreet
    @CJFromGroveStreet 11 หลายเดือนก่อน +1

    Sir how much external power supply can i provide ???

    • @robojax
      @robojax  11 หลายเดือนก่อน +1

      5v 200mA is enough for a motor

    • @CJFromGroveStreet
      @CJFromGroveStreet 11 หลายเดือนก่อน +1

      @@robojax thanks for your reply ❤️❤️❤️. My motor keeps vibrating but it does not turn. Any solutions ? The wiring is not bad

  • @jonbliguin6488
    @jonbliguin6488 ปีที่แล้ว

    26:31 getCommand code is not clear i copied the code at the bottom but i keep getting: 'getCommand' was not declared in this scope

    • @robojax
      @robojax  ปีที่แล้ว

      it means you don't have the function int getCommand() which is at the bottom of the code. I just visited the page where the code is, and this portion is there. make sure to copy the whole code.

  • @hemamapari8887
    @hemamapari8887 ปีที่แล้ว

    Can we change the rpm to decimal values?

    • @robojax
      @robojax  ปีที่แล้ว

      I don't remember what I wrote, but the time is very precise. you can do very slow rpm which might take one day. why would you change it to decimal value? you could but you have to change all the value to decimal as in calculation when do mathematical operation, there are issues with you divide integer to decimal or vice versa . So if can fix all those issue, yes you can. but you don't need to do that. just use the integer as it accommodates all your needs.

    • @hemamapari8887
      @hemamapari8887 ปีที่แล้ว

      @@robojax okay ... thanks ,nice video

    • @hemamapari8887
      @hemamapari8887 ปีที่แล้ว

      @@robojax how to connect LCD to it so that I can see the rmp

  • @PR-sn3mz
    @PR-sn3mz ปีที่แล้ว

    delay(speedFactor); // ?? when i push a button fine works, but the stepper rotate full ~45sec. without push button always with pause , why ??

    • @robojax
      @robojax  ปีที่แล้ว

      because you set how long should it take to complete the revolution. Please watch carefully.

  • @mickandkez
    @mickandkez ปีที่แล้ว

    DONT BOTHER WATCHING!! you CANNOT use any of this code as it requires HIS libraries and you have to pay for them. So you will do all the work first wiring, code and then you cannot compile it without his payed libraries.

    • @robojax
      @robojax  ปีที่แล้ว

      The code is free. Never pay. Just follow the link and it is free

    • @mickandkez
      @mickandkez ปีที่แล้ว

      @@robojax Im talking about Library drivestepper.h, math.h, primitivestepper.h