Interfacing with an Arduino

Although an industrial robot can do many things on its own, we can quickly find ourselves wondering how to control simple peripherals like hobby servos, stepper motors or more complex circuits like touch sensors. These are straightforward to implement with Arduino or Raspberry Pi, well documented and with numerous libraries and code examples. A common way to get the best of both worlds is to interface a microcontroller to the robot controller, and have them communicate over simple digital outputs and inputs, so that one can trigger the other while making it simple to integrate peripherals that are not a good fit for a robot controller. There are 2 things to pay attention if attempting to do so: the robot controller uses 24V logic while the microcontrollers usually 5V or 3.3V. Connecting a 24V output to a 3.3V input will definitely cause damage, but if mistakenly wiring the inputs of the robot incorrectly or causing a short circuit, one can also damage the internal electronics of the robot. If damaging an Arduino is not a critical mistake, damaging a robot controller can be a very expensive one. For that reason a great way to interface both together is to use relays, and treat the relay contacts as a Normally Open or Normally Closed push button, that can interface with both in a very straightforward manner. This configuration means that the 2 are totally isolated electrically and there can be no possibility of damaging anything if miswiring something.

To pass a signal from the robot to the Arduino, a 24V relay can be wired to one of the robot controller’s digital outputs, and a digital input can be wired from the Arduino to the relay contacts while enabling the internal pullup resistor of the Arduino’s digital input.

To pass a signal from the Arduino to the robot, inversely, a 5V relay can be wired to an Arduino digital output, and a digital input of the robot can be wired to the relay contacts.