PI-SPI Developers Pack I/O Modules
Regular price
$99.95 USD
Sale
The Pi-SPi Developers Pack Input/Output I/O Modules includes 4 PI-SPI Modules, and all the necessary ribbon cables. Optional Items include a 24 VDC Power Supply and a fully programmed SD Card with the latest Widgetlords libwidgetlords libraries and Python sample code examples.
The PI-SPI Developers Pack:
Qty. 1 PI-SPI-8AI-8MA 4-20 mA Analog Input Module
Qty. 1 PI-SPI-2AO 4-20 mA Analog Output Module
Qty. 1 PI-SPI-8DI Digital Input Module
Qty. 1 PI-SPI-8KO Relay Output Module
Qty. 1 40x26 Ribbon Cable
Qty. 3 26x25 Ribbon Cables
NOTE: Raspberry Pi Not Included
Options:
-24PS Wall Mount 24 VDC Power Supply for input/output circuits
Basic Operation
Each of the PI-SPI modules can be connected individually to the RPi using the 40x26 Ribbon Cable. Each PI-SPI module can be "daisy-chained" from module to module using the 26x26 Ribbon Cables.
- Each PI-SPI module relies on the 5VDC connection from the RPi for power (Local Power Indicator - Blue LED)
- The input/output circuits of the modules rely on the external power supply, typically a 24VDC "Field" power supply (Filed Power Indicator - Blue LED)
- The PI-SPI-8AI does not need the input power (24VDC) "Field" Power Supply if the input signals are sourced externally
- Only one external power supply (24VDC) is required, each module can have the "Field" power "daisy-chained from module to module" as shown in the above picture
Node-Red support is now available.
Please refer to each individual module for more information:
PI-SPI-8AI Analog Input 4-20 mA Interface
PI-SPI-2AO Analog Output 4-20 mA Interface
PI-SPI-8DI Digital Input Interface
PI-SPI-8KO Relay Output Interface
Basic Python Sample Code
Start by installing the Widgetlords libwidgetlords libraries as outlined in:
Getting Started with PI-SPI Libaries
(Unless the SD card has been purchased. It is still a good idea to familiarize oneself with the installation procedure)
The following Python 3 code example reads analog input channels 1 and 2 on the PI-SPI-8AI and writes the same A/D counts to the output channels of the PI-SPI-2AO.
Each digital input of the PI-SPI-8DI operates the corresponding relay output of the PI-SPI8KO.
from time import sleep
from widgetlords.pi_spi import *
init()
dig_inputs = Mod8DI()
relays = Mod8KO()
analog_input = Mod8AI()
analog_output = Mod2AO()
while True:
# Read digital inputs
di = (dig_inputs.read())
ko = di
# Write relays
relays.write(ko)
print(ko)
# Analog Output 1 counts = Analog Input 1 Counts
an1 = analog_input.read_single(0)
print(an1)
analog_output.write_single(0,an1)
# Analog Output 2 counts = Analog Input 2 Counts
an2 = analog_input.read_single(1)
print(an2)
analog_output.write_single(1,an2)
print("")
sleep(0.5)