Analog to Digital Converter
Version 1 of the Pi-oT Module features an MCP3208/3008 Analog to Digital Converter (ADC) on the SPI0 channel. Documentation for the chip can be found here.
A simple python script shown below can be used to interface with the ADC chip to print values read by the 8 inputs.
with mcp3008.MCP3008() as adc:
print adc.read([mcp3008.CH0]) #prints raw data [CH0]
More information about the mcp3208 python library can be found here, and information on the mcp3008 library can be found here.
NOTE: The analog input range for the module is 0-3.3V. Do not apply more than 3.3v to any analog input or damage may occur.
The Commercial modules use Songle SRD model relays, and the Industrial modules use Panasonic JS1 model relays. The respective data sheets can be found here and here.
The control of the 5 on-board relays is accomplished simply by the use of GPIO pins 5,6,13,19, and 26. A sample python script below can be used to cycle through the relays.
import RPi.GPIO as GPIO
from time import sleep
Selectable jumpers provided on the board allow the use of other GPIO pins. To change the relay control pins, simply remove the jumper and connect the male relay control pin to the desired GPIO pin.