I have to run 8 PWM signals out of an Arduino Mega to motor controllers that are placed anywhere from 25 ft. (7.62 m) away to 150 ft. (45.72 m) away. I expect the voltage drop will be high.
The alternate solution is to send a serial or ethernet message to 8 different Arduinos placed next to the motor controller. I can do that, but it's significantly more expensive.
To do it from the Mega, I assume I would need to do something like have a transistor circuit at the Mega which switches a higher voltage to each motor controller… either something like 7.5VDC, which will drop to the required 5 naturally over the distance, or a higher voltage like 12VDC and switch it back down t0 5VDC with another transistor circuit at the motor controller.
I also don't know if there will be noise associated with doing this…
Thoughts?
Best Answer
Your best bet is probably to use an opto-coupler at the remote end, and a constant current driver at the micro end.
simulate this circuit – Schematic created using CircuitLab
This effectively gives you a current loop interface which would be pretty much impervious to noise and distance provided the voltage supply for the LEDs is high enough to swamp the drop along the lines. It also removes ground from the equation, so it will not matter if the remote ground is significantly different from the ground at the micro.
You should, however, augment this design to include protection from ESD and other transients. (See my second circuit in this answer, but replace the relay with an opto-coupler.)
If the environment is electrically hostile and you wanted it to be really cool, you may be able to run fibre optics that far.