PI-SPI-DIN-4AO Raspberry Pi DIN Rail Analog Output 4-20mA Interface

Regular price $36.95 USD Sale

This is the DIN rail mountable version of the Pi-Spi-2AO Analog Input Interface! The PI-SPI-DIN-4AO is based on the Microchip MCP4728 12 bit D/A converter with the I2C Interface.

The MCP4728 can have up to 7 programmable I2C addresses allowing 8 PI-SPI-DIN-4AO's to be daisy chained together for a total of 32 analog 4-20 mA outputs.

Each module in the PI-SPI-DIN series has two 16 Pin GPIO ports that carry power, SPI, I2C and 5 Chip Selects from the main PI-SPI-DIN-RTC-RS485 Module. Also, each module has it's own 5VDC switching power supply and 3.3VDC LDO regulator.


  • Two 16 Pin GPIO Ports (Power, SPI, I2C and 5 Chip Selects)
  • 5 VDC 0.5A Switching Power Supply (9 to 24 VDC Input)
  • 3.3VDC LDO regulator
  • Terminal Blocks are rising clamp cage screw type (no leaf springs)
  • Blue LED indicator for power
  • MCP4728 A/D Converter with 12 bit resolution
  • I2C Interface with buffering
  • I2C Address Range 0x60 to 0x67
  • Analog output drive at 24 VDC field power is 1000 Ohms
  • Each output circuit has a signal strength LED
  • PCB Dimensions: 2.7" Wide x 3.42" Long

Mounting Styles:

Each PI-SPI-DIN module has three mounting styles available:

  • PCB on Spacers
  • DIN rail Clips
  • DIN rail Enclosure


PI-SPI-DIN-4AO Raspberry Pi Analog Output 4-20 mA Interface

PI-SPI-DIN-4AO Accessories :

All PI-SPI-DIN Interfaces come complete with interconnect ribbon cables and all necessary hardware based on enclosure style.

Typical Application with pcb DIN clip mounting:

Typical Application with DIN Rail Enclosure mounting:



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

Node-RED and the PI-SPI-DIN Series

for instructions.




PI-SPI-DIN-4AO Schematic



For Python Sample Code, please visit:

PI-SPI-DIN-4AO Python Code Samples

Basic Python "Write" Analog Output D/A Counts Program:

from time import sleep
from widgetlords.pi_spi_din import *

outputs = Mod4AO()

while True:
    outputs.write_single(0, 800)    # 4 mA
    outputs.write_single(1, 800)    # 4 mA
    outputs.write_single(2, 4000)   # 20 mA
    outputs.write_single(3, 4000)   # 20 mA