@DigitalElf
I realize this post is 3 months old but thought for other CNC users looking to isolate their NPN Axis End Stop switches this might be of use , protoboard and opto isolators cost $15 , this is for a duet2 wifi
opto isolator x 4 on my Delta , allows you to use what ever voltage the sensor works best with ( in my case 24volts) , isolates the high voltage from the low , decouples any kind of line noise from steppers etc and doesn't toast the board if you plug it in backwards
in config file use
M574 X2 S1 P"!xstop" ; configure active low endstop for high end on X via pin xstop !prefix