Arduino Tutorial 35: Understanding How to Use a Stepper Motor

preview_player
Показать описание
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

In this lesson we show you how you can control a stepper motor using the Arduino. We show how to operate the motor in both directions and how to control the speed.

You can get the kit I am using for this series at the following link:

Follow these lessons on our WEB site:

#Arduino
Рекомендации по теме
Комментарии
Автор

Currently in my second year of aerospace engineering at university and have never touched an Arduino or C++ before and was given a project requiring the use of multiple stepper motors, sensors, buttons and LEDS and I cannot stress enough how much these videos have helped me. Thank you so much for making such high quality free material! I know there will be others like me in similar situations and your videos will have saved them as much as me.

thomasmiller
Автор

This channel is a gold mine! I’ll definitely be working through your arduino and RasPi series!!! Wish I would’ve had a teacher like you when I was in high school. 👍

mxcollin
Автор

For those that are doing this with the kit, please note that the supplied 9V battery may not be sufficient to drive the stepper motor (via the driver). When I first tried with the supplied battery, the stepper motor made a noise but didn't turn. I then swapped the supplied battery with a new one, and the stepper motor turned. Thanks to Paul for these excellent videos.

Seftdelmer
Автор

You, sir, are the Bob Ross of engineering. Thank you for your great tutorials.

JonPeroutka
Автор

I am following you since lesson 1, and i would like to say I was able to do homework on my own. thanks to you.

sandeepjadhav
Автор

Thank you so much for these wonderful tutorials! As an ecology student, I have never in my life touched anything to do with electronics or mechanics before watching your Arduino series. But now, 35 episodes later, I am amazed to say I can still follow along with everything. :) Every time you introduce a new part I get so many ideas for hobby projects! I genuinely never thought I would be able to understand anything to do with wires and circuits, but your explanations have made the impossible possible. Thanks again, you're the best!

bm
Автор

These are invaluable lessons and thank you Mr. McWhorter for taking the time (and the pain) to make them for our benefit. The synchronus presentation of the code, the printout and the experiment makes these lessons the best you can find in the subject. I had a little difficulty understanding the stepper commands that came out of nowhere but then I realized that these commands are hidden in the accompanying libraries. If you intend to devote one of your wonderful lessons in explaining Arduino librabries and how they "generate" the new commands we would be for ever grateful sir.

stefstaf
Автор

Before watching this, I just want to say that I wasn't sure if I was going to 'bother' going back to watch you first series, your 'lessons' on Adruino. But now I can say that I will definitely go and watch them also! I was looking for something specific and I found it in one of the lessons and, I have watched a couple of others too! At any rate, to my fellow followers/subscribers/learners, the first set of lessons Paul offered is definitely worth your time and effort. Thank you Mr. McWhorter!

misterdecaro
Автор

That last bit there put into the void loop threw my brain a curveball. Finally figured out it was "buttonValOld=buttonValNew;" as the last line of the void loop. Paul, I've been bingeing these lessons and crushed 35 in three days. You've done an incredible job, here. I knew nothing but was able to follow until you said "pause" AND THEN able to program this in my own way, unfortunately vastly different and of course with different results than you were able to provide here. Things happened, but it was still on delay and made a full rotation and then reversed. Invaluable lessons. THANK YOU!

gusmon
Автор

GIDDY UP. ok this dude rules. going back to the beginning and watching all of these because he's an awesome teacher!

sampleexamplemusic
Автор

I got it on my OWN!!! My confidence is growing!! Thank you so much Paul, you are an excellent teacher, and the best part of my day is coming home and doing these arduino tutorials with you, I look forward to them all day long. I used an if else statement, with a button value variable and a digitalRead command making the button HIGH with a digitalWrite command.I didnt even use buttonValNew or buttonValOld, I just used button val and I used If(buttonvalue==0) then the stepper commands, then else (buttonvalue==1) then the negative stepper commands.

donthomas
Автор

I'm a retired swede of 71. I've been an engineer for 50 years. My first experiece with computers was my Commodore 128 and Basic. I do remember the com speed of 9600 and sometimes even 2400. After that it has mostly been hardware. I discovered the Arduino and got interested. I stumbled on your videos and was hooked. After watching a number of them I realised I had to get the Super Duper Kit. So it is ordered but not yet received. So far i've watched your videos to the end, but programming them in my head, so when I get my kit I think I must start from scratch and do it irl. I've also noted that you have videos about RasPi and Python, so I don't need to be bored for a long time. I have a number of ideas that can be solved with the Arduino and some coding instead of a bunch of CMOS/TTL IC's. Like so many others in these comments i wish I had a teacher like you at school.

bjornakeSwe
Автор

I did it using lesson 28 as a base. My motor only reversed when it had reached 1 revolution because I'd left
the number of steps at 2048. My stepper direction was based on the button val. I now realise you can step 1 at a time, and in the same direction until told otherwise. Thanks Paul. It really is worth trying things yourself first, even if it's not quite right.

rogthedodge
Автор

This is definitely one of the lessons where you could have probably spent a bit more time explaining how the stepper motor works in this particular case. Pins 8, 9, 10 and 11 were used, but really not sure what they do.

MatlasX
Автор

I know it's an old video. I don't know if you read the comments here.

I did the homework as you said, without having seen your solution to that.

I did a attach.Interrupt and with it i called a function "reverse", ive made.

In this function, i reversed direction.

My quick and dirty way of spinning infinitely in the main loop, was to start of with "while (true)"

It's at least a very short code, by having the same outcome.

I've did a INPUT_PULLUP command on the pinmode. That works great.

Thank you Sir, for your educational videos.
Ive learnt a lot from you!

peterknoll
Автор

Racked my brains for a couple of hours trying this one, I got it to change direction but only after each full turn, excellent lesson, learning something new each time.

tretty
Автор

Unable to complete the homework on my own but grateful for the lesson! Thank you Paul!

TheSelfUnemployed
Автор

For those who had trouble doing this, take note of the right sequence of pin declaration which is 8, 10, 9, 11 as this is the right sequence for half step. I put the pin number in ascending order thinking it was just as simple as naming the pin number as I plug it in the arduino board. But no, the right order mattered. Took me a while to figure this out.

ericroque
Автор

I did it. I only had a couple of differences. I did 10 steps per loop and I changed direction on button release instead of button push. Thanks for doing this series!

wayneandersen
Автор

ordered my kit finally, with your link. I have a different kit that doesn't have all the same components. This is a great series. Thanks for taking your time Paul.

flyboypat