Skip to content
Support

Digital I/O

The In-CarPC CQ40 series provides general-purpose digital I/O: two digital inputs (DI1, DI2), two digital outputs (DO1, DO2), and an ignition sense line (IGN), on an eight-way terminal block.

Digital I/O is a CQ40 series feature. On a CQ20, it is not available: pcu-cli dio reports ERROR: Digital I/O is not available on In-CarPC CQ20. and exits with code 2. See Supported Platforms for the feature comparison.

The terminal block is wired in this physical order, left to right:

PositionPinTypeWhat it is
1DI2Digital inputRead-only sense input
2DI1Digital inputRead-only sense input
3DO2Digital outputRead/write output
4DO1Digital outputRead/write output
5GNDGroundSignal ground
6IGNIgnition senseRead-only ignition input (the power symbol on the connector)
7GNDGroundSignal ground
812VPowerPower pin

Wiring depends on your installation. This page describes only what each channel does in software.

The digital inputs read an external switch or sensor. The PC can read these lines but cannot drive them. High means voltage is present; Low means 0 V.

Example uses, illustrative only, since the wiring depends on the install:

  • Reverse-gear signal, to switch to a reversing camera
  • Handbrake or brake sense
  • Door switch
  • External push-button
  • Accessory-on sense

The digital outputs are lines the PC drives high or low. Use one to switch a low-current load such as a relay coil. Drive a relay rather than the load directly.

Example uses, illustrative only:

  • Reversing-camera relay
  • Amplifier remote turn-on
  • Work light
  • Status indicator
  • Auxiliary power relay

The ignition line reads whether the vehicle ignition or accessory feed is live. It is read-only and reads On when the feed is live. On the connector it is marked with the power symbol.

pcu-cli dio shows every channel at once:

Terminal window
$ pcu-cli dio
pcu v1.0.0 - In-CarPC CQ40 series Digital I/O
----------------------------------------
DI1 : Low
DI2 : Low
DO1 : Low
DO2 : Low
Ignition (IGN) : On
Note: outputs reset to off on reboot or power loss; the state is not saved.

Read a single channel with pcu-cli dio get <channel>:

Terminal window
$ pcu-cli dio get di1
DI1: Low
Terminal window
$ pcu-cli dio get ign
Ignition (IGN): On

Set an output with pcu-cli dio set <output> <0|1>. It warns you, asks you to confirm, drives the line, and reads it back:

Terminal window
$ pcu-cli dio set do1 1
WARNING: digital outputs drive connected hardware (relays / switches / lamps).
Set DO1 = High? [y/N] y
DO1: High - verified

The inputs (DI1, DI2) and the ignition line (IGN) are read-only and cannot be set. You can also work the channels from the Digital I/O page in the GUI, which draws the connector live and toggles the outputs with a confirmation. For the full command surface, exit codes, and scripting notes, see the Command Reference.

Reading and driving the digital I/O needs low-level hardware access:

  • Windows: run pcu as Administrator.
  • Linux: run under sudo, or grant the port-I/O capability during setup. See Install on Linux.

Linux support for the CQ40 series has not yet been validated on hardware; see Supported Platforms.