Debouncing an EC11 rotary encoder is not easy. I found a useful circuit here. I basically built the same thing for myself. The circuit diagram comes from the data sheet of the SN74LVC1G14 IC and I will use the component values as in the project mentioned above.
If you wish, you can build your own circuit boards at your own risk. A link to the files required for an order from JLCPCB (or another manufacturer) can be found at the end of this article. All components are 0805 SMD and the ICs have a SOT23 package. The PCB size is 22 x 15 mm.
My project is free for private use. It is aimed at experienced people. I take no guarantee! Duplication is at your own risk and responsibility!