Build A Rotary Encoder Interface
Вставка
- Опубліковано 5 вер 2024
- This video will describe how to build a stand alone rotary encoder interface without using a microcontroller. This will allow you to get familiar with the operation of a rotary controller
Finite State Machine video:
• Finite State Machines ...
its been 30 years since i did anything like this but i wanted to use it for the radio switches on my flight sim cockpit I'm building, thank you, its very, very clear.
You're welcome!
This is exactly what I wanted for my upcoming clock project! I'm planning to use 4510 chips for the clock counters so setting the time should be a breeze.
sometimes I must visit your videos 2 times because they are so usefullllllllllllll
Excellent! I was looking for a simple and ingenuous circuit like this, without using microcontrollers, to replace up-down buttons with rotary encoder. Tank you!
You are welcome!
I've got some similar, cheap rotary encoders. They have some seriously nasty bounce on the CLK output. I haven't found a combination of resistor and capacitor that reliably debounces for both slow and quick turning of the encoder shaft. I found that ignoring the CLK input for an appropriate time after a rising edge was most reliable. (I tried sampling the CLK pin at regular intervals, then looking for a certain number of matching samples in a row, was unreliable because the bouncing continues for so long.)
A nasty bounce is about 10ms.
hi, a very "clean / minimalistic" circuit design for hardware IO signal conditioning (my preferred option rather than software solutions). very good, thank you.
You're welcome!
Thanks for detail explanation very very useful worth watching and following.
Glad it was helpful!
Thank you for this video
Thank you friend... got my job done.
Welcome 👍
Very clear and informative :)
2 comments: in 33+ years of many varieties of casual & career computing, I never, EVER saw a shred of Forth, much less somebody coding in it. Were I not so comfortable in 'C' and if I wanted to dabble, looks like Forth has retained viability right up to today. If you were to actually convert this project to SMT components to reduce size, I wonder if there'd be a market for such. It is a nice, tidy package and looks quite useful.
NASA still uses Forth in their space probes. Our solar system is full of microcontrollers running Forth.
So NASA programmed the probes to go Forth and explore?
You got it ... May the Forth be with you. :O)
The PHILAPE lander use MPE FORTH with RTX2010 processor (code machine for this processor is FORTH): www.mpeforth.com/press.htm
en.wikipedia.org/wiki/RTX2010
A question - why the state machine approach that you mentioned toward the end? Surely an ISR driven by the clock positive edge would uniquely resolve direction based on the state of data? And every clock pos. edge is one rotation 'click' so you have all the info you need without having to decode all states, what am I missing?
If someone purposely turns the encoder 1/2 click CW and then back CCW you would get a clock pulse output but the encoder is in its original position. There are 4 states to a proper "click" and if you do not see all of them you can null the output.
Thanks
- but I still dont quite get it. Surely encoder absolute position is not important, its just clicks and direction that matter. So if you did turn it halfway and return to original position then you would get a clock pulse and some indication of direction (probably the previous direction?) I'm displaying my lack of knowledge here - will go check it out on a scope.
I try to keep my video length to 10 minutes max so I did not go into too much detail about the state machine approach.
Check out this video, you can go to 11:25 for the explanation.
ua-cam.com/video/aeJm76F5lOQ/v-deo.html
Hi! Thanks for the video! What are C and R values at the debouncing circuit connected to pin 4 of 4013?
R = 100k and C = .1uF
0033mer thanks!
Q: I'm struggling to understand what the R, C, diode and one gate are doing? Thx.
A typical RC inverter contact bounce circuit assumes the bounce will stop before the RC time constant times out. This contact bounce circuit keeps the capacitor discharged using the gate and diode as long as the bounce is active keeping the Q output high. When the switch changes state the capacitor is allowed to charge up to reset the latch but any bounce will discharge the capacitor. When the bounce settles down the capacitor will charge resetting the Q output low. Just a better way of doing it.
It doesn't look like Arduino code, IE: void setup, void loop, etc. What am I missing here and how can I use this with my Nano to change the direction of my Stepper Driver? Thanks
I do not use the Arduino IDE. All code in my videos are written in FORTH. Check out the FlashForth website:
www.flashforth.com Check out this link to my stepper motor video: ua-cam.com/video/jt48k1apGzQ/v-deo.html
@@0033mer Thanks for the reply. So, if a person wants to follow your video tutorials using an Arduino, they would have to learn and use the FORTH programing language? Is that correct?
Yes, you would have to learn FORTH to follow along. FORTH is the best programming language to control hardware.
NASA has been using it in their space probes for many years. www.forth.com/resources/space-applications/
@@0033mer Okay, thanks anyway. I only have a couple of projects that I need an Arduino for and I have already invested a lot of time learning to Code in the Arduino IDE. It might be good to make it clear upfront in your videos what the situation is so we don't waste our time, thinking that we will be able see the Arduino C+ code for the tutorial.
Go to my channel home page and click on "About"
اعجبني
Are the listings of your programs available somewhere?
Code starts at 8:35.
Hey dude, nice video! Help me out with something. Let's say I want a circuit which gives one short little pulse (high and then back to low again) when a certain input goes low to high and stays high. Basically I want a pulse when I detect a rising edge. I want to do it with very few components. Any ideas?
You need a positive triggered monostable circuit:
Check 555 timer data sheets. www.electroschematics.com/6215/positive-trigger-timer/
You can also use a CD4528 or CD4047 IC.
Check out this video for more ideas:ua-cam.com/video/f1FcW7rmJ-o/v-deo.html
0033mer Nice! Thanks so much! I did it with an inverter(7404), an and gate(7408), a resistor, and a capacitor. But I didn't want to use two 14 pin chips. I think using 4013 as shown in your video will be enough for this application. : )
useful
are these available without breakout board?
Sayantan Maiti yep they are
are these available without breakout board?
Yes .. You can get them from Digi-key
www.digikey.ca/product-detail/en/ACZ11BR1E-15KQD1-20C/102-1763-ND/1923358?WT.mc_id=IQ_7604_G_pla1923358&wt.srch=1&wt.medium=cpc&CUI+Converters&mkwid=sEIT2P6VX&pcrid=102742808345&pkw=&pmt=&pdv=c&gclid=CjwKCAiA9rjRBRAeEiwA2SV4ZWhbpCmUzOtP87oKfcSokHJdict-1Is856WorDQn6DilRLDZxh44whoC2MsQAvD_BwE