// include Arduino stepper motor library #include // define number of steps per revolution #define STEPS 32 // define stepper motor control pins #define IN1 11 #define IN2 10 #define IN3 9 #define IN4 8 // initialize stepper library Stepper stepper(STEPS, IN4, IN2, IN3, IN1); // joystick pot output is connected to Arduino A0 #define joystick A0 void setup() { } void loop() { // read analog value from the potentiometer int val = analogRead(joystick); // if the joystic is in the middle ===> stop the motor if( (val > 500) && (val < 523) ) { digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); } else { // move the motor in the first direction while (val >= 523) { // map the speed between 5 and 500 rpm int speed_ = map(val, 523, 1023, 5, 500); // set motor speed stepper.setSpeed(speed_); // move the motor (1 step) stepper.step(1); val = analogRead(joystick); } // move the motor in the other direction while (val
@WaqasFarooq3 жыл бұрын
@Jae Leidall I am glad it worked for you
@kassemjebbari22423 жыл бұрын
@@WaqasFarooq oke mercii beaucoup sa fonctionne
@kassemjebbari22423 жыл бұрын
I have a question if I wanted to create a 2 speed stepper motor what could I change?
@WaqasFarooq3 жыл бұрын
@@kassemjebbari2242 you need to copy same lines of instructions for 2nd motor but with different Pin and alsoy axis oin of joystick to control that motor
@kassemjebbari22423 жыл бұрын
@@WaqasFarooq oke oke thank you I just finished my program I send it to you. would you tell me if it is good?
@m1ch3lr0m3r04 жыл бұрын
Nice tutorial! I found it useful but I think some beginners wouldn't find it so, the verbal explanation is a must in this sort of tutorials where code from specialized libraries is used.
@WaqasFarooq4 жыл бұрын
Glad it was helpful!. I agree with you. In the future i will add my voice over as well so everyone can understand
@ericvigneron16103 жыл бұрын
I love it !!! no blabla, very clear vid.
@WaqasFarooq3 жыл бұрын
I am glad that you loved this video and thank you for watching and subscribing my channel
@Math-rg2ee3 жыл бұрын
The program you are working with ???? Tinkercad ???
@WaqasFarooq3 жыл бұрын
this one is fritzing to draw circuit diagram
@wolontong4 жыл бұрын
what is this software that you are using?
@WaqasFarooq4 жыл бұрын
I am using Fritzing for make this schematic here the link fritzing.org/ Thank you for commenting and subscribing
@hanscarlosirch80443 жыл бұрын
what software are you using?
@WaqasFarooq3 жыл бұрын
the software I am using in this video is Fritzing
@hanscarlosirch80443 жыл бұрын
@@WaqasFarooq thanks a lot
@hanscarlosirch80443 жыл бұрын
Are there other similar free programs like Fritzing?
@WaqasFarooq3 жыл бұрын
@@hanscarlosirch8044 you can use tinkercad.com website
@hanscarlosirch80443 жыл бұрын
@@WaqasFarooq thanks
@j83telbatalv3 жыл бұрын
Thank you the video was so helpful but i just wonder what is the name the program that you used in the beginning?
@WaqasFarooq3 жыл бұрын
for circuit diagram i have used Fritzing software you can download it by going to this link fritzing.org/
@j83telbatalv3 жыл бұрын
@@WaqasFarooq thank you so much
@WaqasFarooq3 жыл бұрын
@@j83telbatalv you are welcome and thank you for subscribing my channel
@juantap57404 жыл бұрын
I like how he include the debugging
@WaqasFarooq4 жыл бұрын
i am glad you liked it ,consider subscribing my channel
@DSmediaFotoFilm3 жыл бұрын
can you help me please? How can I limit the directions of rotation 90 degrees to the left and 90 degrees to the right?
@WaqasFarooq3 жыл бұрын
you can use limit switches or you may can use servo motor instead
@enriquesandoval43704 жыл бұрын
Hello, I have a question, what is the function of line of code 2 "define STEPS 32"
@WaqasFarooq4 жыл бұрын
step count for stepper motor
@ghostnoobxdlol Жыл бұрын
i cant find the stepper motor and the ULN2003
@ericvigneron16103 жыл бұрын
Very good work. It works good. Program is not really academic, but it works good. Little problem: when I move the joystick, and release it, the stepper is still turning slowly, and of course, the LEDs on the stepper card are blinking. If I disconnect the arduino and reconnect it, the stepper stands still and stays like that if I do not touch je joystick. As soon as I touch the joystick, it works, if I releasing the joystick, I have the same result, the stepper is moving slowly. If you have a little time to see that...... Anyway, thank you for releasing your program.
@WaqasFarooq3 жыл бұрын
there is little delay in code you can reduce the code delay
@DSmediaFotoFilm3 жыл бұрын
@@WaqasFarooq i have the same problem. what do i have to do to stop the engine and stop turning
@WaqasFarooq3 жыл бұрын
@@DSmediaFotoFilm no when you will release the joystick it will automatically stop
@DSmediaFotoFilm3 жыл бұрын
@@WaqasFarooq Can you limit the number of steps? I want to do a follow focus for my DSLR camera
@WaqasFarooq3 жыл бұрын
@@DSmediaFotoFilm yes it is possible if you want smooth movement and for you camera slider its better to use NEMA 17 Stepper motor
@tanmaymanwar633311 ай бұрын
Bro I could not find that green motherboard in thinkercad. That connects motor and arduno. Please tell bro how to add that thing
@WaqasFarooq11 ай бұрын
you can download the fritzing file from fritzing.org of stepper motor by just google it and you will .fzz file extension file import into you software then you will be able make a circuit diagram and thank you for watching
@vaishnavivaishnavi10525 жыл бұрын
How to use rtc instead joystick. To on stepper motor specific time.
@WaqasFarooq5 жыл бұрын
well that's pretty cool idea i think i will make it. its will be a very cool project for time-laps camera slider for video content
@trevorwilson54573 жыл бұрын
Got it all working, any advice on which line(s) of code to modify if I wanted to make the motor turn faster? Thanks :)! Great video by the way!
@WaqasFarooq3 жыл бұрын
28byj-48 stepper motor has its own limitation and running on its max speed but if you need higher speed then you have to use NEMA 17 stepper motor which is also bigger in size, futher you can search about NEMA stepper motors and its standards along with its data sheet
@WaqasFarooq3 жыл бұрын
Thank you for watching and subscribing my channel
@sswapnil6569 Жыл бұрын
Which Software is this?
@WaqasFarooq Жыл бұрын
Fritzing is the name of software you can download it easily by going to fritzing.org
@israeln8644 жыл бұрын
Hi; i wand to add one more stepper, what i have to do? thanks
@WaqasFarooq4 жыл бұрын
you want to control two stepper motors with one joystick . i will make a video and share it with you.
@michaelkroon4094 жыл бұрын
@@WaqasFarooq i want to control an Motirized camera gimbal, driven by 2 nema 17 Steppers and 2 L298n as Stepper drivers. So one Stepper has to drive the Horizontal Movement and the other the Vertical. can you help me with the Scatch? An option is to get an Home position if i klick the joystick button and it find his Home positions with 2 inductive Proximity Sensor Switches.
@WaqasFarooq4 жыл бұрын
@@michaelkroon409 you want to make gimble with two stepper motors right. i will make tutorial soon
@musaaftabi6269 Жыл бұрын
Its exactly what i need . i have a question. How to increase or decrease the stepper motor speed ?
@WaqasFarooq Жыл бұрын
basically joystick has variables inside it speed depends on how much further you push the joystick up or down
@pavletrnic14334 жыл бұрын
What is the name of the simulator program at the beginning?
@WaqasFarooq4 жыл бұрын
Fritzing and also tinkercad you can use both
@etstudio17902 жыл бұрын
Nice..I want to connect one stepper motor (5v), 3 servos, 1 display where the button performs a cycle while the lock button repeats the cycle. the display adds up the number of cycles. do you want to help me? :(
@ruaaalsalman80412 жыл бұрын
what program are you using ?
@WaqasFarooq2 жыл бұрын
fritzing .thank you for watching and subscribing
@galax42104 жыл бұрын
Can u please say me the software which you used for designing. I have subscribed your channel.
@WaqasFarooq4 жыл бұрын
I have use Fritzing software for designing here is the link to the website fritzing.org/ Thank you so much for watching and subscribing to my channel i really appreciate it
@galax42104 жыл бұрын
Thanks for saying the software name. 😁
@WaqasFarooq4 жыл бұрын
@@galax4210 you are welcome
@fatmazahramahmoudi9331 Жыл бұрын
is it a free software or payfull one ???@@WaqasFarooq
@bilalabdullah7352 жыл бұрын
Can I use Arduino nano will it work
@ESTUDIOSSR5 жыл бұрын
how can i add a ramp up and down. to start easy and stop smooth?
@WaqasFarooq5 жыл бұрын
yes in this tutorial you can see that how much you push the joystick. it depend on how much further you push the joystick knob
@WaqasFarooq5 жыл бұрын
maybe you want to vary the speed of start and stop with poteniometer
@armwrestling_nerd5 жыл бұрын
A suggestion is not to draw power from the Arduino, it has not so much amperage to drive motors. Put the stepper driver to an own power source that can give the amperage that the motor wants and put the Arduino and driver on common ground.
@WaqasFarooq5 жыл бұрын
@Pelle Chamliden thank you for your suggestion , i have faced this problem when i was working with Nema 17 Stepper motor, so i provided power to motor driver from external source and common the ground wires of arduino and external source, but actually stepper motor driver also need a ground from arduino, you can check out my other videos, thanks again
@mibrahim42455 жыл бұрын
@@armwrestling_nerd this 5v stepper doesn't draw that much current that needs an external vcc ...
@zachhoffman85142 жыл бұрын
What would I have to do to make it so that it runs 2 stepper motors. I would like to know for a project
@WaqasFarooq2 жыл бұрын
here is the link to 2nd video kzbin.info/www/bejne/eWHVfYuHra2aa9k thank you for watching and subscribing my channel
@zachhoffman85142 жыл бұрын
@@WaqasFarooq Thank you very much for the tutorial. I'll probably use your channel for more Arduino projects.
@WaqasFarooq2 жыл бұрын
@@zachhoffman8514 thank you so much I really appreciate this and hopefully I will upload more useful tutorials
@lacenaepronta4 жыл бұрын
Thank you. This is exactly what I was looking for. I read on the forums that is dangerous to power the motor directly with arduino. You should use an external power supply with shared grounding. Is it right?
@WaqasFarooq4 жыл бұрын
I am glad you like it. 28byj-48 motor only needs 5 volts you can provide it from Arduino and also use external power supply
@glennbelga31514 жыл бұрын
When I verify the code, exit status 1 ' IN4' was not declared in this scope ... What is missing?
@WaqasFarooq4 жыл бұрын
its because you did not declared the IN4 Pin actually. Try to copy the code from my pinned comment, it works,
@WaqasFarooq4 жыл бұрын
Thank you for subscribing
@glennbelga31514 жыл бұрын
@@WaqasFarooq I copied the codes and checked it again, but same error message, IN4 was not declared, I update also the libraries! Any advice much appreciated thanks
@WaqasFarooq4 жыл бұрын
@@glennbelga3151 try to reinstall your Arduino IDE sometimes it happens ,because i compiled this code again its compiles successfully
@emanfatima5643Ай бұрын
@@WaqasFarooq sir where is your pin comment ?
@done73094 жыл бұрын
how can I control the speed of the ateppers
@WaqasFarooq4 жыл бұрын
in this video the speed of stepper motor depends on how much you push up and down joystick knob
@done73094 жыл бұрын
@@WaqasFarooq - i need a heiger maximum speed
@WaqasFarooq4 жыл бұрын
@@done7309 28BJY-48 stepper motor speed is not slow not as NEMA 17 stepper motor . on top of that this stepper motor running on 5volts if you apply 12 to this small stepper motor you maybe result in burning it up
@sakegalama44014 жыл бұрын
my stepper motor wont stop spinning, i can let the motor to spin left or right but not let it stop.
@WaqasFarooq4 жыл бұрын
kindly check your joystick connection it maybe happening due to loss connection
@johndoveysalvador55322 жыл бұрын
hello, i love your video btw, but i have a problem. my joystick is different from your joystick my joystick is: grnd +5V Vrx Vry SW
@WaqasFarooq2 жыл бұрын
I am really appreciating you like my videos and +5 will connnect wit +ve and GND goes to -ve and Vrx Means Up and Down and Vry mean left and right
@Vidsro243 жыл бұрын
I got a big problem, I connected everything and verified the code and when I complied it, It happens nothing with the joystick and the motor
@WaqasFarooq3 жыл бұрын
code is working fine check your joystick connection mostly it happens due to lost connection check the stepper motor connection as well and select the right board in the option
@tanmaymanwar633311 ай бұрын
Bro this software fritzing is paid. And when downloaded mod version I cannot find 28byj 48 with module. Can you tell me how to find it in normal version. I want that setup
@WaqasFarooq10 ай бұрын
it used to be free software.
@hazghaz72234 жыл бұрын
how to make the motor back to original position when joystick is released
@DSmediaFotoFilm3 жыл бұрын
Merhaba, 90 derece sağa ve 90 derece sola kısıtlama nasıl yapılır?
@nuranuzar5 жыл бұрын
merhaba kodu yazdım fakat çalışmıyor motor sıkışıyor (mıknatıslaşıyor)
@@WaqasFarooq hata veriyor kod için teşekkür ederim exit status 1 stray '\357' in program
@WaqasFarooq5 жыл бұрын
open arduino IDE and go to => Tools => then click on Fix Encoding & Reload . after that look into the code and check if you see and characters which are show at the line where you getting this error
@nuranuzar5 жыл бұрын
@@WaqasFarooq merhaba dediğinizi yaptım şu an 5 voltluk motor ilk tek tarafa dönüyor lakin joystick ile sağ yavaş sol hızlı dönüyor 12 voltluk motor ise hiç çalışmıyor
@ddb44 жыл бұрын
mine just spins and spins when I run it, I cant control it at all, but it spins. any ideas?
@WaqasFarooq4 жыл бұрын
i think your joystick connection is loose if the connection is not secure well then stepper motor starts spinning and won't stop
@ddb44 жыл бұрын
Waqas Farooq yea I just realized the connection I did was wrong
@WaqasFarooq4 жыл бұрын
@@ddb4 I am glad to help you please do subscribe my channel
@-thehindu2 жыл бұрын
same problem with me when i uploaded the program motor starts rotating even i didnt connected the joystick any suggestion??
@joli50365 жыл бұрын
I have an error. it says: expected initalizer before 'void'. I don't know what the problem is. can someone help me?
@WaqasFarooq4 жыл бұрын
kindly check your libraries or try to reinstall arduino software
@spontique74694 жыл бұрын
i have an error it says speed_ is not declared in this scope
@WaqasFarooq4 жыл бұрын
// include Arduino stepper motor library #include // define number of steps per revolution #define STEPS 32 // define stepper motor control pins #define IN1 11 #define IN2 10 #define IN3 9 #define IN4 8 // initialize stepper library Stepper stepper(STEPS, IN4, IN2, IN3, IN1); // joystick pot output is connected to Arduino A0 #define joystick A0 void setup() { } void loop() { // read analog value from the potentiometer int val = analogRead(joystick); // if the joystic is in the middle ===> stop the motor if( (val > 500) && (val < 523) ) { digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); } else { // move the motor in the first direction while (val >= 523) { // map the speed between 5 and 500 rpm int speed_ = map(val, 523, 1023, 5, 500); // set motor speed stepper.setSpeed(speed_); // move the motor (1 step) stepper.step(1); val = analogRead(joystick); } // move the motor in the other direction while (val
@WaqasFarooq4 жыл бұрын
Copy this code and also install the libraries for it,
@_The_Unreal_3 жыл бұрын
Simulator?? Plz
@WaqasFarooq3 жыл бұрын
you can do the simulation on tinkercad and proteus this software is fritzing you can only make diagram
@_The_Unreal_3 жыл бұрын
Can you tell me a simulator name that i can found all component i need like joystick stepper motor and others
@WaqasFarooq3 жыл бұрын
@@_The_Unreal_ you can use proteous because you can make joystick into it, tinkercad does not have joystick
@_The_Unreal_3 жыл бұрын
Thanks
@WaqasFarooq3 жыл бұрын
@@_The_Unreal_ thank you for watching and subscribing my channel
@christianduranvela4 жыл бұрын
reales gracias tu aporte es un gran trabajo
@WaqasFarooq4 жыл бұрын
Thank You , I am glad you like and thank you for subscribing
@enayathabibi31004 жыл бұрын
can you give me the full code
@WaqasFarooq4 жыл бұрын
// include Arduino stepper motor library #include // define number of steps per revolution #define STEPS 32 // define stepper motor control pins #define IN1 11 #define IN2 10 #define IN3 9 #define IN4 8 // initialize stepper library Stepper stepper(STEPS, IN4, IN2, IN3, IN1); // joystick pot output is connected to Arduino A0 #define joystick A0 void setup() { } void loop() { // read analog value from the potentiometer int val = analogRead(joystick); // if the joystic is in the middle ===> stop the motor if( (val > 500) && (val < 523) ) { digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); } else { // move the motor in the first direction while (val >= 523) { // map the speed between 5 and 500 rpm int speed_ = map(val, 523, 1023, 5, 500); // set motor speed stepper.setSpeed(speed_); // move the motor (1 step) stepper.step(1); val = analogRead(joystick); } // move the motor in the other direction while (val
@WaqasFarooq4 жыл бұрын
also subscribe and share
@enayathabibi31004 жыл бұрын
Thank you.
@WaqasFarooq4 жыл бұрын
@@enayathabibi3100 you are welcome, Subscribe for more video
@gurugerus7 күн бұрын
Thank you! (Y) workt well
@WaqasFarooq7 күн бұрын
Glad it helped! Watch more videos
@pandyavivek36513 жыл бұрын
WebSite please ???
@WaqasFarooq3 жыл бұрын
www.fritzing.org
@deibyjesusrinconlopez7273 жыл бұрын
library pleaseeeeee
@WaqasFarooq3 жыл бұрын
github.com/Stan-Reifel/TinyStepper_28BYJ_48 download it from this link
@JoseMendez-bk5re3 жыл бұрын
Thank you so much!!!!!!
@WaqasFarooq3 жыл бұрын
you are welcome and thank you for watching and subscribing my channel
@bricolages62393 жыл бұрын
Merci tuto clair et nickel.
@WaqasFarooq3 жыл бұрын
i am glad you liked it and thank you for subscribing my channel
@ozgurgoksu83854 жыл бұрын
perfect
@WaqasFarooq4 жыл бұрын
thank you
@TheManK-B4 жыл бұрын
OH that's perfect 👌thanks If you don't have problem give me the code please i waiting you .😊
@WaqasFarooq4 жыл бұрын
i have pin the code in comment section you can copy it. Thank you for watching and subscribing my channel
@vaibhavarepaka22815 жыл бұрын
speed_ was not declared in this scope
@WaqasFarooq5 жыл бұрын
okay you should download some libraries and then try to compile the code it will work
@terrybomerscheim81654 жыл бұрын
@@WaqasFarooq Hello, nice work here, thank-you. I too am getting" speed was not declared in this scope" error. I have at top of code. What other library do I need to get this to run?
@WaqasFarooq4 жыл бұрын
@@terrybomerscheim8165 you need to download this library as well "stepper. H " this is also a library
@terrybomerscheim81654 жыл бұрын
@@WaqasFarooq Well Sir , thank-you, I get this bugger to work. There sure wasn't a library, (you were playing with me there), but the "speed" declaration was fixed by dropping the (_) underscores after the word " speed " in the code. And didn't need any C++ OOP Black Magic F*ckery.
@WaqasFarooq4 жыл бұрын
@@terrybomerscheim8165 I am glad it worked for you. thank you for pointing out this mistake
@abdellahouarhim29944 жыл бұрын
SVP LE CODE
@WaqasFarooq4 жыл бұрын
check my pinned comment
@stevenA445 жыл бұрын
Lose the damn music and TALK DAMMIT!!
@WaqasFarooq5 жыл бұрын
Thanks for your concern i will put voice over on the future videos and thanks for commenting , I really appreciate your sugesstion
@AkınHarrd5 жыл бұрын
@@WaqasFarooq its a pretty song tho
@WaqasFarooq5 жыл бұрын
@Trebuchet thank you i really appreciate that😊
@stevenA445 жыл бұрын
@@AkınHarrd It is nice music, I'll admit that.
@kassemjebbari22423 жыл бұрын
j'ai une erreur au void setup je ne sais pas pourquoi le message dis "Arduino: 1.8.13 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)" Analog_Joystick_step_motor_kassem:12:1: error: expected ',' or ';' before 'void' void setup()'{' ^~~~ C:\Users\admin\Documents\Analog_Joystick_step_motor_kassem\Analog_Joystick_step_motor_kassem.ino: In function 'void loop()': Analog_Joystick_step_motor_kassem:40:3: error: expected ';' before '}' token } ^ Analog_Joystick_step_motor_kassem:40:3: error: expected '}' at end of input Analog_Joystick_step_motor_kassem:40:3: error: expected '}' at end of input exit status 1 expected ',' or ';' before 'void' This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
@WaqasFarooq3 жыл бұрын
you need to select the correct port and Arduino board