Controlling a Relay

When wanting to control devices like a motor, it is not possible to power these directly from the digital outputs since they are only meant to provide signals and not power external equipment. We can easily fix that by using relays that will be controlled akin to a light, and close mechanical contacts that can drive an externally powered device. Again, care should be taken to use a 24V compatible relay, and the easiest might be to source industrial 24V relays, often meant to be mounted on industrial standard DIN rails. They are functionally equivalent to small relays used with Arduinos and so are straightforward to use with robots. 2 wires would go from the relay coil to a digital output, paying attention to polarisation. The relay can then be commanded like a light from the user program by toggling the corresponding digital output.