Sorry for all the "Ums" Haha. Its something I want to avoid in the future. There is a fair bit of info here however, and will let you use a rotary encoder with minimal hardware!
I noticed that encoders which were debounced using large capacitors (100n), degrade very fast, compared to w/o caps. I suspect that when contacts are closing, there are some micro sparks or electro erosion occurring. So be aware.
Thank you so much for the video and in depth explanation! I had attempted to do the hardware decoding of a rotary encoder, but I could never quite crack it. I'm really eager to try using your method.
I am speculating it could be possible to read the signal with just few logic operations or one generic logic chip. When A or B is low(or high) it's clock pulse. Then AND or OR them, if the other one is high, it turns left, if low, it turns right (or other way around depending how you set it). Or even simpler, the other one is clock and other is direction with true/false binary if exact accuracy is not crucial
You should look into grey code decoding ... most rotary encoders output grey code due to the mechanics of the encoder plates. If you use a couple of logic gates you can decode it into binary pretty easily
Very impressive what you have done, and enjoyed watching the whole video at ‘Normal’ speed which is a real compliment coming from me! 🤣😂🤣 Subscribed and hope to see more! 😊
The circuit at 26.00 is Great! I will copy it sometime. but I wonder if you can replace the OR gate with three NAND gates and a transistor(negate), Less components count!
Perhaps! Its always a juggle with ease of design and component coservation. I think simplicity and elegance should be the goal. I plan do go into depth in my next video on the 5 transistor version I mentioned that yeilds the same result, with maybe more accuracy and certainly less current use. I'd love to hear any results your experiments yield!
A little suggestion: for the inversion of the logic of the rotary encoder the transistors aren't needed. Just connect C to Vcc and A and B with pull down resistors instead of pull up ones.
I like the idea, it fits my penny-pinching attitude! I think I had better luck with my debounce circuit this way, I'll need to give it a test sometime. Thanks for watching!
You are totally right! It would be a problem if the encoder was left inbetween indentations long enough that stray voltage could build up on the set pin. It would leave both set and reset high, giving a rising edge on the "clock" output, even though the encoder hadn't been turned. The same goes for the clock pin of the "up/down" flip flop, it should be pulled low with a 1M resistor in theory, because to my knowledge, the 4013 doesn't have an internal pull down resistor. I didn't experience those issues with my experiments however, and with me being the fraction of a penny pincher that I am, and also wanting to simplify the concept as much as possible for its presentation, I chose to omit them. Thanks for watching and pointing that out!
Thank you for the video. Really well explained! Do you by any chance know of any one chip solutions to decoding the pulses other than a microcontroller?
If what you mean is a single integrated circuit that give up/down and clock, yes, but they're obsolete, I've tried to get them :( Here's the datasheet for one such chip www.google.com/url?sa=t&source=web&rct=j&url=www.elmelectronics.com/wp-content/uploads/2016/07/ELM404DS.pdf&ved=2ahUKEwje1v2_pbP1AhWrGDQIHb9YC-0QFnoECCkQAQ&usg=AOvVaw1i1sFQVjzUk20ilgFR93MW One of my examples of simple decoding only used one transistor and the associated passive components to get the same output (albeit a little primitive) so I guess it really depends what you want to use it for
@@arenotdiy Wow thank you! That would be perfect... if i can find them. I've heard of those devices existing but never saw the datasheet for one. I guess they went obsolete because of 8pin micros. Too bad! Thanks again, and If you enjoy making these edicational videos, keep the m comming... There aren't many good teachers on youtube...
awesome project which I want to replicate! but I am even more of an amateur so can you please share the simplest version of the circuit in its absolute simple form?
Why 1Meg and CMOS? Just asking because I have never seen 1Meg collector resistors before. Old school CMOS chips did things TTL couldn't but 4000 logic is like hen's teeth now. You have me curious about the 5 transistor version.
The 1M resistors are there to limit the current the BJT inverters are always sinking, as long as the encoder isn't being turned. I didn't like the idea of its quiescent current being higher than it needed to, and 1M resistors still let the cmos D-flip flop operate. I have another video planed where I explain the 5 transistor solution, as well as build a "one knob" video game remenicent of space invaders, with just logic and LEDs. Thanks for watching!
So many poorly implemented encoders out there. My scopes for instance, on both of them, if I turn it too fast - not that fast - it does not work. Drives me nuts.
I agree! And especially when its fairly simple to build well, and important in operation, you would think the average quality would be better. My car stereo will often turn up the volume when I'm turning it down, I want to try fixing it with my next design and video
there are too many false positives with a circuit like this, I tried many so called solutions of using encoders without coding and they all sux'd. I finally ended up using rotary pulse switches and never looked back.
Sorry for all the "Ums" Haha. Its something I want to avoid in the future. There is a fair bit of info here however, and will let you use a rotary encoder with minimal hardware!
I noticed that encoders which were debounced using large capacitors (100n), degrade very fast, compared to w/o caps. I suspect that when contacts are closing, there are some micro sparks or electro erosion occurring. So be aware.
Thank you so much for the video and in depth explanation! I had attempted to do the hardware decoding of a rotary encoder, but I could never quite crack it. I'm really eager to try using your method.
My pleasure! I hope it works out for you, feel free to reach out with questions :)
I am speculating it could be possible to read the signal with just few logic operations or one generic logic chip. When A or B is low(or high) it's clock pulse. Then AND or OR them, if the other one is high, it turns left, if low, it turns right (or other way around depending how you set it). Or even simpler, the other one is clock and other is direction with true/false binary if exact accuracy is not crucial
Thats the basic operation of the digi-pot I describe
Rotary encoders are awesome, such a handy interface...
You should look into grey code decoding ... most rotary encoders output grey code due to the mechanics of the encoder plates. If you use a couple of logic gates you can decode it into binary pretty easily
another analog wizard ! lovely video
Very impressive what you have done, and enjoyed watching the whole video at ‘Normal’ speed which is a real compliment coming from me! 🤣😂🤣 Subscribed and hope to see more! 😊
The circuit at 26.00 is Great! I will copy it sometime. but I wonder if you can replace the OR gate with three NAND gates and a transistor(negate), Less components count!
Perhaps! Its always a juggle with ease of design and component coservation. I think simplicity and elegance should be the goal. I plan do go into depth in my next video on the 5 transistor version I mentioned that yeilds the same result, with maybe more accuracy and certainly less current use. I'd love to hear any results your experiments yield!
A little suggestion: for the inversion of the logic of the rotary encoder the transistors aren't needed. Just connect C to Vcc and A and B with pull down resistors instead of pull up ones.
I like the idea, it fits my penny-pinching attitude! I think I had better luck with my debounce circuit this way, I'll need to give it a test sometime. Thanks for watching!
Nice work!
I believe the set pin on the second flip flop needs to be pulled high. Now it either pulled low or floating isn't it?
You are totally right!
It would be a problem if the encoder was left inbetween indentations long enough that stray voltage could build up on the set pin. It would leave both set and reset high, giving a rising edge on the "clock" output, even though the encoder hadn't been turned. The same goes for the clock pin of the "up/down" flip flop, it should be pulled low with a 1M resistor in theory, because to my knowledge, the 4013 doesn't have an internal pull down resistor. I didn't experience those issues with my experiments however, and with me being the fraction of a penny pincher that I am, and also wanting to simplify the concept as much as possible for its presentation, I chose to omit them.
Thanks for watching and pointing that out!
Thank you for the video. Really well explained! Do you by any chance know of any one chip solutions to decoding the pulses other than a microcontroller?
If what you mean is a single integrated circuit that give up/down and clock, yes, but they're obsolete, I've tried to get them :(
Here's the datasheet for one such chip
www.google.com/url?sa=t&source=web&rct=j&url=www.elmelectronics.com/wp-content/uploads/2016/07/ELM404DS.pdf&ved=2ahUKEwje1v2_pbP1AhWrGDQIHb9YC-0QFnoECCkQAQ&usg=AOvVaw1i1sFQVjzUk20ilgFR93MW
One of my examples of simple decoding only used one transistor and the associated passive components to get the same output (albeit a little primitive) so I guess it really depends what you want to use it for
@@arenotdiy Wow thank you! That would be perfect... if i can find them. I've heard of those devices existing but never saw the datasheet for one. I guess they went obsolete because of 8pin micros. Too bad! Thanks again, and If you enjoy making these edicational videos, keep the m comming... There aren't many good teachers on youtube...
Nice work!
awesome project which I want to replicate! but I am even more of an amateur so can you please share the simplest version of the circuit in its absolute simple form?
I'm working on my transcript for that exact video! Only 5 transistors, some diodes and resistors.
@@arenotdiy sounds like a miracle to me 😀I am eagerly waiting for its final form. thank you so much for your efforts 🤙
Why 1Meg and CMOS? Just asking because I have never seen 1Meg collector resistors before. Old school CMOS chips did things TTL couldn't but 4000 logic is like hen's teeth now. You have me curious about the 5 transistor version.
The 1M resistors are there to limit the current the BJT inverters are always sinking, as long as the encoder isn't being turned. I didn't like the idea of its quiescent current being higher than it needed to, and 1M resistors still let the cmos D-flip flop operate.
I have another video planed where I explain the 5 transistor solution, as well as build a "one knob" video game remenicent of space invaders, with just logic and LEDs. Thanks for watching!
So many poorly implemented encoders out there. My scopes for instance, on both of them, if I turn it too fast - not that fast - it does not work. Drives me nuts.
I agree! And especially when its fairly simple to build well, and important in operation, you would think the average quality would be better. My car stereo will often turn up the volume when I'm turning it down, I want to try fixing it with my next design and video
Even Ford car radio had these problems.
there are too many false positives with a circuit like this, I tried many so called solutions of using encoders without coding and they all sux'd. I finally ended up using rotary pulse switches and never looked back.
Do you had code for the arduino leonardo
Cs t listen to sny one who says ahm ahm more then 5 times in 10 seconds , after all those ahm ahm cant take anything you say serious.