@Peter Donovan Nice work! Would you mind sharing the octocouplers and power supply links?
Also, I'm looking at a similar wiring grade. Are you using 18/4 shielded with ground drain for the Nemas and 22/3 shielded for the endstops? Any link would help. All I can find is somewhat pricey.
Thanks a lot!
Power Supply
https://www.amazon.com/gp/product/B07VRK86SP/ref=ppx_yo_dt_b_asin_title_o02_s01?ie=UTF8&psc=1
I used 24/2 shielded cable for the endstops
https://www.amazon.com/gp/product/B01LNH8UZ0/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&th=1
I did no go shielded on the steppers I used 18/4
https://www.amazon.com/gp/product/B017SDE4BC/ref=ppx_yo_dt_b_asin_title_o04_s01?ie=UTF8&psc=1
I would stay away from the optocoupler I used. There are better options, (the voltage is is linked from the input/ switch side to the output side. its better to have each side isolated.) what voltage are you planning on running on the limit switch side and what controller are you using. Arduino w/ cnc (5v Logic ) shield or a grbl esp32 ( 3v3 Logic ) based board or some thing else. I can give you a better recommendation from those values.
Waiting USPS to deliver my GRBL_ESP32 board (https://www.tindie.com/products/33366583/grbl_esp32-mpcnc-cnc-controller-ver-122/)
Great choice, what drivers are you going to run?
this is the Opto I'm going to try next should be here tomorrow.
I'm going to use DM542T for the Nemas 23 and a DRV8825 for the Z axis Nema 17. For the nema 23, I bought these: https://www.tindie.com/products/33366583/external-stepper-motor-driver-ver-11/
Looks like a killer set up! FYI Bart is great at answering any questions and also check the GRBL_ESP32 Slack channel for support.
I am trying to do a "GRBL_ESP32 schematic for dummies" since my proficiency level in electronics is just ridiculous. Hopefully, this will help others like me.
Here: Diagram Link
However, I am struggling to figure out how to connect
the optocoupler you listed and those limit switches: https://www.aliexpress.com/item/32951447527.html?spm=a2g0s.9042311.0.0.de1f4c4degWLQ6:
Ok heres a few things, the drain should be connected to Gnd somewhere in the case ( an actual GROUND is best ), technically I try to ground it at both ends where ever possible.
The reason for using the Optocoupler is to use a higher voltage so that the noise doesn't affect the signal. So on the Limit switch side of the Optocoupler you need to supply voltage can be 5v 12v 24v what ever you have available, to the limit switch. The higher the voltage the less change the noise will affect the signal. Choosing the right pre built optocoupler with pcb is important. These have built in resistors, which are different depending on the voltage you are running through your limit switches. If you are feeling adventurous you can get away with the tiny little 817 optocoupler but would need to add resistors to both the higher voltage side and the logic side. Those resistors depend on the voltage on either side.
optocoupler only https://www.mouser.com/ProductDetail/Sharp-Microelectronics/PC817XNNIP1B?qs=rrS6PyfT74dJvnx7366b6Q%3D%3D
There are about 10,000 ways to get to the same endpoint. you will probably find an equal amount of premade High level to low level optocouplers so be careful.
I chose this one because I wanted the cleanliness without resistor and wires everywhere. Here's a basic layout, I'm no electrical engineer, but I'll try to help where I can.
Oh and you mentioned 5V to the limit pins on the Grbl_esp32 board. You need to use 3.3v the ESP_32 uses lower voltage signal than the arduino based boards.
Thank you! The switches I'd like to use have a GND (black), therefore I'd need to connect those for the GND (1-,2-,...) right? Which would mean that I'd need 22/3 Shielded wires instead of 22/2 like yours?