Thanks for replies. I will look at your project Kev. With my limited knowledge I agree with you Mike - garbage in garbage out. But on grbl official github page https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches they have a schema with opto. Therefore I believe it makes sense to have them. Then they also have a separate picture with capacitor and on the bottom of the page they have explanation why it’s good to have them. But there is no schema with opto and capactitor together. I wan’t to make such schema, but don’t know where to put capacitor(s).
I’m in the process of building cnc. Therefore no real experience if noise is (will be) a problem. But I see a lot of posts regarding this issue and I want to do everything to eliminate this at the begging. I will make may own pcb (just because it’s fun) and putting some additional parts now is no problem. Better now then later.
I came across shielded cables but not really investigated. Yet. But I imagine they can be quite expensive. My goal is to separate power cables and signal cables. Maybe twist signal cables. And then I will see further.
Thanks again for replies.