Digital I/O
This content is for the 1.0.0 version. Switch to the latest version for up-to-date documentation.
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.
Connector pinout
Section titled “Connector pinout”The terminal block is wired in this physical order, left to right:
| Position | Pin | Type | What it is |
|---|---|---|---|
| 1 | DI2 | Digital input | Read-only sense input |
| 2 | DI1 | Digital input | Read-only sense input |
| 3 | DO2 | Digital output | Read/write output |
| 4 | DO1 | Digital output | Read/write output |
| 5 | GND | Ground | Signal ground |
| 6 | IGN | Ignition sense | Read-only ignition input (the power symbol on the connector) |
| 7 | GND | Ground | Signal ground |
| 8 | 12V | Power | Power pin |
Wiring depends on your installation. This page describes only what each channel does in software.
Digital inputs (DI1, DI2)
Section titled “Digital inputs (DI1, DI2)”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
For a worked example, wiring a door switch and reading it from your own software, see Detect a Vehicle Signal.
Digital outputs (DO1, DO2)
Section titled “Digital outputs (DO1, DO2)”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
Ignition sense (IGN)
Section titled “Ignition sense (IGN)”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.
Reading and switching from the CLI
Section titled “Reading and switching from the CLI”pcu-cli dio shows every channel at once:
$ pcu-cli diopcu 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>:
$ pcu-cli dio get di1 DI1: Low$ pcu-cli dio get ign Ignition (IGN): OnSet an output with pcu-cli dio set <output> <0|1>. It warns you, asks you to confirm, drives the
line, and reads it back:
$ pcu-cli dio set do1 1WARNING: digital outputs drive connected hardware (relays / switches / lamps).Set DO1 = High? [y/N] y DO1: High - verifiedThe 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.
Permissions
Section titled “Permissions”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.
