The Cheapest Stepper Motor And How You Use It (28BYJ-48 & ULN2003 Arduino Tutorial!) (WITH CODE!)

  Рет қаралды 106,118

Simple Electronics

Simple Electronics

Күн бұрын

Пікірлер: 91
@parz7150
@parz7150 2 жыл бұрын
This guy says he’s not a programmer the same way teachers say their not an artist when drawing, love the content 👌🏻
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
Haha glad you liked it!
@JillRhoads
@JillRhoads Ай бұрын
As a teacher, I feel so flattered!
@glazedvc
@glazedvc 2 жыл бұрын
I've been looking for so fucking long, a single code that allows me to reverse the stepper direcction and the "crappy" one is the only one that worked, thank you so much
@luigipasta9496
@luigipasta9496 Жыл бұрын
bro nothing is garbage, you are doing your best and that it's important.... keep moving forward!!!
@Brandon-qp7gq
@Brandon-qp7gq 3 жыл бұрын
Thank you for explaining that both the arduino and stepper motor can be powered from the same 5V external source. I'm an electronics noob, and I just went through like 5 other videos to try to find out how to power both devices, and strangely enough no other video creator bothered to mention the power supply for the arduino. So thank you for clarifying!
@peterknoll8906
@peterknoll8906 9 ай бұрын
Nice video! I like the honest way of presentation. Yes. For that task, I would go with "attachInterrupt" to change direction whenever a button is pressed. Whatever happens in the main loop, the interrupt will execute. Even if the mainloop "stuck" in a delay function. Interrupts always have precedence. But as you mentioned: the code you shown is not perfect. I really like the honest way of your presentation. Your focus was on the very basic operation of the stepper and the code. Mission accomplished! 😊
@GnuReligion
@GnuReligion 3 жыл бұрын
Half-steps and acceleration are fun to play with. You can get the thing spinning faster than it ordinary can, with acceleration control. For 2 steppers, a ULN2803 has 8 outputs, so you can control two with 1 darlington array.
@samwillard5688
@samwillard5688 Жыл бұрын
These motors are common in microwaves, but in a 120 V version. They are very strong. Thanks for the code! Just getting started on Arduinos. Great work, your imagination is very impressive!
@AntonioRuelas-l6m
@AntonioRuelas-l6m 7 ай бұрын
did the code work well?
@samwillard5688
@samwillard5688 7 ай бұрын
@@AntonioRuelas-l6m I am still getting organized while i learn. I haven't had time just yet, but will let you know. Thanks for the follow up!
@car_ventures
@car_ventures 2 ай бұрын
13:15 I'm curious if when the motor reaches the outer bound, the resistance seen by the motor changes (likely seen as a change in voltage e.g. voltage drop), if this location can have this moment logged, which it then uses as a stored value to change rotation. Effectively make it self learn it's outer bounds in both sides. Run it for a couple of cycles until it rotates fully without any resistance/voltage drop. This would also help the motor from doing too much extra work increasing is longevity. Could maybe program it to recheck those bounds every 100 cycles or so incase any tolerances have caused a change in position.
@greaterthanbut
@greaterthanbut 2 жыл бұрын
Awesomeness… love the way you printed out your code and explained.
@britinrussia3687
@britinrussia3687 8 ай бұрын
I'm a newbie to all this, your video is brilliant! Explains a lot, understandable and clear! Thank you!!!
@fals3illusion
@fals3illusion 8 ай бұрын
Thanks, I just wanted to find a way to make the motor constantly rotate, forever and your code was the easiest one !
@hydrolisk1792
@hydrolisk1792 6 ай бұрын
Thumbs up mate!!! Please expand your knowledge some more, you are doing a great job here. My suggestion on where to go next would be to learn about millis(). This is way better than using delays considering delays completely stop the code from running whilst a delay is in progress. Start with looking at the blink without delay code built in to the arduino IDE. This will help you later on when making more complex programs :P
@syuhadanabilah3902
@syuhadanabilah3902 2 жыл бұрын
Hi, I have 12V stepper motor. I'm new about this so when the staff asked me if I want to buy 5V or 12V..I bought 12V. Can I connect the 12 V stepper motor to 5V power supply on Arduino Mega?
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
You can try but it will be quite low power if it works at all
@sumitjangra9793
@sumitjangra9793 5 ай бұрын
Use external battery for 12v supply and single cable connection with Arduino board
@Luposian
@Luposian 11 ай бұрын
I have an application, where I need to apply 14oz of force (pull or push, I assume is the same diff) to trigger a switch. Can this stepper motor do that or do I need a different/better one? If so, any suggestions?
@davidbroadfoot1864
@davidbroadfoot1864 11 ай бұрын
Torque is the issue ... not Force. So how far away from the axis of the stepper motor does this have to happen?
@Luposian
@Luposian 11 ай бұрын
@@davidbroadfoot1864 Assuming a small gear or pulley were attached to the spindle of this stepper motor and it was tied (with a string) to a 14oz weight (the stepper motor being fixed to a board or something), could it pull hard enough to reel in that 14oz weight? I assume a 14oz weight is 14oz, regardless if it's parallel to the stepper motor or on the floor, etc.
@ememeable
@ememeable 2 ай бұрын
Beautiful Programming I remember my humble beginnings I now laugh at how resourceful the mind can be with limited programming knowledge Every 2yrs and as we advanced the past seems ever so comical I now use pic mcu's however I still appreciate arduino my humble beginning I hope to find other uses for rid switches so that they still remain relevant and keep some people employed This is the ethics behind programming and advancements I try to promote good standard of living and not redundancies as I was once made redundant Sincerely Mr Ejike Ememe
@rgbcrafts
@rgbcrafts 8 ай бұрын
5:10 So, if I need only it spinning on the lower speed in a constant motion, do I have to use an Arduino? All I need is it spinning in the lowest speed possible for my project. Other motors (DC motors) are way to loud and stepper motors are really quiet in comparison. Would it suffice only using the ULN2003 and the stepper motor? Maybe a turn on/off button maybe?
@d.jensen5153
@d.jensen5153 21 күн бұрын
Informative, and I like your style. Thanks.
@thecodingfox
@thecodingfox 7 ай бұрын
Thank you for this tutorial. Simple, to the point, amazing job :D!
@britinrussia3687
@britinrussia3687 8 ай бұрын
How about a switches on the end of the stick, one on each side, if you could measure the time between each switch activation, it would work like a white stick for a blind person, on a mobile base his could find its way through an obstacle course.... A mechanical radar... What do you think?
@oldm8alfie
@oldm8alfie Жыл бұрын
Once you use the arduino to write the code to the controller, can you unplug the arduino ?
@SimpleElectronics
@SimpleElectronics Жыл бұрын
No sir, the Arduino is constantly controlling the motor - the chip only turns the signals into a source strong enough to power the motor
@oldm8alfie
@oldm8alfie Жыл бұрын
@@SimpleElectronics Thankyou!
@astro_aviral
@astro_aviral 5 ай бұрын
How can i change the direction of the steeper Motor in the first example , I am making a star tracker but I want to reverse the direction of rotation 🙏🏼
@rmilo
@rmilo 2 жыл бұрын
thanks, I'm going to use this for an automatic dog feeder
@d.jensen5153
@d.jensen5153 21 күн бұрын
Yes. Did something like that for my cats to cancel neighborhood marauders. Each cat had a tiny tuned circuit pendant on their collar. A coil near the feeder was part of a dip meter. Cat gets near. Resonance is detected. Food door opens.
@NealeOxley
@NealeOxley Ай бұрын
I wish to use a stepper motor to brush spiderwebs away from the lenses of my video surveillance cameras. Maybe a very light soft brittle brush directly wiping across the lens and a light 45 degree arm to wipe the abseiling spiders further out from the camera by a foot. I have to use a long stick and paint brush regularly and 10 minutes later the spider is back like a ninja.
@NilfNilf1972
@NilfNilf1972 14 күн бұрын
Try a servo motor, it’s even easier to control, and you can set it to desired (absolute) positions, which a stepper can’t do.
@onizuka2687
@onizuka2687 9 ай бұрын
I have 2 of these motors and I want to control them using the Arduino uno and a gyroscope mpu6050 , do I need an external power supply to power them or cable connected to the PC and 5v from Arduino should be fine ? Please answer
@SimpleElectronics
@SimpleElectronics 9 ай бұрын
depends on the load - when in doubt, just use an external supply
@alexgrant8851
@alexgrant8851 13 сағат бұрын
What’s the load max for this ?
@xrphobby1341
@xrphobby1341 7 ай бұрын
How is it possible to rotate the motor 18degress each time the button is pressed? Thank you
@nevin6571
@nevin6571 Жыл бұрын
When i turn on my stepper motor , it just vibrates bit the shaft doesnt rotate , does anybody experience the same issue ?
@DancerVlt69
@DancerVlt69 Жыл бұрын
What you should do is check * the connections -> PIN 1/2/3/4 of the ULN-Board must go to PIN 8/9/10/11 on the Arduino * the code (6:05) -> the order of the pins is important -> Stepper stepperName = Stepper(stepsPerRev, 8, 10, 9, 11); * the value of the speed -> stepperName.setSpeed(15) - in my test/case a value higher than 15 let the motor losing steps if are all correct and the motor doesn't work correctly, check the power for the motor. The motor (I've got today) has a consumption of 330mA at 3 to 7 volts. In my case I've connected the motor to a 9V block-batterie.
@jhebertdelacruz5437
@jhebertdelacruz5437 2 ай бұрын
Idk if this is possible but how do I make it so the motor rotates slowly at 45°, and back when power is disconnected
@hardwark.official
@hardwark.official 3 ай бұрын
Hi, can we use this without driver? If i just need to make something, rotate indefinitely
@SimpleElectronics
@SimpleElectronics 3 ай бұрын
No you can't - but to just make something spin indefinitely, just get a regular DC motor - you can adjust the voltage or the current to control the speed - set it and forget it!
@hardwark.official
@hardwark.official 3 ай бұрын
@@SimpleElectronics Thank you so much
@CDE.Hacker
@CDE.Hacker 3 жыл бұрын
I can think of two things: First, kind of an art thing. Picture this, a 3X 5 canvas where there's two of those servos, one on each side kind of pretending to paddle a ping pong ball back and forth. The other idea, something practical. Like having a motion sensor trigger the servo to wave a flag. You know something fun. 👍
@ralphrego7470
@ralphrego7470 2 жыл бұрын
Hi, what I am looking for is my stepper motor to start with a switch running clockwise and stop after about 5 full 360 turns, for an indefinite period of time, then it will reverse when the switch is turned off back to it original position. Could you help me?
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
Sure, which part of your code isn't working? You can email me what you have so far and what it is doing and I'll have a look
@ralphrego7470
@ralphrego7470 2 жыл бұрын
@@SimpleElectronics I don't have any code as I have never done anything like this in my 63 years on planet earth. Totally new to this stepper motor stuff.
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
Ah well, surely you understand that I can't really build projects for everyone who asks me to, but that's why I make these videos, to empower you to build your own projects! I think the information in this video will get you pretty much exactly where you need to go!
@ralphrego7470
@ralphrego7470 2 жыл бұрын
@@SimpleElectronics I do understand, all I asking for is to write a code that will allow the stepper motor to turn clockwise 5 turns when I switch it on and then stop. Then when I turn it off it should turn counter clockwise 5 turns and stop. Then if I do run into trouble I will turn to you for guidance, if it is ok with you.
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
@@ralphrego7470 Sounds good, I believe in you!
@NitroVipers3
@NitroVipers3 Жыл бұрын
I need a stepper faster than that. Is that as fast as it goes?
@goesintite
@goesintite 2 жыл бұрын
Maybe make a practical application for this. Is this viable for RC projects? Like, servos run rutters, steering, etc, maybe this and the code you made will make something run semi-autonomous?
@brajarajsaha5955
@brajarajsaha5955 7 ай бұрын
can i use it for my diy 3d printer?
@AJB2K3
@AJB2K3 3 жыл бұрын
Make a variable speed photogrammetry table?
@jmakes3174
@jmakes3174 2 жыл бұрын
have you done it yet?
@AJB2K3
@AJB2K3 2 жыл бұрын
@@jmakes3174 Me? Yes and wrote a guide and posted it on hackster.io
@floroubaldo9403
@floroubaldo9403 Жыл бұрын
Hello, Why my stepper.h library not working? I tried accelstepper and it work just fine.
@EddieFox
@EddieFox Жыл бұрын
Wow. Awesone. Exactly what I need for blinking on robot eyes. I'm a year on, but as an arduino dunce (I can tweak but not write) could you pretty please nicely write a code that will blink eyes, a little faster and with say, 10 seconds intervals once switch activated to run permanently until deactivated? Well, you kindly offered. Btw I think your clip is brilliant. Even a simpleton like me can grasp it. I've brought you a choc orange just for the video, great. Don't worry if its a problem to write code. Cheers. :)
@SimpleElectronics
@SimpleElectronics Жыл бұрын
I am glad you liked the video but I am not in any shape to be taking on commissions at this time! check out the Arduino forums and reddit for some help! Make sure you give it your best shot before posting your code over there for help - but I am confident you can get it done - good luck!
@Alice8000
@Alice8000 4 ай бұрын
dude i never saw code on paper before. wow
@metallicaandchimaira
@metallicaandchimaira 2 жыл бұрын
For this motor do you HAVE to have it connected to an arduino? I have a motor speed control circuit and have it connected from the power to that. Then I am running the connections to the stepper motor board and it wont turn on :(
@bob-ny6kn
@bob-ny6kn 2 жыл бұрын
Once you get your code working, the next step is to challenge yourself to make your code textually less repetitious. Rather than two functions to tell the stepper backward and forward, write one function and pass the "backward" or "forward" direction to it. It's been a year, so you might have moved on.
@braylenhammond12
@braylenhammond12 2 жыл бұрын
Help my motor vibrates but doesn't spin
@SimpleElectronics
@SimpleElectronics Жыл бұрын
Is it hooked up fully? Are you sending the pulses too fast? try adding some delay.
@johnrc1647
@johnrc1647 3 жыл бұрын
Great video with clear explanations. I'll have to probe my XYL for Holiday decoration ideas. One suggestion -- Please find a place to rest your hands. extraham
@SimpleElectronics
@SimpleElectronics 3 жыл бұрын
I'm half-french, I can't talk without my hands
@ChickenPermissionOG
@ChickenPermissionOG Жыл бұрын
Isn't that ic a Darlington pair
@wandersonsilva-fx1cs
@wandersonsilva-fx1cs Жыл бұрын
I really enjoyed your class, congratulations! I have a question what is the maximum speed of this engine?
@saminpourrefaie3922
@saminpourrefaie3922 Жыл бұрын
i really enjoyed your video!!!
@BruceEarly
@BruceEarly 7 ай бұрын
Ok, newbe here!! My problem is everytime I compile the code it errors. It says "compilation error: expected '}' at end of input. Last of the code is ..... stepperName.step(stepsPerRevolution / 4); delay(50); buttonPressed = true; } What is wrong with this? By the way love your videos!!
@itsvaporx9633
@itsvaporx9633 2 ай бұрын
well i’m not a programmer but a have little background. you have a syntax error and it expected another “}” somewhere. it depends on the rest of the code previous. but somewhere in there, there is a opened bracket that you haven’t closed with the “}”
@tillytony
@tillytony Жыл бұрын
I have just come acroos your channel so havnt had a proper look. But if you havnt, could you do a tutorial om how to automticly have the motor speed up to x speed for x time and then slow down to a stop using a push button. Could you also show how to code a button press to slow and then stop the motor even if it hasnt got to full speed. I make funfair models for a hobby (I have videos on my channel) And my next project requires one button to start and stop the model.
@abdfa4909
@abdfa4909 4 ай бұрын
exactly what i wanted ,thnx man
@tamtgirl
@tamtgirl 3 жыл бұрын
i have a crap ton of ULN2003's now i know what to do with them
@PagedZero0
@PagedZero0 2 жыл бұрын
Thank you for the help!
@M4CHINE69
@M4CHINE69 Жыл бұрын
mine gets incredibly hot when running at 12v
@johnperry9357
@johnperry9357 2 жыл бұрын
Thank you very helpful tutorial
@klodilimani
@klodilimani Жыл бұрын
absolute life saver, thank you
@wonderwang1585
@wonderwang1585 2 жыл бұрын
Ilove this guy, he is funny and informative!
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
Thank you!
@graemebrumfitt6668
@graemebrumfitt6668 2 ай бұрын
stepper SpinnyMcspinface = Stepper TFS, GB :)
@damrus312
@damrus312 5 күн бұрын
thanks
@LordRichard987
@LordRichard987 Жыл бұрын
It don't have to be pretty, just as long as it works.
@nobbynose4254
@nobbynose4254 10 ай бұрын
great video thx
@AJB2K3
@AJB2K3 3 жыл бұрын
"Oh, I made a mistake" Well you have constantly warned people not to use the garbage code
@SimpleElectronics
@SimpleElectronics 3 жыл бұрын
Don't blindly use a mechanic's code, basically
@peterbenbow3932
@peterbenbow3932 5 ай бұрын
lovely
Beginner's Guide to Controlling Stepper Motors with Arduino
9:59
Rachel De Barros
Рет қаралды 33 М.
Big Stepper Motors with Arduino
29:43
DroneBot Workshop
Рет қаралды 1,2 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Modifying Cheap Stepper Motor To Be More Powerful (28BYJ-48)
6:22
JustAnotherMakerChannel
Рет қаралды 45 М.
How Stepper Motors Work - Electric motor
14:01
The Engineering Mindset
Рет қаралды 1 МЛН
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
Stepper Motors and Arduino - The Ultimate Guide
29:57
How To Mechatronics
Рет қаралды 1,2 МЛН
Arduino Tutorial 28- Understanding How to Use a Stepper Motor
9:01
Enjoy Mechatronics
Рет қаралды 57 М.
Make a TINY Arduino Drone with FPV Camera - Will It Fly?
20:26
Max Imagination
Рет қаралды 1,4 МЛН
Stepper Motors with Arduino - Controlling Bipolar & Unipolar stepper motors
50:22
Arduino Tutorial 35: Understanding How to Use a Stepper Motor
40:09
Paul McWhorter
Рет қаралды 305 М.