Тёмный

How Rotary Encoder Works and How To Use It with Arduino 

How To Mechatronics
Подписаться 678 тыс.
Просмотров 885 тыс.
50% 1

howtomechatronics.com/tutoria... ► Find more details, circuit schematics and source codes on my official website .
In this tutorial we will learn how rotary encoder works and how to use it with Arduino. A rotary encoder is a type of position sensor which is used for determining the angular position of a rotating shaft.
Visit HowToMechatronics.com for more Tutorials, Tips, Projects and How It Works videos:
► howtomechatronics.com/
Like my page on Facebook:
► / howtomechatronics
Add me on Google+:
►plus.google.com/+Howtomechatr...
Music: Aduro by Jens Kiilstofte (machinimasound.com/music)

Опубликовано:

 

25 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 268   
@badbush5
@badbush5 6 лет назад
Fantastic! Looking at pictures of waves just didn't do it for me. This video completely cleared it up. Thank you! Subscribed.
@cdweng840
@cdweng840 6 лет назад
Brilliantly explained from theory to application. Well done!
@fanBladeOne
@fanBladeOne 5 лет назад
Thanks once again for a greatly instructional video. After watching not only do you understand the principle behind it, you also have a piece of working code at the ready. Thanks alot :)
@waterman7733
@waterman7733 6 лет назад
your explanations are so clear, makes it easier to understand how this works. thank very much!
@mirkomueller3412
@mirkomueller3412 8 лет назад
Great tutorial !!! Helps me so much doing my current project. BIG THUMBS UP
@sgtrumbi2265
@sgtrumbi2265 5 лет назад
Just plain and simple explanation. Great video, exactly what I was looking for. Thank you so much! 😊
@vnesterov1817
@vnesterov1817 7 лет назад
You are the Man! Thank you: very clear and very consecutive instructions and video. Great job.
@mrcalico7091
@mrcalico7091 7 лет назад
Great Job, articulate and directly to the point. Thank You!
@mrcalico7091
@mrcalico7091 3 года назад
@Samir Ben This is spam
@256k_
@256k_ 2 года назад
Great stuff! I was initially looking at some library to handle this but it’s so easy thanks to your explanation I’ll just handle it myself
@sub-arts128
@sub-arts128 3 года назад
well done. thats the best explanation for rotary encoder i ve seen so far
@slimydroid
@slimydroid Год назад
Many thanks for the clear guide on how encoders work, I found the animated graphics particularly useful.
@camilo7087
@camilo7087 7 лет назад
please no stop .. you explain so good
@fouzaialaa7962
@fouzaialaa7962 8 лет назад
awesome seeing your videos again its been a long time since you uploaded a video !!
@voxellab4339
@voxellab4339 7 лет назад
Dejan, Great video! thank you. Got it to work. If I turn the dial to quick the nema jump, not smooth and has a pause when reveres. I've tried trimming the drive board and the delay times. Any idea?, thanks again for all you great work.
@SajalRajGautam
@SajalRajGautam 8 лет назад
Very helpful! Thank you so much! :)
@boharihamen
@boharihamen 6 лет назад
Thanks for the video. Great Job and effort to produce it.
@Sasch600xt
@Sasch600xt 7 лет назад
Thank you very much !!! Now i understand it :)
@yoramstein
@yoramstein 6 лет назад
Good explanation, thank you.
@0sekful706
@0sekful706 4 года назад
Amazing, thank's a lot!
@duneeshasuloshini8567
@duneeshasuloshini8567 5 лет назад
great explanation! Thanks a lot.
@NanoIndustries
@NanoIndustries 4 года назад
That's What I Want To Know Thanks
@thomashvnmusic
@thomashvnmusic 7 лет назад
Really helpful, thanks.
@cdersch636
@cdersch636 7 лет назад
Do you know the maximum speed of the decoder? Can it turn up to 200 rounds per minute? I tested once and it was not counting correctly - so the question is - was a problem with Arduino or with the mechanic of the decoder? Thanks you
@jaimeriquelme6727
@jaimeriquelme6727 Год назад
Thanks Mechatronics for your time and work. From Sydney all the best. 👍
@HowToMechatronics
@HowToMechatronics Год назад
Thank you too!
@HellaFunnyShorts
@HellaFunnyShorts 7 лет назад
great video. simply and to the point explanation
@GabrielSousa-hw4mg
@GabrielSousa-hw4mg 6 лет назад
omg you explain so good thanks
@jp040759
@jp040759 3 года назад
WOW. Finally I understand the rotary encoder logic. Best explanation I have run into in 10 years. Your description turned on the big light bulb on in my brain and I understand it now. The code is so simple too. THANX!!!!!
@efrailustun
@efrailustun 3 года назад
Great job bro, thanks for everything.
@Keith12001
@Keith12001 6 лет назад
Excellent videos, thank you
@afzalqureshi8091
@afzalqureshi8091 6 лет назад
output is different from the code it gives only negative values on CW or CCW direction.
@airfilm_it
@airfilm_it 6 лет назад
i would like to build a wireless follow focus for cine lens, what's your suggest?
@jeffbeck6501
@jeffbeck6501 6 лет назад
Thank you. Your code worked. I thought that Kevin Darrah's code using interrupts was working for me but it was not. It was skipping all around but your code works perfectly for me with no skipping at all. How u do dat? Thanks man.
@heshteach8212
@heshteach8212 7 лет назад
Grate job.. It was really effective for me.. thx alot and carry on..
@Three2NineProject
@Three2NineProject 7 лет назад
Simple and good explanation
@bekhzodkh
@bekhzodkh 8 лет назад
Nice and clear explanation, thanks for the video. I wonder is it possible to control the LED light intensity using this encoder?
@hammadahmad1137
@hammadahmad1137 8 месяцев назад
Just use a potentiometer DUH
@sakshamsangwan6811
@sakshamsangwan6811 5 лет назад
What is the least angle it can move ? For example If I connect it to a shaft of a robotic arm will it give 30 counts with 30 degree change ?
@ricardocalletejada6707
@ricardocalletejada6707 2 года назад
This is better than searching for confusing datasheets on the website. THANK YOU A LOT
@HowToMechatronics
@HowToMechatronics 2 года назад
Glad it was helpful!
@cakdham4607
@cakdham4607 8 лет назад
Awesome explaination.. Regards from Indonesia
@navtejsinghsaini4945
@navtejsinghsaini4945 7 лет назад
which animation tool did you use? Thanks
@TheJavaSync
@TheJavaSync 4 года назад
Dear Friend, pls, upload another ligh & simply tutorial like this, I loved it, Thx You !
@FOJOM13
@FOJOM13 3 года назад
Very informative! Thanks!
@salmaelasmai5065
@salmaelasmai5065 7 лет назад
thank you this was very helpful, but you didn't talk about the difference beetwen absolute and incremental encoders..
@antipainK
@antipainK 3 года назад
Great video, short and to the point :)
@HowToMechatronics
@HowToMechatronics 3 года назад
Glad you enjoyed!
@muratcanbarut64
@muratcanbarut64 5 лет назад
Very good explanation
@MrAdd25
@MrAdd25 3 года назад
thanks, the best explication!!!
@er.jugalmandal7736
@er.jugalmandal7736 7 лет назад
CAN U MAKE A VIDEO WITH IN MENU USING 16x2 LCD DISPLAY ???
@_bluespider5470
@_bluespider5470 6 лет назад
Great video!
@arjunjanardhanan3301
@arjunjanardhanan3301 8 лет назад
Again nice one ! Can you make a separate video on ADXL345?
@javierferrer4634
@javierferrer4634 5 лет назад
Nice video thank you!
@apbosh1
@apbosh1 7 лет назад
great tutorial thank you.
@loucostello3111
@loucostello3111 6 лет назад
This guy is the greatest.
@lukaszM46
@lukaszM46 6 лет назад
in this example was the encoder connected to 5v at the common pin and then pins A and B were connected to digital pins with pulldown resistors?
@denadaisicari
@denadaisicari 5 лет назад
So great, thanks!
@globalbusinessmachines3122
@globalbusinessmachines3122 2 года назад
You are my savior in ELECTRONICS.
@shubhamdubey3585
@shubhamdubey3585 6 лет назад
Nice video buddy keep it up :)
@dgb5820
@dgb5820 6 лет назад
Great instructional video
@LifeGeneralist
@LifeGeneralist 3 года назад
Can you do a video on measuring the angle of rotation of the stepper if connected the encoder to the shaft of the stepper and if the shaft is rotated manually?
@kamranalidoosti9799
@kamranalidoosti9799 6 лет назад
Thank you Dejan. You are a good teacher. Go on!
@manishsingh2961
@manishsingh2961 6 лет назад
can we use this rotary encoder? In bidirectional Bluetooth app led brightness controlar project
@muratcanbarut64
@muratcanbarut64 5 лет назад
would you please can you show the circle diagram for stepmotor section, is LCD connection I2C ? thank you
@m0gga
@m0gga 7 лет назад
Hi Dejan, thanks for sharing this helpful tutorial,I would like to use a rotary encoder to replace the menu navigation buttons in my project, your video is very useful. I notice that you did not appear to implement any software de-bouncing techniques to overcome the switch noise, yet your example did not appear to suffer from switch bounce. Did you use a hardware filter of some sort? Thanks.
@krallopian
@krallopian 6 лет назад
Yeah I was wondering about that. My encoder skips when I move it then when it clicks. So each "notch" counts as TWO. 0... 1,2... 3,4.... 5,6.... I suppose I can code accordingly but, slightly annoying.
@Xanty55
@Xanty55 6 лет назад
Yes, my encoder produces the same behavior.
@itskevscott
@itskevscott 2 года назад
Maybe the two Serial.print() statements in the loop slow it down sufficiently that the chatter has stopped by the time it looks around again. With a faster arduino like an ESP32 the bouncing may be seen again. Havent tested it but just a thought!
@joost199207
@joost199207 6 лет назад
Great explanation, everything i needed to know.
@ROBJECTS
@ROBJECTS 2 года назад
Thank you friend!
@bigd1266
@bigd1266 4 года назад
You are the man!
@huliyumain9536
@huliyumain9536 7 лет назад
Great work!Thank U! But 20 pulses for one revolution,how can you show 1,2,3,4,5...n degree ,not 1,9,18 degree?
@ElectronGordo
@ElectronGordo 7 лет назад
Thanks!
@karlklops3810
@karlklops3810 7 лет назад
very nice and short video keep it up 😊👍👍
@pkteguh8199
@pkteguh8199 8 лет назад
thanks for your tutorial, it helps,regards
@pkteguh8199
@pkteguh8199 7 лет назад
referring your tutorial,so is it possible to synchronize two surface speed of conveying belt/goods ?, since the encoder rotated by a surface speed and give the signal as a control to a motor that can produce similar surface speed to another conveyor for example, thanks for your feedback,regards
@bcinsteadof3
@bcinsteadof3 6 лет назад
Wow, such elegant code...My overly complex code didn't work well when I spun the encoder quickly, this works flawlessly. Thanks!
@TheChrisey
@TheChrisey 3 года назад
It's not that elegant tbh, it should be implemented with hardware comparators and interrupts
@jimwithheld7217
@jimwithheld7217 2 месяца назад
@@TheChrisey Agree: the example in the vid is fine for slow speeds, and when there is feedback, such that if a count is missed, or extra, the user will self-correct, and everything is fine. For higher speeds, you need some hardware and maybe counters, which take care of the counts, and the main software just reads the counter any time it needs the values. Some of the Microchip PIC family have a hardware module built in. A quadrature Decoder. But you can also craft with some of the "soft" progamable gates, e.g. CLB and such. For very high speeds, e.g. motors at thousands of RPM, you can't really just poll the pins in a loop: you need hardware assist. Or very fast interupts might get you some of the way. But again: the example is fine for the right kinds of slower stuff. Also: switch-bounce shaping on the pins can be important, so you only get 1 count per count, not many. I did not look too deep at the code to see if maybe its state always handles that OK enough. A resistor and a cap might be enough, depending on the encoder used.
@bluematrix5001
@bluematrix5001 6 лет назад
Hi if I want a very smooth Jog wheel for a Computer witch encoder would be great?? with RPP #?
@Anton-wc7lb
@Anton-wc7lb 10 месяцев назад
Awesome video, thanks! :)
@BrijeshKhumaar
@BrijeshKhumaar 3 года назад
Thanks that was amazing...
@andrijaadamovic87
@andrijaadamovic87 8 лет назад
Great
@taranagnew436
@taranagnew436 6 лет назад
how many turns does a rotary encoder have and how would i code it so that when i tuen the knob, it goes to the selected menu and i want to press in to select the menu
@asmaakter2929
@asmaakter2929 4 года назад
If I use a magnetic encoder circuit in micrometal gear motor ...does it be work like stepper motor Wait for a quick reply
@yashgokhale5238
@yashgokhale5238 3 года назад
Thanks for uploading the video. For some modules above program functions only when INPUT_PULLUP is defined for CLK and DT pins
@Bianchi77
@Bianchi77 9 месяцев назад
Nice info, thanks for sharing with us, well done :)
@balajijk52
@balajijk52 7 лет назад
Is it possible to design detent switches along with continous rotary knob? and how if its possible?
@jugnu361
@jugnu361 7 лет назад
Great Work
@SimpleHumanInNY
@SimpleHumanInNY 2 года назад
Thank you 🙏
@minayakarimova
@minayakarimova 4 года назад
Huge thanks
@michaelcerkez3895
@michaelcerkez3895 7 лет назад
Very good thank you, I love that Black Magic!
@endingalaporte
@endingalaporte 5 лет назад
suscribed, videos are very good, I'm studying mechanical engineering, have to choose If I want to specialise in Mechatronics, your videos help me a lot in my choice, very cool
@HowToMechatronics
@HowToMechatronics 5 лет назад
Thanks!
@irfan2189
@irfan2189 4 года назад
GOOD WORK BRO..
@kanishka5prasad
@kanishka5prasad 7 лет назад
any idea of how to control a dc motor the this encoder feed back ?
@ghoomieletsgo2766
@ghoomieletsgo2766 6 лет назад
can i use rotary encoder to measure the speed of a motor?
@Redtayal
@Redtayal 5 лет назад
Me and my friend are making a wind turbine project that dedects and rotates to wind source. How can we use rotary encoder to sense the wind or can we use something else?
@chloemcholoe3280
@chloemcholoe3280 5 лет назад
does it make sense to use this as an interrupt in your code or is that OP? cause if the project has other things to do i'm worried it'll miss this
@ahmedboudi1808
@ahmedboudi1808 6 лет назад
thank you
@AbhishekKumar1902
@AbhishekKumar1902 7 лет назад
excellent
@OMNI_INFINITY
@OMNI_INFINITY 11 месяцев назад
*Thanks! Recommend making a video on controlling position of a continuous servo using a continuous rotary encoder!*
@HowToMechatronics
@HowToMechatronics 11 месяцев назад
Currently working on such a video. I will publish it next week. Cheers
@OMNI_INFINITY
@OMNI_INFINITY 11 месяцев назад
Oh, thanks in advance!@@HowToMechatronics
@OMNI_INFINITY
@OMNI_INFINITY 11 месяцев назад
Another recommendation that is likely easy is a record and playback motion robot arm using servos. Bonus points for making it a pick and place machine with OCR!@@HowToMechatronics
@glowpon3
@glowpon3 2 месяца назад
Such a simple logic to test direction. I finally get it. Thanks so much ^,.'.,^
@ruffnck4637
@ruffnck4637 4 года назад
The best one at yutub ¡
@rrd001
@rrd001 4 года назад
is there any formula can used, for explain how it work
@ngobachduong
@ngobachduong 7 лет назад
Nice explanation and animation. But in your code, it will be more accurate if you use interrupt function to detect the change of signal.
@sergioisaacpuentesto
@sergioisaacpuentesto 7 лет назад
One question please..If I want to make an encoder of 3 bits of resolution, how do I do it?
@muddassirazmi3059
@muddassirazmi3059 6 лет назад
Can you give me circuit interfacing diagram of this project plz
@gvinodkumar4224
@gvinodkumar4224 6 лет назад
very super and good teching
@HowToMechatronics
@HowToMechatronics 6 лет назад
Thanks!
@AliIsmaeltyphoon
@AliIsmaeltyphoon 3 года назад
Can it continue to increment after more than one revolution please ? Thanks for answering.
@nimishjoshi1420
@nimishjoshi1420 6 лет назад
Can rotary encoder be used to measure diameter of a object? I wanted this diameter to input to some formula and get some other output.
Далее
How to use rotary encoders
14:12
Просмотров 30 тыс.
HACKED!: Using an HDD Motor as a Rotary Encoder?!
8:21
How to use Rotary Encoder with Arduino
14:44
Просмотров 41 тыс.
How to use encoders (Optical, Hall Effect, Quadrature)
20:44
Try these 16 Brilliant ESP32 projects!!!
11:18
Просмотров 556 тыс.
ROTARY ENCODER WITH INTERRUPTS - Arduino tutorial #12
13:12
You can learn Arduino in 15 minutes.
16:34
Просмотров 9 млн
CNC Machined vs 3D Printed Cycloidal Drive
19:58
Просмотров 700 тыс.