PI-SPI-DIN Applications

The PI-SPI and PI-SPI-DIN series of modules enables the Raspberry Pi to be used in real world automation applications. Each series has 5 main components:

  • Analog Input
  • Analog Output
  • Digital Input
  • Relay (Digital) Output
  • RS485

Both series are very similar: The PI-SPI modules have the the same foot print as the RPi3, the PI-SPI-DIN series has DIN rail mounting capability and has a different powering scheme.

PI-SPI-DIN Series

Various combinations of the PI-SPI-DIN modules can be combined together to create different types of automation measurement and control systems. Shown above is a system that has the main controller module with RS485, Real Time Clock, 16 Analog 4-20 mA Inputs, 8 Isolated digital inputs, 4 analog 4-20 mA outputs and 12 Relay Outputs. The main system power is provided by the 120VAC to 24 VDC DIN rail mounted power supply in the bottom right corner of the picture.

Node-RED

The PI-SPI-DIN Series now has Node-RED support. Please visit

Node-RED and the PI-SPI-DIN Series

for instructions.

Sample Python Code

To get started, each PI-SPI-DIN I/O module has a simple test program written in Python. All programs were developed using a Raspberry Pi 3 module and Python 3 Idle that comes standard with the latest distro's.

To get started, please refer to the

Getting Started with Pi-SPI Libraries

and ensure the dtoverlay is set correctly in the /boot/config.txt file:

dtoverlay=vpe-2701c

PI-SPI-DIN-RTC-RS485 Main Module

PI-SPOI-DIN-RTC-RS485 Raspberry Pi Interface Module

The PI-SPI-DIN-RTC-RS485 is the main interface module for the PI-SPI-DIN series.

This module accepts 9 to 36 VDC and powers the RPi with a 5 VDC 2.5 A power supply via the GPIO interface cable. All modules connected to the PI-SPI-DIN GPIO port also get powered via the interconnect ribbon cable.

PI-SPI-DIN-8AI Analog Input Module

 

 The PI-SPI-DIN-8AI has 4 different input configurations:

  • 4-20 mA
  • 0 to 5 VDC
  • 0 to 10 VDC
  • Temperature using 10K Thermistors (3380 Beta) and SteinHart-Hart Equation

Typically, the Chip Select is CE1 or CE0 in the Python Code Sample Programs

PI-SPI-DIN-8DI Python Code Samples

 

PI-SPI-DIN-8DI Isolated Digital Input Module

The PI-SPI-DIN-DI module can accept either DC or AC Isolated inputs, typically 24 VDC/AC (Remove Jumpers J4 to Isolate the Inputs)

In cases where Isolation is not required and a field voltage is required for switch or contact inputs, leave the J4 jumpers installed. This will bring the applied field voltage to the field wiring terminal block positions COM and +V.

Each module has 4 addresses that are jumper selectable A0 and A1. With both jumpers installed the MCP23S08 address is "0", remove A0 jumper and the address is 1, etc. This allows up to 32 digital inputs (4 modules) from the same Chip Select.

Typically, CE2 is used in the Python Code Sample Programs

PI-SPI-DIN-8DI Python Code Samples

 

PI-SPI-DIN-4KO Relay Output Module

The PI-SPI-DIN-4KO has 4 relays with SPDT 2A contacts.

Each module has 4 addresses that are jumper selectable A0 and A1. With both jumpers installed the MCP23S08 address is "0", remove A0 jumper and the address is 1, etc. This allows up to 16 relay outputs (4 modules) from the same Chip Select.

Typically, Chip Select CE3 is used in the Python Code Sample Programs

PI-SPI-DIN-4KO Python Code Samples

 

PI-SPI-DIN-4AO Analog Output Module

PI-SPI-DIN-4AO Analog Ouptu 4-20mA Module

The Pi-SPI-DIN-4AO Analog Output Module has 4 channels of 4-20 mA (0 to 20 mA) and use the I2C bus. The Python sample code shows how to write all 4 channels or a single channel using the SMBUS.

The default address for the MCP4728 is 0x60. Up to 8 different addresses are available from 0x60 to 0x67 giving a total of 32 analog 4-20 mA outputs from one system. Please contact us for programming different addresses for the PI-SPI-DIN-4AO.

PI-SPI-DIN-4AO Python Code Samples

 


RS485 LCD Display Modules

All of the PI-SPI series of products have an RS485 option. Typically the RS485 is hard wired using the terminal blocks, these modules also have a RJ45 connector making connections to the VP-EC-RDU and VP-EC-RDU-MINI LCD displays a snap! by using standard Ethernet cables. Power to the LCD's are carried over the standard cable.

Sample code in Python is available for both displays:

pispi_rdu_lib.py   RDU Library File

pispi_rdu_test.py RDU Test Code

pispi_rdu_mini_test.py  RDU Mini Test Code

These RDU Display Python code examples work with both the PI-SPI-DIN series modules and the PI-SPI-RS485 module.