Skip to main content
Version: 1.0.2

Digital Out

Hardware

AutomatePro comes with 12x digital outputs for controlling external systems, from small solenoids to LEDs or small DC motors. Two different digital outputs are available. One is set up as a high-side output (DO_H_0x), which PWMs the onboard 12V as an output. The second is a low-side sink (DO_L_0x), which sinks up to 36V. The first four low-side channels are PWM controllable, and the final two are binary on/off switches.

Connector Pinout

Digital Output High-Side (DO_H_x) Specifications

There are 6x high-side digital outputs, all of which are PWM-controllable switches.


ParameterValue
Output Voltage (On-state)+12V (from on-board 12V)
Drive Current500mA
PWM ControllableAll (DO_H_01 - DO_H_06)
PWM Switching Frequency500Hz
Number of Outputs6

SVG Image created as Graphical Drawings-DO_H_x.svg date 2025/02/06 13:37:17 Image generated by Eeschema-SVG+12VMDO_H_xOnboardAutomatePro+12V


Digital Output Low-Side (DO_L_x) Specifications

There are 6x low-side digital outputs. The first four are PWM-controllable, while the final two are binary on/off switches.


ParameterValue
On-stateSinks up to 36V
Drive Current500mA
PWM ControllableDO_L_01
DO_L_02
DO_L_03
DO_L_04
DO_L_05 & DO_L_06 are On/Off switches
PWM Switching Frequency10Hz
Number of Outputs6

SVG Image created as Graphical Drawings-DO_L_x.svg date 2025/02/06 13:37:17 Image generated by Eeschema-SVGGNDMOnboardAutomateProDO_L_x


ROS API

Subscribers

TopicTypeDescription
/io/digital_outautomatepro_interfaces/msg/DigitalOutPublish the desired digital output states to this topic. AutomatePro supports 12 digital output pins (6 high-side and 6 low-side). Each output pin is referred to as DIGITAL_OUT_H_XX or DIGITAL_OUT_L_XX, where H/L refers to High Side/Low Side and XX is the pin number, ranging from 01 to 06.

d_out_pin_id:
Data type: uint8
(Use ENUM constants defined in the message definition. DigitalOut.DIGITAL_OUT_H_XX: 01-06
DigitalOut.DIGITAL_OUT_L_XX: 01-06)

duty_cycle_percent:
Data type: uint8
Min: 0 in percentage %
Max: 100 in percentage %

Response rate: 200 ms

Example

This example toggles the duty cycle of Digital Out 01 by publishing to the /io/digital_out topic. The ROS package is available here.

import rclpy
from rclpy.node import Node
from automatepro_interfaces.msg import DigitalOut

class DigitalOutPublisher(Node):

def __init__(self):
super().__init__('digital_out_publisher')
self.publisher_ = self.create_publisher(DigitalOut, '/io/digital_out', 10)
self.timer = self.create_timer(1.0, self.timer_callback) # 1s
self.duty_cycle_sequence = [0, 50, 100, 50]
self.sequence_index = 0

def timer_callback(self):
msg = DigitalOut()
msg.d_out_pin_id = DigitalOut.DIGITAL_OUT_H_01 # Digital Out High Side Pin 01
msg.duty_cycle_percent = self.duty_cycle_sequence[self.sequence_index] # Duty Cycle: 0%, 50%, 100%, 50%
# 0% - OFF, 100% - ON
self.publisher_.publish(msg)
self.get_logger().info('Publishing: "%s"' % msg)
self.sequence_index = (self.sequence_index + 1) % len(self.duty_cycle_sequence)

def main(args=None):
rclpy.init(args=args)
node = DigitalOutPublisher()
rclpy.spin(node)
node.destroy_node()
rclpy.shutdown()

if __name__ == '__main__':
main()

Run the node using the following command:

ros2 run automatepro_python_tutorials digital_out_node