====== CP-IO22 PNP - IO Board Accessory for the ComfilePi 40 pin header ======
The CP-IO22 PNP is an IO board accessory for the [[comfilepi:index|ComfilePi]] consisting of 22 IO (11 bipolar inputs, 11 PNP outputs), screw terminals, and corresponding indicator LEDs. It can be mounted to the rear panel of the CPi-A/B/S series panel PCs.
This product is not compatible with the CPi-C series panel PCs.
If you need NPN outputs, please use the [[:cpio:cp-io22:index|CP-IO22]].
{{ :cpio:cp-io22pnp:cp-io22pnp.png?nolink |}}
[[https://comfiletech.com/linux-panel-pc/|Coming Soon]]
{{ :cpio:cp-io22pnp:cp-io22pnp_io.png?nolink |}}
===== C#/VB.Net Control Example =====
The following is an example project illustrating how to program the [[:cpio:cp-io22:index|CP-IO22]] in C# or VB.Net using the [[:comfilepi:index#net_c_vbnet|Mono Framework]]. The same software can be used to control the [[ :cpio:cp-io22:index|CP-IO22]] or the CP-IO22 PNP.
{{ :cpio:cp-io22:cp-io22.mp4?700x400 |}}
[[https://github.com/COMFILE-Technology/ComfileTech.ComfilePi.CP_IO22.Demo|Source Code]]
This example application uses the following .NET libraries to control the digital inputs and relays.
* [[https://www.nuget.org/packages/System.Device.Gpio/|System.Device.Gpio]]
===== Python Example =====
The pigpio library also has a [[https://abyz.me.uk/rpi/pigpio/python.html|Python interface]].
The following is an example illustrating digital inputs and outputs:
import pigpio
pi = pigpio.pi()
pi.set_mode(4, pigpio.INPUT)
pi.set_mode(17, pigpio.OUTPUT)
while True:
if pi.read(4):
pi.write(17, 1)
else:
pi.write(17, 0)
pi.stop()
===== Pin Map =====
The CP-IO22 pins are connected to the ComfilePi's GPIO header as shown below.
**Inputs:** GPIO 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16\\
**Outputs:** GPIO 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27
{{ :cpio:cp-io22pnp:cpio-22_pnp_pinout.png |}}
===== Specifications and IO Circuitry =====
* Input Voltage: 5VDC (powered by ComfilePi's 5V pin)
* Current Rating: 100mA or more
* Humidity: 35 ~ 85% RH
* Temperature: -10 ~ 60 ℃
* Size: 128mm X 78mm
{{ :cpio:cp-io22pnp:cp-io22_pnp_circuit.png |}}
==== Inputs ====
* Bipolar relative to COM x 11
* Voltage Range: 12 ~ 24V
* Absolute Min/Max Voltage Range: 3.3 ~ 28V
* Response Time: 5ms
* Input OFF Level: <1.8VDC
* Input ON Level: >2.5VDC
* Indicator LED OFF Level: <4.5V
* Indicator LED ON Level: >5.0V
==== Outputs ====
* DC Output Sink (PNP) x 11
* Maximum Output Voltage: 24VDC
* Response Time: 10ms
* Current: 100mA
* Minimum Load Resistance: 270Ω
:!: **To avoid damage to the product, please be sure to use a load resistance greater than 270Ω.**
===== Setting the Initial IO State =====
It may be necessary to modify the ComfilePi's initial GPIO output state to prevent the ComfilePi from turning the outputs ON when the ComfilePi boots.
Modify the ComfilePi's ///boot/config.txt// file with the following configuration to set the initial IO state. See [[https://www.raspberrypi.com/documentation/computers/config_txt.html#gpio-control|GPIO control in config.txt]] for more information.
gpio=4-13=ip
gpio=16=ip
gpio=17-27=op,np,dl
[[:index|COMFILE Technology's Documentation Library]]