Chapter 10 - Exploring Stepper Motors (28-BYJ-48) with an Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 พ.ค. 2024
  • I create all this content for the greater good with everything licensed under Creative Commons. At the same time your support is genuinely appreciated- tips are welcome via this link:
    www.buymeacoffee.com/mmaker
    In this chapter, I’ll demonstrate how to control the popular and widely used 28-byj-48 stepper motor with your Arduino. This presentation borrows from many online sources, so thanks in advance to all of you who have posted your own research online to help me reverse engineer how these little motors work. Code is available at modestmaker.com/arduino/part1...

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

  • @nicolaumonteiro4582
    @nicolaumonteiro4582 16 วันที่ผ่านมา

    THAT WAS OUTSTANDING... IT MIGHT HAVE BEEN THE BEST TH-cam TUTORIAL I HAVE EVER SEEN. WISH YOU COULD CONTINUE THIS SERIES ABOUT ELETRONICS/ARDUINO.

    • @ModestMaker
      @ModestMaker  15 วันที่ผ่านมา

      Wow, thanks! I do have other Arduino-related videos on my channel. Appreciate that!

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

    This is by far the finest most extensive video out there on steppers, and differences, pro’s-cons. The video is at a great pace and easily followed. This video is WELL worth watching and provides high value to the audience. Thank you for the time you took for all the details explaining all the parameters as well, including the math calculations. This video IS education!

    • @ModestMaker
      @ModestMaker  2 ปีที่แล้ว

      Thanks for that! Made my day☺

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

    Highly recomendable video on stepper motors, it takes you to the core in simple words. - I've not seen anything better, I seen a lot.

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

    Thank you very much for the dedicated work and sincere step-by-step explanation. See, this video is almost 4 years old but still benefiting people like me today! This video is one of the greatest ive ever seen in the online content. Thank you, Sir.

    • @ModestMaker
      @ModestMaker  2 ปีที่แล้ว

      Well, your sincere comment certainly put a little wind in my sails. I’ll be posting more microcontroller content soon- thank you!

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

    One of the best Video on TH-cam ,very clear instruction and with ampules of information, Thankyou .

  • @Hellbrate
    @Hellbrate 2 หลายเดือนก่อน +1

    You earned subscription. Nice tone of your voice, calm and precise. I really enjoyed watching your video and following your code. Keep up good work!

    • @ModestMaker
      @ModestMaker  2 หลายเดือนก่อน

      Thanks - appreciate your kind words.

  • @electronics.unmessed
    @electronics.unmessed ปีที่แล้ว +2

    One of the best stepper motors tutorials! It gives a lot of inspiration to me creating a gauge with Arduino.😀 The videos will come later this year.

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

      Great to hear! Some of this stuff can take a lot of blood sweat and tears to figure out, so I'm glad there are others willing to help make this easier for the rest of us! Looking forward to your videos.

  • @digihz_data
    @digihz_data 11 หลายเดือนก่อน

    The best professional explanation I ever seen, and he is so calm to in his speaking.
    Great!

    • @ModestMaker
      @ModestMaker  11 หลายเดือนก่อน

      Nice to hear a compliment from a fellow "Hans" (That's my name too :)

  • @sastrydasigi7010
    @sastrydasigi7010 3 ปีที่แล้ว +3

    Excellent series! Thanks for an amazing job.

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      Glad you enjoyed it! I hope to get back to Arduino once I close out a few final experiments with LoRa.

  • @freespirit1177
    @freespirit1177 5 ปีที่แล้ว +8

    Best explanation I’ve seen. Many thanks.

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

      Awesome! I am glad it made sense - appreciate the feedback!

  • @Chrissi33004
    @Chrissi33004 24 วันที่ผ่านมา

    This is by far the best video ive seen on the 28-BYJ-48
    The motor is great for simple tasks but really starts to struggle at 5V with the ULN2003 with anything demanding torque or precision.
    For that reason I love running a modified 28-BYJ-48 with an A4988 at 12V 120mA.
    You can get much higher RPM (I tested to about 25-30, but ofc you will lose torque) Or get a lot more torque at the same 5-12 RPM.
    Sure the ULN2003 can be run a 5V, from the same source as the microcontroller but the 28BYJ48 and A4988 Combo can easily be run on a cheap 5V to 9/12V boost converter, which offer a small footprint and enough current capability to run the Motor/Driver reliably and without overheating.

    • @ModestMaker
      @ModestMaker  24 วันที่ผ่านมา

      Thank you for sharing these pointers- makes posting these videos worth the effort👍.

  • @marwanshwaiki777
    @marwanshwaiki777 3 ปีที่แล้ว +3

    Excellent demonstration indeed. Thanks

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

    To jest najlepsze wyjaśnienie jak działa motor. Myślę, że wprowadzone biblioteki i różna wielkość ilości kroków na jeden obrót i kolejność podłączenia uzwojeń spowodowała że straciłem wiele czasu na zrozumienie jak działa motor. Gratuluję efektu i pozdrawiam z Polski.

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

      I appreciate that kind comment. Glad it helped my friends in Poland :)

  • @quoctrungtran8301
    @quoctrungtran8301 3 ปีที่แล้ว +4

    This helps me alot. Thank you so much for your awesome video.

  • @bitcoinwallet-tj5ue
    @bitcoinwallet-tj5ue 3 ปีที่แล้ว +1

    Came here for info on speed variation,but will for sure go to Chapter 1 and give this series a go.
    Well explained.

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

      Hope it was helpful!

    • @bitcoinwallet-tj5ue
      @bitcoinwallet-tj5ue 2 ปีที่แล้ว

      @@ModestMaker Yes it was,gave me some refreshment in some of the current and voltage stuff.
      The water based explanation made more sense than the explanation 30 years ago (school),I am watching it again ATM.
      Have some stepper motors now,but was lacking the time to do the practical appliance.
      Thanks for taking the time to make these series and will let you know how the implementation journey was.

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

      So kind of you to take the time to share your response - makes the effort worth it!

  • @hernanjavines
    @hernanjavines 5 ปีที่แล้ว +4

    Thanks for the video, it helped me debug Arduino's sample code!

    • @ModestMaker
      @ModestMaker  5 ปีที่แล้ว

      Great! Glad it helped. Cheers.

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

    Impeccable presentation!

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

    The best video abut stepper motor and Arduino. Congratulation. Best Regards.

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      Wow - that means a lot. Thanks so much-- glad the effort was worth it!

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

    Great video. Very helpful

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      Glad it was helpful!

  • @fabiorodriguez8258
    @fabiorodriguez8258 3 ปีที่แล้ว +5

    thanks for the video!!!!!, finally i understand the reduction gear ratio, excellent explanation by the way, the best way to understand how it works something is not using arduino libraries :D

  • @GeekDetour
    @GeekDetour 3 ปีที่แล้ว +4

    Hi there! Excellent video! I am working on a project using 28byj steppers and the “precision problem” is the cheap gearbox with a huge backlash - so, when you change direction, a few steps will be “wasted” until all the gears get in traction contact again. The AccelStepper library has a setBacklash method that could potentially fix this... didn’t test it yet myself. It looks like:
    /// Sets the number of steps needed to correct backlash in drive train
    void setBacklash(unsigned long steps);
    Hope it helps!

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      Thanks so much for this info... will try to include this in the description of the video shortly!

    • @d.j.peters
      @d.j.peters ปีที่แล้ว

      @@ModestMaker does it solved the problem really ?

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

      Haven’t tried it, but his approach makes perfect sense.

  • @BStateham
    @BStateham 4 ปีที่แล้ว +3

    Love it!

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

    Great video. Please tell more about terms like maximum speed and acceleration. Thank you.

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

      Noted Thanks for watching and feedback. So many projects, but I do hope to come back to this one shortly. Take care.

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

    Along with others, I also say this has been an excellent primer on geared-stepper motors.
    I am trying to replace the meter-movement of a vintage Simpson 260 analog meter. My questions are, is there a geared stepper motor that maybe has a high gear ratio that would both be very accurate (hopefully to a needle-width) that would not take too long to reach up to around say 120 degrees of ‘swing’ (you could lookup an image of the Simpson 260 to see the needed deflection angle). How about 100:1 ratio and small enough to fit in the original meter as there doesn’t have to have any power/torque just to run a needle?
    Do you feel this is doable or would I suffer reading-accuracy or to-slow needle travel-time?

    • @ModestMaker
      @ModestMaker  2 ปีที่แล้ว

      Thanks! I appreciate that feedback and interest. Steppers are fascinating and I hope to return to this topic shortly. I will need to do a little digging on a Simpson 260 analog meter to answer your question intelligently- let me get back to you.

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

    thank you very very much!

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

    Great explanation of stepper motors and controlling them through an Arduino.
    Are you aware of any smaller stepper motors that perform a 6 degree of motion (or a multiple of 6 desgrees)? I would be looking for one of similar small size as the one in your demonstration. I would assume if such a stepper motor is not available, one would have to probably design a gear reduction to achieve the 6 degrees of rotation.

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

      Adafruit sells a smaller stepper with a 1.8 degree rotation: www.adafruit.com/product/4411 . Judging by your handle, sounds like you have the equipment to design any gear ratio you need. 😊

    • @DCDLaserCNC
      @DCDLaserCNC 2 ปีที่แล้ว

      @@ModestMaker Thank you for the info! Yeah, I could design and cut some gearing. I would just need to work out the appropriate ratios.

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

    Thanks very much!
    Please can you put the link to the guide you found in the description?

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

      The video was compiled from about a dozen websites. I don't have links in the description, but they are sourced on the slides. The page with the code is under "Chapter 10" on this page: modestmaker.com/arduino/part1.html

  • @patadamson9296
    @patadamson9296 3 ปีที่แล้ว +3

    Thanks for this video, it helped me a lot. I'm wondering how to change the code. I'm making a star tracker and want to run it using a stepper motor. I need the motor to run in one direction only, and I need to control the speed from zero to max using a potentiometer.
    Hope you can help.
    Pat

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      Hi Pat. Sounds like a great project! You should be able to achieve this relatively easily with the code I provided. See minute 11:50 for further details, and note you can download the code for edit from chapter 10 associated with this link: www.biod101.com/arduino/part1.html . In retrospect, that's a great idea Pat - I see where you are going with this since I also have a small reflecting telescope that can be difficult to adjust, so a potentiometer with steppers would be the way to go. I'm going to have to think about this for a future project - thanks for the inspiration.

    • @patadamson9296
      @patadamson9296 3 ปีที่แล้ว

      Thanks for the information. I have downloaded the code and it works perfectly for the star tracker I built. The only thing I would like to change in the code is the maximum speed. I would like it to revolve a little faster at max. What values do I change to make that happen.
      Thanks.
      Pat.

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      Sorry for not replying sooner. I would suggest playing with any delays on the code. That manages the time between each step, so in sum, would control the speed. Let me know how it goes- would love to see your finished project.

  • @parampalsingh9407
    @parampalsingh9407 4 ปีที่แล้ว

    hey modest.i want to ask like u r using this motor driver which has 4 outputs.but i am using t56560 driver and i connect all four wires of my motor at left side and on the other side i only get step and direction ,ground and enable pin.so out of these pins which are in1,in2.in3and in4 ?could you please help? i will really appreciate it.this video was bomb with explanation.thanks and god bless u

    • @ModestMaker
      @ModestMaker  4 ปีที่แล้ว

      Thanks Param. Sorry, I am not familiar with this particular driver, nor can I seem to find a link for it online anywhere (t56560 driver). Are you trying to run that driver with this particular stepper motor? If so, would recommend just using the ULN2003 motor driver that is commonly sold with this motor.

    • @parampalsingh9407
      @parampalsingh9407 4 ปีที่แล้ว

      @@ModestMaker hey modest its tb6560 ...typing mistake.uln2003 are old drivers and new drivers are much better in terms of current adjustment and micro stepping.could u kindly see tb6560 on internet? thanks

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

    I am new at this stuff so this might be a stupid question. How did you lined it up at 19:08. Is there any way to set null position for a motor?

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

      Good question! I think this may be a bit confusing because in the video, I say I "line it up, and going to reset it". Actually, what I should have said was that "I'm going to line it up BY reseting it - right at the moment the pointer is pointing north", so good catch on your part. Yet another way of doing this is by timing the upload of the sketch so that it stops the pointer precisely when it is pointing north, and then restarts the sketch from there. This takes a little skill.

    • @nicolaslac1013
      @nicolaslac1013 3 ปีที่แล้ว

      @@ModestMaker ...by timing the upload of the sketch? Sorry but how can we make this? It's a great video you have done ! This will be very useful for a small robot ou machine, when we switch it on the motors must stay at the right place. Any advise will be nice, thanks.

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      @@nicolaslac1013 It's been awhile since I played with this, but I recall I had the box hooked up to my computer with the sketch running. When the pointer approached the 12-o-clock position, I hit upload on the Arduino IDE. The upload caused the pointer to stop, and then it started its loop function from scratch. This is what I mean by timing - I had to predict the time it would take for the upload to interrupt the turning of the shaft/pointer so that it would stop exactly where I wanted it to. Honestly, I don't know how to do this programmatically since unlike servos, there's no feedback on the position of motor shaft. I guess you'd have to do this through some kind of secondary feedback sensor hooked up to an interrupt (?)

    • @nicolaslac1013
      @nicolaslac1013 3 ปีที่แล้ว

      @@ModestMaker Thank you for your answer, yes I think you're right. I'm investigating a little, kind of beginner.

  • @ronjurgs9799
    @ronjurgs9799 9 หลายเดือนก่อน

    Very good video on the 28BYJ-48 stepper motor. Last week I received some as well as the ULN2003 stepper driver board. I have the 12 volt version of the stepper motor and am driving it from an external power supply. It looks like the gear ratio problem has been fixed. I did take one of my stepper motors apart and examined the reduction gears. The driver motor shaft has 9 teeth on it. The first gear has 32/11 teeth. The second gear has 22/9 teeth. The third gear has 8/27 teeth. The output shaft has 27 teeth on it. I know it's a bit confusing but my calculations resulted in 9/32 * 11/22 * 9/27 * 8/24 = 0.015625. That's the same as 1/64. My testing did show that 2048 steps resulted in 1 complete turn as expected both CW and CCW. I've only been working with my Arduino GIGA R1 WiFi board for about a week but so far it does everything about as expected and I'm making progress on my project. Another thing that I did notice is that when I connected a pot to the +5.0v supply that the digital to analog converter didn't behave quite as expected. My research indicated that it was better to put 3.3V on the high side. I tried that and it did seem to work better. For my project I do need to turn the motor output shaft plus and minus 180 degrees and that does seem to work. It would work better if I could disable the 12 volt power to the driver board a short time after my remote adjustment is made and that's what I'm working on now.

    • @ModestMaker
      @ModestMaker  9 หลายเดือนก่อน

      I’m so glad it helped! It sounds like you are well on your way towards finalizing a successful project. Thanks for sharing your calculations and results on the gear reductions and best of luck with your project 👍.

  • @woodyouloveit-fe1sw
    @woodyouloveit-fe1sw 4 หลายเดือนก่อน

    Can it be possible to give input as number to move to particular position... Let say 360points in Circle and wanted to move pointer to that input number on protector...like gauge

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

      Absolutely. The code I shared can be hacked to do this. You could for instance tie an environmental sensor to an Arduino to position the pointer.

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

    Can it be automate to use in String Art..also called as Thread art.. but how to achieve

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

      I don’t know what string art is, but the motor is certainly easily programmable to pull and release strings in a spool if that’s your goal. I have provided sample code that can help with the same.

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

    can you plz provide the the codes, in the given link it is not available

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

      www.biod101.com/arduino/code/stepperSketches.zip

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

    Hey there! Do you know how to use this code in Matlab?

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

      Sorry- not a Matlab guy (although exploring R with some success).

  • @rodrigoa.velascojr.739
    @rodrigoa.velascojr.739 3 ปีที่แล้ว +2

    I cant find the code

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      www.biod101.com/arduino/part1.html - scroll down to chapter 10 for the compressed file.

  • @abpccpba
    @abpccpba 3 ปีที่แล้ว

    Was that you with BOB and the kids?

    • @ModestMaker
      @ModestMaker  3 ปีที่แล้ว

      Yes - I've got a video with the obstacle detecting robot made out of an old toy packaging, assuming that's the one you are referring to ;)

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

    Can you give me a summary for your project ?

    • @ModestMaker
      @ModestMaker  29 วันที่ผ่านมา +1

      The final project is up to you😊. This is only meant to give you the tools and code necessary to facilitate your own inventions.

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

    Yes I'd like to hook one of these stepper motors up to a microscope and then having a nano separate like look at the sample results in a centimeter cubes hand sample container using a small pump with it they sell these you know they're really small water pump electric Free trainer model online Jetson nano haven't look for your coli or parasites that are known to be issue in places like Africa were 250 million children are affected by parasites and you know they're also not getting enough nutrition and no matter how many of those peanut butter packets the United Nations food agencies giving them they aren't able to absorb it because they have parasitic for the people local people to know what the condition of their water is at any given moment is it is a good idea. People have the results of a Raymond spectroscopy a microscopic analysis of the water on The edge 200 Reno and a nano like a system-on-a-chip. I mean this is really taking the edge to the edge. I have the idea but I could never do this coding myself I don't know how. I could do the tensor. I can only learn so much so quickly. This would be a project for more than one

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

      It's a good idea. The coding isn't too bad if you take it in very small steps- one piece at a time. That's coming from someone who was never formally trained outside of a class at my local community college, but I've managed to take ideas like these to fruition by breaking the problem down into small pieces. One of my old colleagues at work used to say: "Eat the elephant, one bite at a time."

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

    Awesome video, good job, subscribed, @arduinomaquinas thanks you 👏👏👏👏👏 like 727.

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

      Thanks for subscribing- glad it was helpful😊!