Hardware: DSBOARD-XV2
OS: JetPack 4.6 & JetPack-5.0.2
In this blog post, we will test the IIO (Industrial Input-Output) interface of DSBOARD-XV2.
First, let's look over the IO connector. On the connector, there are 3 isolated outputs, 2 isolated inputs, and 1 isolated ground. When using IIO, always double-check which ground pin you are using. You must use the isolated ground for IIO applications.
Digital input side accepts signals between 12-24V (rated for 2.25mA). In our application, we used Heschen M12 Inductive Proximity Sensor (PNP & Normally Open(NO)) with 24V voltage source.
Find sysfs equivalent of the connected output pin from the table below. For this setup, it is DIGITAL_IN0. After proper hardware connection with industrial LED, we can continue with the software side.
For JetPack-4.x
Set DIGITAL_IN0 as input and read sensor value. To do this, you should use the commands below.
sudo echo 240 > /sys/class/gpio/export
sudo echo in > /sys/class/gpio/gpio240/direction
sudo cat /sys/class/gpio/gpio240/value
For JetPack-5.x
Set DIGITAL_IN0 as input and read sensor value. To do this, you should use the commands below.
sudo echo 297 > /sys/class/gpio/export
sudo echo in > /sys/class/gpio/gpio297/direction
sudo cat /sys/class/gpio/gpio297/value
Digital output side can drive loads up to 24V and has a current limit of 1A. They work as low side switches, open-close between them and GND_ISO. So, you should have a circuitry as in the schematic below. In our application, we used GASHER 24V Indicator Light with 24V voltage source.
Find sysfs equivalent of the connected output pin from the table below. For this setup, it is DIGITAL_OUT0. After proper hardware connection with industrial LED, we can continue with the software side.
For JetPack-4.x
Then, set DIGITAL_OUT0 as output and control light state. To do this, you should use the commands below.
sudo echo 244 > /sys/class/gpio/export
sudo echo out > /sys/class/gpio/gpio244/direction
To short output:
sudo echo 1 > /sys/class/gpio/gpio244/value
To open output:
sudo echo 0 > /sys/class/gpio/gpio244/value
For JetPack-5.x
Then, set DIGITAL_OUT0 as output and control light state. To do this, you should use the commands below.
sudo echo 301 > /sys/class/gpio/export
sudo echo out > /sys/class/gpio/gpio301/direction
To short output:
sudo echo 1 > /sys/class/gpio/gpio301/value
To open output:
sudo echo 0 > /sys/class/gpio/gpio301/value
Thank you for reading our blog post.