S&S Systems OPTO and ISOLATED SPI INTERFACE BOARDS

Size: px
Start display at page:

Download "S&S Systems OPTO and ISOLATED SPI INTERFACE BOARDS"

Transcription

1 S&S Systems OPTO and ISOLATED SPI INTERFACE BOARDS connect the Raspberry Pi and any SPI Microcontroller safely to the real world design, software & manual Dr Stephen Alsop S&S Systems, England RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

2 OPTO and ISOLATED SPI INTERFACE BOARDS for connecting the Raspberry Pi and any SPI Microcontroller safely to the real world 3.5mm standardised industrial plug-in terminal connectors. SPI high speed interface connects to the Raspberry Pi and any SPI microcontroller, eg PICs, Atmel, etc. 26W IDC to directly connect to the GPIO port on the Raspberry Pi (all versions: V1 or V2, type A, A+, B, B+ and the single card version). Auxiliary SPI 0.1" header to connect to other microcontrollers. Daisy-chain to connect multiple boards. UK ISO9001 Accredited Company, testing traceable to UK calibration standards. Powered by the Raspberry Pi bus, subject to connected devices, or by an external regulated 5V supply. Driver & example software written in C for maximum speed and efficiency. GNU C compiler is supplied with the Raspberry Pi. INTERFACE BOARDS RPI16IN: 16 channel 5V AC/DC opto isolated inputs with LED channel indicators, 8 boards allow 128 inputs. RPI16OUT: 16 channel 100V at 60mA opto isolated outputs with LED channel indicators, 8 boards allow 128 outputs. RPIADCISOL: 4 isolated (with individual power supplies) plus 2 direct differential input 24-bit ADC channels, uses MCP3913 ADC, with Programmable Gain Amplifiers to give a differential input range from ± to ±0.600V, Programmable Sampling Rate and Phase Delay Compensation between channels. Additional 8 digital opto inputs and outputs for use in other applications such as PWM. DISTRIBUTED BY Zeal Electronics Ltd Church View Business Park Coney Green Road, Clay Cross Chesterfield, Derbyshire S45 9HA, England e: rpi@zeal-electronics.co.uk t: +44 (0) for prices please visit MANUAL DOWNLOAD EXAMPLE SOFTWARE - CONTACT rpi@zeal-electronics.co.uk RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

3 TABLE OF CONTENTS WHY USE OPTO AND GALVANICALLY ISOLATED INTERFACES EXAMPLE OF ISOLATED INPUTS USING A RPI16IN EXAMPLE OF ISOLATED INPUTS USING A RPI16OUT EXAMPLE OF ISOLATED INPUTS USING A RPIADCISOL ISOLATION, EMC AND DIRECTIVES - NO WARRANTY GIVEN EXAMPLE SOFTWARE - NO WARRANTY REGARDING SUITABILITY RASPBERRY Pi GPIO PORT CONNECTS TO ISOLATED BOARDS MODEL A AND B HARDWARE VERSION 1 AND 2 USE 26W GPIO PORT GPIO PINS VARY BETWEEN RASPBERRY Pi VERSION 1 & 2 (IN BOTH MODEL A & B VERSIONS) RASPBERRY PI VERSION 1.0 FOR MODEL A & B GPIO PORT RASPBERRY PI VERSION 2.0 FOR MODEL A & B GPIO PORT Raspberry Pi B+ and Raspberry Pi 2 B WITH 40W GPIO PORT Raspberry Pi A+ WITH 40W GPIO PORT RASPBERRY PI MODEL A+ and B+ GPIO PORT RPI BOARD 26W IDC INPUT SCHEMATIC CONNECTIONS USED BY RPI BOARDS POWER REQUIREMENTS OF THE RPI INTERFACE CARDS BOARD CONNECTORS RPI16IN - 16 OPTO ISOLATED INPUT INTERFACE ADVANTAGES OF BEING OPTO ISOLATED FEATURES INPUT OPTO ISOLATORS RPI16IN INTERFACE BOARD LAYOUT SETTING RPI16IN LINKS: POWER SUPPLY, CE, FUNCTION AND BOARD ADDRESS POWER SUPPLY USING THE RASPBERRY PI TO SUPPLY POWER TO RPI16IN BOARD USING AN EXTERNAL 5V TO SUPPLY POWER TO RPI16IN BOARD CHIP ENABLE (CE) AND FUNCTIONS LINKS - HEADER H INTA AND INTB FUNCTION LINKS GPIO PINS USED ON CE AND FUNCTION LINKS - HEADER H ADDRESS LINKS AUXILIARY SPI CONNECTOR AUXILIARY SPI CONNECTOR INPUT OPTO CONNECTIONS RPI16IN EXAMPLE SETUPS RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

4 USING A SINGLE RPI16IN INTERFACE BOARD TO READ INPUTS 1 TO USING 8 X RPI16IN INTERFACE BOARDS TO READ INPUTS 1 TO SOFTWARE SETUP RPI16OUT - 16 OPTO ISOLATED OUTPUT INTERFACE ADVANTAGES OF BEING OPTO ISOLATED FEATURES OUTPUT OPTO ISOLATORS RPI16OUT INTERFACE BOARD LAYOUT SETTING RPI16OUT LINKS: POWER SUPPLY, CE, FUNCTIONS AND BOARD ADDRESS POWER SUPPLY USING THE RASPBERRY PI TO SUPPLY POWER TO RPI16OUT BOARD USING AN EXTERNAL 5V TO SUPPLY POWER TO RPI16OUT BOARD CHIP ENABLE (CE) AND FUNCTIONS LINKS - HEADER H INTA AND INTB FUNCTION LINKS GPIO PINS USED ON CE AND FUNCTION LINKS - HEADER H ADDRESS LINKS AUXILIARY SPI CONNECTOR AUXILIARY SPI CONNECTOR CONNECTING OUTPUTS EXTENDING THE OUTPUT SWITCHING CAPABILITY MINIMUM LOAD RESISTANCE RPI16OUT EXAMPLE SETUP USING A SINGLE RPI16OUT INTERFACE BOARD TO CONTROL OUTPUTS 1 TO SOFTWARE SETUP RPIADCISOL - 6 CHANNEL ADC (4 ARE GALVANICALLY ISOLATED) ADVANTAGES OF BEING GALVANIC OR OPTO ISOLATED FEATURES MICROCHIP MCP CHANNEL DIFFERENTIAL INPUT DELTA-SIGMA ADC MCP3913 DESCRIPTION DITHERING APPLICATIONS RPIADCISOL INTERFACE BOARD LAYOUT SETTING RPIADCISOL LINKS: POWER SUPPLY, CE AND FUNCTIONS POWER SUPPLY USING THE RASPBERRY PI TO SUPPLY POWER TO RPIADCISOL BOARD USING AN EXTERNAL 5V TO SUPPLY POWER TO RPIADCISOL BOARD CHIP ENABLE (CE) AND FUNCTIONS LINKS - HEADER H IO7 AND IO8 FUNCTION LINKS RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

5 GPIO PINS USED ON CE AND FUNCTION LINKS - HEADER H AUXILIARY SPI CONNECTOR AUXILIARY SPI CONNECTOR DIGITAL INPUT & OUTPUT OPTO ISOLATORS INPUT PASSED TO OUTPUT OPTOS AND SWITCHING TRANSISTORS - IGNORING THE RASPBERRY PI INPUT OPTO CONNECTIONS INPUT i1 AND OUTPUT o1 ON GPIO PIN 5 (ADC_IO0) - USE ONLY AS OUTPUT READING OPTO INPUTS i1 to i8 - GPIO PORT LEVEL, OUTPUT OPTO STATUS OUTPUT OPTO CONNECTIONS SWITCHING OPTO OUTPUTS o1 to o8 - GPIO PORT LEVEL OPEN COLLECTOR NMOS TRANSISTOR CONNECTIONS SWITCHING NMOS OUTPUT TRANSISTORS o1 to o8 - GPIO PORT LEVEL GPIO PINS CONNECTED TO THE INPUT/OUTPUT OPTOS, IO1 to IO ADC INPUTS 1 TO INPUTS 1 AND 2 - DIRECT INPUTS WITH NO ISOLATION INPUTS 1 TO 2 CONNECTIONS INPUTS 3 TO 6 - VIA AMC1200 ISOLATED OP-AMPS INPUTS 3 TO 6 ISOLATED CONNECTIONS ADC PROGRAMMABLE GAIN AMPLIFIER, PGA, GAIN = 1 to ADC GAIN = 1 (±600mV full scale range) ISOLATED INPUTS 3 TO 6 GAIN SETTING (ADC CH3..5) ADC GAIN FOR CH3..5 (INPUTS 3 TO 6) = 2 (±300mV full scale range) RPIADCISOL EXAMPLE SETUP SOFTWARE SETUP RASPBERRY PI AND C PROGRAMMING - SOFTWARE EXAMPLES OBTAINING THE RPI EXAMPLE SOURCE CODE C PROGRAMMING - GNN C and C++ COMPILER IMPORTANT - BEFORE UPDATING RASPBERRY PI OS AND FIRMWARE SET THE RASPBERRY PI CLOCK BEFORE UPDATING OR RUNNING A NEW PROGRAM UPDATE RASPBERRY PI OS AND ALL CURRENT PACKAGES UPDATE BROADCOM RPI FIRMWARE CHECK BROADCOM RPI FIRMWARE VERSION CHECK RPI GPU FIRMWARE VERSION DOWNLOAD LATEST VERSION OF bcm2835.c and bcm2835.h files RECOMPILE YOUR PROJECT APPLICATION IN FULL RPI16IN EXAMPLE SOFTWARE How to control the RPI16IN board using the rpi16inout.c software RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

6 1. Initialise the GPIO hardware, the SPI module then the RPI16IN hardware Read individual input optos to test ON or OFF status Read and test ON or OFF status of all 16 inputs on a single board to At the end, close the SPI module and hardware then exit the program COMPILING AND LINKING RPI16IN Run the rpi16in program rpi16in makefile explained RPI16OUT EXAMPLE SOFTWARE How to control the RPI16OUT board using the rpi16inout.c software Initialise the GPIO hardware, the SPI module then the RPI16OUT hardware Turn individual output optos ON or OFF Control all 16 output optos on a single board, turning them ON or OFF At the end, close the SPI module and hardware then exit the program COMPILING AND LINKING RPI16OUT Run the rpi16out program rpi16out makefile explained RPIADCISOL EXAMPLE SOFTWARE How to control the RPIADCISOL board using the rpiadcmcp3913.c software Initialise the GPIO hardware, the SPI module then the RPIADCISOL hardware Reading ADC channels Reading opto inputs i1 to i Turning output optos or direct outputs o1 to o8 on or off At the end, stop the SPI module, close the bcm2835 lib then exit the program: ADC - ZERO INPUT OFFSET TO REMOVE ADC ZERO INPUT OFFSET ADC - DIGITALLY FILTERING AND AVERAGING READINGS MEDIAN FILTERING KALMAN AVERAGING ADC - DITHER, BOOST, CLOCKS, OSR AND SAMPLING RATES DITHER BOOST MCLK - MASTER CLOCK AMCLK - ANALOG MASTER CLOCK DMCLK - DIGITAL MASTER CLOCK OSR - OVER SAMPLING RATE DRCLK - DATA RATE DRCLK - SAMPLING RATE CALCULATIONS EXAMPLES OF CLOCKS, OSR AND SAMPLING RATES RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

7 ADC FUNCTIONS PHASE0 AND PHASE1 REGISTERS - PHASE TIMING BETWEEN ADC CHANNELS GAIN, PROGRAMMABLE GAIN AMPLIFIER (PGA) VALUE OF EACH BIT WHEN USING 24-bit ADC: ISOLATED INPUTS 3 to 6 (ADC ch2 to 5) THROUGH AMC1200 OP-AMP WITH EFFECTIVE AV = 4: STATUSCOM REGISTER CONFIG0 REGISTER CONFIG1 REGISTER OFFSET CALIBRATION REGISTERS GAIN CALIBRATION REGISTERS LOCK/CRC REGISTER RESET TEST IF ADC IS BUSY ADC PARAMETERS INITIALISATION LOCK/CRC REGISTER: PHASE REGISTER GAIN REGISTER STATUSCOM REGISTER CONFIG0 REGISTER CONFIG1 REGISTER: OFFSET CALIBRATION REGISTERS: GAIN CALIBRATION REGISTERS: READING ADC COMPILING AND LINKING RPIADCISOL Run the rpiadcisol program rpiadcisol makefile explained CERTIFICATES OF CONFORMITY RPI16IN CERTIFICATE OF CONFORMITY RPI16OUT CERTIFICATE OF CONFORMITY RPIADCISOL CERTIFICATE OF CONFORMITY RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

8 TABLE OF ILLUSTRATIONS Raspberry Pi Mod B Computer - GPIO 26W Connector P1 at the top left, pin 1 bottom row left side. 13 Raspberry Pi Mod B Computer - general hardware layout W IDC cable connected to Raspberry Pi GPIO port connector P1 - pin 1 is on lower row, left side.. 14 Connecting Raspberry Pi Model A or B to S&S isolated boards - daisy-chain one to the next Raspberry Pi version 1 for model A & B - GPIO layout on connector P Raspberry Pi version 2 for model A & B - GPIO layout on connector P Raspberry Pi B+ Computer - GPIO 40W connector J8, where pin 1 is bottom row left side Raspberry Pi 2 B+ Computer - GPIO 40W connector J8, where pin 1 is bottom row left side Raspberry Pi Mod A+ Computer - GPIO 40W connector J8, where pin 1 is bottom row left side W IDC Cable Connected to Raspberry Pi Model B+ GPIO Port Connector J Raspberry Pi A+ and B+ and Raspberry Pi 2 A and B 40W GPIO Port Schematic Raspberry Pi A+ and B+ and Raspberry Pi 2 A and B GPIO layout on connector J RPI boards' 26W IDC input schematic mm plug-in screw connector with typical dimensions - RPICON/3.5/ mm plug-in connector, 7mm stripping length mm plug-in connectors used in the RPI16IN, RPI16OUT, RPIADCISOL boards RPI16IN - 16 channel opto isolated input interface Raspberry Pi connected to an RPI16IN Raspberry Pi connected to an RPI16IN which is daisy-chained to another RPI16IN to give 32 inputs.. 24 RPI16IN board layout RPI16IN board layout showing isolated connectors labelled blue Quad input opto isolator with input status LEDs Power supply connector and link POWER supply link (H4) and EXTERNAL power connector (J1) Function configuration links (H1) Chip enable (CE) and Functions header (H1) RPI16IN ADDRESS links to set board address Auxiliary SPI 0.1" header connector to connect to other micros Connecting inputs to the RPI16IN RPI16OUT - 16 channel opto isolated output interface Raspberry Pi connected to an RPI16IN, which is daisy-chained to an RPI16OUT RPI16OUT interface layout RPI16OUT board layout showing isolated connectors labelled blue RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

9 Quad output opto drivers fitted using low-profile 16-pin DIL sockets and output status LEDs RPI16OUT board quad Darlington TLP627 output drivers Power supply connector and link POWER supply link (H4) and EXTERNAL power connector (J1) Function configuration links (H1) Chip enable (CE) and Function links, header (H1) RPI16OUT address links To set board address Auxiliary SPI 0.1" header connector to connect to other micros Connecting outputs to the RPI16OUT Controlling a high power fan motor using an intermediate slave relay RPIADCISOL - 4 channel isolated and 2 channel direct ADC and opto digital interface RPIADCISOL - isolated ADC and digital Interface connected to Raspberry Pi RPIADCISOL - isolated ADC and digital interface daisy-chained to a RPI16IN board RPI16ADCISOL board layout RPI16ADCISOL board layout showing isolated connectors Simplified block schematic of the RPIADCISOL POWER supply link (H4) and EXTERNAL power connector (J9) Function configuration links Chip enable (CE) and Function links, header (H1) Auxiliary SPI 0.1" header connector to connect to other micros Connecting inputs to the RPIADCISOL digital optos i1 to i Connecting outputs to the RPIADCISOL digital optos o1 to o Eight open-collector NMOS digital outputs Connecting outputs to the RPIADCISOL NMOS output transistors o1 to o Direct Input 2 showing resistor and capacitor values for reference Reading a Rogowski Coil using non-isolated ADC input AMC1200 isolated op-amp galvanic representation Isolated input 3 showing resistor and capacitor values for reference Isolated reading of motor current using a shunt which is connected to the live supply RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

10 WHY USE OPTO AND GALVANICALLY ISOLATED INTERFACES An opto isolator, also known as an opto coupler, is an electronic device that prevents high voltages from components in one side of a circuit from damaging or interfering with components on the other side of the same circuit. This prevents voltage spikes from impacting on more than a single circuit and decreases the overall interference and noise that occurs with traditional wired connections. A galvanic isolator also has the same effect. There are many situations where signals and data need to be transferred from one subsystem to another within a piece of electronics equipment, or from one piece of equipment to another, without making a direct ohmic electrical connection. Often this is because the source and destination are (or may be at times) at very different voltage levels, for example a microprocessor which is operating from 5V DC but being used to control a triac which is switching 240V AC. In such situations the link between the two must be an isolated one so as to protect the microprocessor from overvoltage damage or spikes. Relays can of course provide this kind of isolation, but even small relays tend to be fairly bulky compared with ICs and many of today's other miniature circuit components. Because they are electro-mechanical, relays are also not as reliable and are only capable of relatively low speed operation. Where small size, higher speed and greater reliability are important, a much better alternative is to use an opto isolator. These use a beam of light to transmit the signals or data across an electrical barrier and achieve excellent isolation. Opto and galvanic isolators can make electrical devices safer, less prone to damage, and more efficient by removing all or nearly all interference, including electrical interference that lightning strikes create, power surges, alternating pulses and electrostatic discharge. If input sensors, input switches, output devices, output relays, etc, are wired directly to the Raspberry Pi (or any computer), the Raspberry Pi, due to the common ground (0V) would be at the same voltage potential as the connected devices. The common connections would create earth loops and interference would enter the Raspberry Pi circuits, which could either damage its hardware or cause the program to 'crash.' Also, if the wiring to the input switches, input sensors, output relays, etc, runs alongside equipment, such as electric motors, lighting controllers, solenoids, etc, when that equipment is turned on or off, there is a distinct possibility that an interference pulse would be sent down the wiring into the Raspberry Pi, which would then be damaged or it could create a glitch in the program causing it to 'crash.' Such adverse effects would be disastrous in industrial control applications. To minimise the effects of earth loops and interference pulses it is advisable to optically couple (or galvanically isolate) all of the input switches, input sensors, input ADC, output relays, etc. Such isolation will allow the Raspberry Pi to operate off its own +5V power supply with its own Ground (0V) without any externally connected equipment pushing electrical impulses and current loops back into the Raspberry Pi. EXAMPLE OF ISOLATED INPUTS USING A RPI16IN An example could be a Raspberry Pi monitoring alarm or machinery contacts, which are at higher potentials above ground or at differing potentials from each other. In addition if the wiring from these needed to be run around a factory alongside other electrically noisy items electrical interference would be superimposed into the inputs thus degrading the actual signal. If there was no input isolation, the varying potentials of the contacts, the ground loops and the interference would damage or disrupt the operation of the Raspberry Pi. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

11 However, if a RPI16IN opto isolator board was used, each input would be isolated from one another. Higher potentials, ground loops and interference would therefore be removed or reduced to a minimum and the Raspberry Pi would not be damaged. EXAMPLE OF ISOLATED INPUTS USING A RPI16OUT An example could be a Raspberry Pi switching power contactors or devices, which are at higher potentials above ground or at differing potentials from each other. If there was no output isolation, the varying potentials and the ground loops due to the equipment would damage or disrupt the operation of the Raspberry Pi. However, if a RPI16OUT opto isolator board was used, each output would be isolated from one another. Higher potentials, ground loops and interference would therefore be removed or reduced to a minimum and the Raspberry Pi would not be damaged. EXAMPLE OF ISOLATED INPUTS USING A RPIADCISOL An example could be a Raspberry Pi using the galvanically isolated ADC inputs to monitor voltages across shunts, etc, which are in series with the power supply of machinery in order to monitor the current flowing through the machines. They could be used for monitoring the potentials of such as solar panels, etc, which are all at differing potentials. The wiring to the ADC inputs may also need to run alongside electrically noisy equipment. If there was no ADC input isolation, the varying potentials of the inputs, the ground loops and the interference would damage or disrupt the operation of the Raspberry Pi and the ADC readings would be corrupted. However, if a RPI16ADCISOL isolator board was used, each input would be isolated from one another. Higher potentials, ground loops and interference would therefore be removed or reduced to a minimum and the Raspberry Pi would not be damaged. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

12 ISOLATION, EMC AND DIRECTIVES - NO WARRANTY GIVEN These evaluation boards are intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION OR EVALUATION PURPOSES ONLY and is not considered by Zeal Electronics Ltd, S&S Systems, S Alsop or associates to be a finished end-product fit for general consumer use. Persons handling the product or products must have electronics training and observe good engineering practice standards and take professional advice. As such, the goods being provided are not intended to be complete in terms of required design, required marketing and/or required manufacturing related protective considerations, including product safety and environmental measures typically found in end products that incorporate such semiconductor components or circuit boards. These evaluation boards do not fall within the scope of the European Union directives regarding electromagnetic compatibility, restricted substances (RoHS), recycling (WEEE), FCC, CE or UL, and therefore may not meet the technical requirements of these directives or other related directives. Whilst the opto and galvanic isolator coupling devices have manufacturers' ratings up to several kilo volts, due to board layout and the on-board isolated DC to DC power supplies in the RPIADCISOL, it would not be advisable to work at potentials greater than 24V. Also, the boards are not to be used in any medical applications, as there could be a risk of electrocution due to component failure. Whilst they have been designed and manufactured in good faith, it is up to the user to obtain professional advice as to their suitability in their specific applications, because Zeal Electronics Ltd, S&S Systems, S Alsop and associates cannot be held responsible as to how or where they are to be used. Please see the Certificates of Conformity at the end of this manual, which show that the boards have been isolation tested at 1kV, however, the user must have the appropriate skills, must take professional advice and take full responsibility if using voltages greater than 24V. EXAMPLE SOFTWARE - NO WARRANTY REGARDING SUITABILITY The example and driver software is supplied on the understanding that it is for educational purposes for use with these S&S isolated boards, and no warranty can be given or implied as to its suitability under any circumstances. Whilst the software has been designed and written in good faith, it is up to the user to obtain professional advice as to suitability in their specific applications, because Zeal Electronics Ltd, S&S Systems, S Alsop and associates cannot be held responsible as to how or where it is to be used. The software is copyrighted under the GNU licensing terms - please see the comments in the source code. If it is to be used in a commercial environment, please contact Dr Stephen Alsop, c/o Zeal Electronics Ltd to obtain a suitable licence. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

13 RASPBERRY Pi GPIO PORT CONNECTS TO ISOLATED BOARDS WARNING: always ensure that the power is OFF before connecting or disconnecting any interfaces, cables or leads. The S&S Systems isolated interface boards are connected to the Raspberry Pi using a 26W to 26W or a 40W to 26W ribbon cable, depending on the model of the Raspberry Pi. Info: to connect to other microcontrollers the 8 pin 0.1" header, marked Auxiliary SPI Connector on the S&S opto isolated boards, can be used in place of the 26W connectors. MODEL A AND B HARDWARE VERSION 1 AND 2 USE 26W GPIO PORT Raspberry Pi Model A and B computers use a 26W General Purpose Input/Output (GPIO) port, which is marked connector P1 at the top left as seen in the below library picture. Raspberry Pi Mod B Computer - GPIO 26W Connector P1 at the top left, pin 1 bottom row left side Raspberry Pi Mod B Computer - general hardware layout RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

14 Connector P1 consists of 2 rows of 13 pins and because it is not a 'keyed' IDC connector it is essential that the female socket of the IDC cable is plugged in the correct way round and without any pins sticking out of either side as seen in this example 26W IDC cable connected to Raspberry Pi GPIO port connector P1 - pin 1 is on lower row, left side The other end of the 26W IDC connects to the first S&S isolated board and the subsequent boards are 'daisychain' linked from each other using 26W IDC cables. Connecting Raspberry Pi Model A or B to S&S isolated boards - daisy-chain one to the next GPIO PINS VARY BETWEEN RASPBERRY Pi VERSION 1 & 2 (IN BOTH MODEL A & B VERSIONS) Some of the 26W GPIO input/output pins are connected differently, depending on the hardware version of the board as shown below. Note the differences on pins 3, 5 and 13. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

15 RASPBERRY PI VERSION 1.0 FOR MODEL A & B GPIO PORT The GPIO connections for Model A and B hardware version 1.0 are shown below. Raspberry Pi version 1 for model A & B - GPIO layout on connector P1 RASPBERRY PI VERSION 2.0 FOR MODEL A & B GPIO PORT The GPIO connections for Model A and B hardware version 2.0 are shown below. Raspberry Pi version 2 for model A & B - GPIO layout on connector P1 RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

16 Raspberry Pi B+ and Raspberry Pi 2 B WITH 40W GPIO PORT Raspberry Pi B+ and Raspberry Pi 2 B computers use a 40W General Purpose Input/Output (GPIO) port, which is marked connector J8. The first 26 pins on this 40W connector match those of the earlier Model B revision 2.0 Raspberry Pi for backward compatibility. The remaining are additional GPIO pins. Raspberry Pi B+ Computer - GPIO 40W connector J8, where pin 1 is bottom row left side Raspberry Pi 2 B+ Computer - GPIO 40W connector J8, where pin 1 is bottom row left side Raspberry Pi A+ WITH 40W GPIO PORT Raspberry Pi A+ and Raspberry Pi 2 A, when released, computers use a 40W General Purpose Input/Output (GPIO) port, which is marked connector J8. The first 26 pins on this 40W connector match those of the earlier Model A & B revision 2.0 Raspberry Pi for backward compatibility. The remaining are additional GPIO pins. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

17 Raspberry Pi Mod A+ Computer - GPIO 40W connector J8, where pin 1 is bottom row left side Connector J8 consists of 2 rows of 20 pins and because it is not a 'keyed' IDC connector it is essential that the female socket of the IDC cable is plugged in the correct way round and without any pins sticking out of either side. To connect the model A+ or B+ to the first S&S isolated board, use a 40W to 26W ribbon cable adaptor as shown below. 40W IDC Cable Connected to Raspberry Pi Model B+ GPIO Port Connector J8 RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

18 Raspberry Pi A+ and B+ and Raspberry Pi 2 A and B 40W GPIO Port Schematic RASPBERRY PI MODEL A+ and B+ GPIO PORT Raspberry Pi A+ and B+ and Raspberry Pi 2 A and B GPIO layout on connector J8 RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

19 RPI BOARD 26W IDC INPUT SCHEMATIC For information, the following is part of the schematic of the 26W IDC input as used on the RPI interface boards. RPI boards' 26W IDC input schematic CONNECTIONS USED BY RPI BOARDS As seen in the previous schematic, the connections actively used by the RPI16IN, RPI16OUT, RPIADCISOL Raspberry Pi boards are as follows: GPIO Pin 2, etc = +5V Pin 6, etc = 0V Pin 11 = GPIO17 = CE2 Pin 15 = GPIO22 = CE3 Pin 16 = GPIO23 = INTA (if used) Pin 18 = GPIO24 = INTB (if used) Pin 19 = GPIO10 = MOSI Pin 21 = GPIO9 = MISO Pin 22 = GPIO25 = RESET (if used) RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

20 Pin 23 = GPIO11 = SCLK Pin 24 = GPIO8 = CEO Pin 26 = GPIO7 = CE1 The rest of the GPIO is connected to the RPIADCISOL for use, if required, as spare opto isolated inputs or outputs and if these are not being used by the RPIADCISOL user's applications, these spare GPIO pins can be used for other applications. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

21 POWER REQUIREMENTS OF THE RPI INTERFACE CARDS See the Raspberry Pi instruction books, which detail how to set up the hardware and power supply. The Raspberry Pi is powered via the 5v micro USB connector. The typical current consumption for the various models when idling/using are: Model B = 360 / 480mA Model B+ = 200 / 330mA Model A = 140 / 320mA Model A+ = 100 / 230mA All plus extra current used by the mouse, keyboard and any additionally connected interface cards (if they are configured to use power from the Raspberry Pi). Check the manufacturer's data sheet to obtain the current consumptions for the different variations. It is recommended to use a high quality 2.0A (2000mA) power supply from a reputable supplier, such as RS Components or Farnells, so as to provide ample power to run the Raspberry Pi. If you need to connect additional USB devices or interface cards which would take the overall power requirements of the Raspberry Pi above the amount as recommended by Raspberry Pi, then an externally powered USB hub should be used. Ensure that the hub's power supply is capable of supplying the required current. The S&S opto isolated interface cards can be configured by the header links to take their +5V power either from the Raspberry Pi GPIO port or from another separately regulated +5V power supply. This is because, if only 1 interface card is used, there would probably be sufficient power available from the Raspberry Pi GPIO port. The power requirements of the interface boards are: If 8 x RPI16IN interfaces were used, their overall current requirements would be 8 x 50mA = 400mA. If 8 x RPI16OUT interfaces were used, their overall current requirements would be 8 x 150mA = 1200mA. If 1 x RPIADCISOL interface was used, its current requirement would be 200mA. Therefore if all 17 interface cards were daisy-chained and connected to the Raspberry Pi, the overall current requirements would be ( ) ma, ie 1800mA (1.8A). This is nearly at the limit for the model B+ and over the limit for models A and B. Therefore, when a large number of interface cards are used, they ought to be externally powered from a separate suitably rated regulated +5V power supply and not use the Raspberry Pi GPIO port for their power. See the section explaining how to set the power supply links on each interface board, which determine whether the interface boards draw their power from the Raspberry Pi bus or from the external power supply connector. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

22 BOARD CONNECTORS The input, output and external power supply connectors on the RPI16IN, RPI16OUT and RPIADCISOL interface boards are screw type 3.5mm plug-in female removable plugs. They have been chosen so that the interface boards can be unplugged easily from the installation and the connectors are an industrial standard type. The plug connectors can be obtained from Zeal Electronics Ltd and the part number is RPICON/3.5/xx, where xx is the number of ways. For example, an 8 way removable plug-in female connector is RPICON/3.5/8. They are available in 2W, 4W, 8W and 16W. The below example shows an 8 way connector. 3.5mm plug-in screw connector with typical dimensions - RPICON/3.5/8 The connecting wire size is 1.50mm² for single solid wire or 1.00mm² for stranded wire and insulation stripping length is 7mm. 3.5mm plug-in connector, 7mm stripping length 3.5mm plug-in connectors used in the RPI16IN, RPI16OUT, RPIADCISOL boards RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

23 RPI16IN - 16 OPTO ISOLATED INPUT INTERFACE This is a small board which has 16 optically isolated inputs. The isolate inputs will operate between 3 and 8V, either AC or DC and higher voltage inputs can be used by simply putting a resistor in series and so they are suitable for industrial use. They are suitable for connecting to all versions of the current Raspberry Pi (versions 1 & 2, type A, A+, B, B+ and the single card industrial Raspberry Pi Computer Module) and for connecting to any microcontroller with an SPI interface, eg Microchip PICs and Atmel. Up to 8 boards can be daisy-chained together to give 128 optically isolated inputs to the Raspberry Pi or micro. RPI16IN - 16 channel opto isolated input interface Raspberry Pi connected to an RPI16IN RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

24 Raspberry Pi connected to an RPI16IN which is daisy-chained to another RPI16IN to give 32 inputs ADVANTAGES OF BEING OPTO ISOLATED When outputs or inputs are optically isolated, it prevents high voltages from the components being switched or monitored, from damaging or interfering with the Raspberry Pi. For example, outputs could be connected to switch devices which are at ±500V about ground and similarly inputs could monitor switch circuits which are also at ±500V about ground. An opto isolated ADC input can monitor very low differential voltages on such as a high voltage bus-bar. Even if the inputs and outputs are supposedly within 0 to 3V, if they are on a separate ground circuit or at some distance from the Raspberry Pi, ground loops will occur, which will raise the levels. Without this opto isolation the Raspberry Pi would be destroyed. Isolation considerably reduces the likelihood of impulse voltages and spikes getting back into the Raspberry Pi, which could cause it to crash or be damaged. Isolation is required when used in harsh or industrial applications. FEATURES Size = 60 x 135mm (with 4 x 3mm mounting holes at 52 x 127mm). 3.5mm standard industrial connectors for use with removable 3.5mm screw terminal plugs. (uses 3.5mm screw terminal plugs: 4 x 8W, 1 x 2W) 16 channel 5V AC/DC opto isolated inputs (range = 3V to 8V AC/DC) with LED channel indicators. Expandable from 1 to 8 boards on the same bus to give 1 to 128 separate isolated inputs. Can extend the input voltage above 8V AC/DC by using a series resistor, see later. Voltage isolation tested at 1kV, see certificate of conformity, but limit to 24V for standard users. Uses Microchip MCP23S17-X_SO expander i/c - see the MCP23S17 SPI-I2C 16 bit IO Expander data sheet. SPI interface, high speed up to 10MHz, with Mode 0,0 and 1,1 compatibility. 26W IDC connector for direct connection to the GPIO port on Raspberry Pi (all versions V1 or V2, type A, A+, B, B+ and can connect to the motherboard of the industrial Raspberry Pi Compute Module). RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

25 26W IDC connector to daisy-chain to other S&S isolated boards. Auxiliary SPI interface 0.1 header connector to use with other computers, microprocessors and microcontrollers, which have an SPI port, eg Microchip PICs, Atmel, Arduino, etc. Power consumption = +5V at 50mA. Powered from the Raspberry Pi +5V bus or an external +5V supply. Software examples written in C for the Raspberry Pi. INPUT OPTO ISOLATORS The input opto isolators are quad AC input opto-isolators. To use on input voltages greater than 8V AC/DC add a series resistor: use 143 ohm for every 1V above 8V to limit the input current through the opto to 7mA (use the nearest value), eg for 30V input, use 143 x (30-8) = 3146 ohm, so use a 3.3K resistor, with a rating of 0.33W or more. Voltage isolation tested at 1kV, see certificate of conformity, but limit to 24V for standard users. Opto isolator turn-on time = 9µS and turn-off time = 18µS, which will be in addition to the time taken by the Raspberry Pi to send the turn on or off instruction via the SPI command. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

26 RPI16IN INTERFACE BOARD LAYOUT The RPI16IN board layout is as below. Due to continual improvements, there may be slight variations. RPI16IN board layout The following illustration shows the board hardware layout and indicates which connectors are isolated and those which are not. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

27 RPI16IN board layout showing isolated connectors labelled blue The optical isolators used in the RPI16IN are TCMT4600 devices from Vishay. These are high performance lowprofile quad devices with AC Input and transistor output and they are rated for an isolation test voltage of 3.75kV RMS with a coupling capacitance if a mere 0.3pF. This makes them ideal for high speed applications. However, due to the limitations of the board layout and its associated components, the quoted isolation voltage (measured between signal input ground and the common 0V supply rail) is 1kV, which should be more than adequate for most applications. The following illustration shows the quad optical isolator with input status LEDs. The previous illustration has been reproduced by kind permission of Everyday Practical Electronics Magazine (EPE Magazine). See the February 2015 issue at for their in-depth review of the RPI16IN isolated interface board. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

28 Quad input opto isolator with input status LEDs SETTING RPI16IN LINKS: POWER SUPPLY, CE, FUNCTION AND BOARD ADDRESS Before using and powering the RPI16IN board all of the links need to be set to their correct positions in order to select the power supply, the chip select line (CE) and additional functions, if used. POWER SUPPLY The external power connector and links are at the bottom left of the board as shown below. Power supply connector and link RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

29 POWER supply link (H4) and EXTERNAL power connector (J1) USING THE RASPBERRY PI TO SUPPLY POWER TO RPI16IN BOARD If power to the RPI16IB board is to be supplied by the Raspberry Pi GPIO port, put the H4 link between pins 1 and 2, which is marked '5VRPI BUS'. Note that each of these RPI16OUT boards can draw 50mA. If 8 of these interface boards were connected to give 128 opto isolated inputs, they would need a total of 400mA and so it is recommended to use an external +5V power supply and the link set as below. USING AN EXTERNAL 5V TO SUPPLY POWER TO RPI16IN BOARD If the RPI16IN board is to be supplied by an external power supply, put the H4 link between pins 2 and 3, which is marked '5VEXT INPUT'. Connect an external +5V regulated power supply to the 3.5mm J1 connector marked 50mA', taking care to connect the +5V to pin 1 and 0V to pin 2 of this connector. CHIP ENABLE (CE) AND FUNCTIONS LINKS - HEADER H1 The chip enable (CE) and functions link header H1 is at the middle left of the board as shown below. Info: text, eg CE1, with a line above means that the chip enable CE1 is active when low. This can also be written with a # prefix, ie #CE1, to denote active when low. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

30 Function configuration links (H1) Chip enable (CE) and Functions header (H1) Set the required chip enable (CE0, CE1, CE2, CE3) line. The default CE link for the RPI16IN interface board is CE0 so select that link, which is the top link. Use the same CE0 link for all of the RPI16IN boards, which will enable up to 8 x daisy-chained RPI16IN boards. Link only one CE on the board and ensure that the selected CE does not clash with any other type of SPI board. The RPI16OUT and RPIADCISOL boards should use a different CE line. If more than one RPI16IN board is used in the daisy-chain, set the same CE link on all of the RPI16IN boards, but set a different board address for each board, see later. INTA AND INTB FUNCTION LINKS Set INTA, INTB and RST (reset) links, but only if required - see the MCP23S17 SPI-I2C 16 bit IO Expander data sheet for descriptions of these lines. The lines are not used by default and so leave these links out unless they RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

31 are to be specifically used. If used, ensure that they do not clash with other boards, such as the RPIADCISOL interface board because the RPIADCISOL board uses the same GPIO pins as the INTA and INTB pins (GPIO23 and GPIO24) for IO7 and IO8 and so if either INTA or INTB are used on an RPI16OUT or RPI16IN board, IO7 or IO8 cannot be linked or used on the RPIADCISOL board. GPIO PINS USED ON CE AND FUNCTION LINKS - HEADER H1 LINK RPi i/o GPIO Pin Interface board default use CE0 GPIO8 (CE0) 24 RPI16IN = #CE CE1 GPIO7 (CE1) 26 RPI16OUT = #CE CE2 GPIO17 11 RPIADCISOL = #CE CE3 GPIO22 15 spare = #CE INTA / IO7 GPIO23 16 RPI16IN/RPI16OUT = INTA or RPIADCISOL = IO7 INTB / IO8 GPIO24 18 RPI16IN/RPI16OUT = INTB or RPIADCISOL = IO8 N/C / DR GPIO0 (V1) or GPIO2 (V2) 3 RPI16IN/RPI16OUT = N/C or RPIADCISOL = #DR RST GPIO25 22 RPI16IN/RPI16OUT/RPIADCISOL = #RESET ADDRESS LINKS Up to 8 of the same RPI16IN boards can be daisy-chained to give 8 x 16 = 128 opto isolated outputs, where the first board are inputs 1..16, the second board are inputs and so on. Set the address for each board using the address links, header H2, which is at the middle of the board on the left side, as shown below. RPI16IN ADDRESS links to set board address 0..7 If all of the links are out, the board address will be 0 and when all links are in, the board address will be 7. The board address links and the inputs they read are: ADDRESS LINKS BOARD A2 - A1 - A0 ADDRESS INPUTS IN IN IN IN IN IN - IN IN IN IN IN IN RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

32 When using more than one RPI16IN interface, ensure that each has a different board address, however each one will have the same chip enable CE link set. AUXILIARY SPI CONNECTOR When using other computers or microprocessors, eg Microchip PIC devices, their SPI interfaces can be connected to the Aux SPI Connector, 0.1" header H3, which is at the left side of the interface board rather than wiring to the 26W IDC connector. Do not use this header if already connected to a Raspberry Pi with the 26W IDC cables otherwise the GPIO ports could be damaged. Auxiliary SPI 0.1" header connector to connect to other micros AUXILIARY SPI CONNECTOR 1 = +5 Vbus +5V from connected device which can be used to power this board if Vbus linked. 2 = +3.3 Vreg +3.3V from the board's regulator which can be used to power ext device, max 50mA. 3 = #CE Chip Enable CE line from ext device taken low to enable this board. 4 = SCLK SPI Serial Clock from ext device. 5 = MOSI Master Out (from ext SPI controlling device), Slave In (to on-board SPI device). 6 = MISO Master In (to ext SPI controlling device), Slave Out (from on-board SPI device). 7 = 0V 0V or Ground. 8 = 0V 0V or Ground. Do not put any of the CE0, CE1, CE2, CE3, INTA, INTB, N/A or RST links into the Functions Links section when using the Auxiliary SPI Connector. INPUT OPTO CONNECTIONS Inputs are wired to the 3.5mm plug-in connectors and each opto input is wired in isolated pairs, where input 1 to the board is on pins 1 and 2, input 2 to the board is on pins 3 and 4, etc. (Note that if the board address is set to 2, those inputs would be read as inputs 17 and 18 - see board addressing). The inputs are rated at 5V AC or DC, with a maximum input of 8V AC or DC. A higher input voltage can be used by wiring a resistor in series with the input. Note that if an AC voltage is applied, the actual moment that the opto is read by the Raspberry Pi may be at the point of the AC zero crossing and so it will be read as no signal input and it is therefore advisable to use a DC input voltage. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

33 Connecting inputs to the RPI16IN The inputs are electrically isolated from the Raspberry Pi or microcontroller so this stops or reduces interference and glitches getting back into the computer side of the wiring, which could damage it or cause the program to crash. EXTENDING THE INPUT VOLTAGE SIGNAL RANGE In order to use the inputs on voltages in excess of the nominal 8V AC/DC it is necessary to place a suitably rated fixed resistance of appropriate value in series with the input. As a rule of thumb the resistance value can be calculated on the basis of 143Ω for every 1V above the 8V limit. This arrangement is designed to reduce the input current to approximately 7mA. So, for example, if the input voltage, Vin, is 30V the required value of input resistance is calculated as follows: Rin = (Vin 8) 143 = (30 8) 143 = = 3146Ω The nearest preferred value of resistor is 3.3kΩ and the required power rating can be calculated from: P = V 2 /R = (Vin 8) 2 / Rin = 22 2 / 3300 = 484 / 3300 = 0.15W Hence a fixed resistor of 3.3kΩ rated at ¼W or greater should be perfectly adequate for this application. RPI16IN EXAMPLE SETUPS RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

34 USING A SINGLE RPI16IN INTERFACE BOARD TO READ INPUTS 1 TO Put a link across CE0, in the FUNCTIONS section, which is the default chip enable for the RPI16IN. Do not put a link across RST (reset) unless it is being used. Do not put a link across N/C (no connection). Link INTA and INTB if used (they are not used by default), but if so, IO7 and IO8 on the RPIADCISOL cannot be used. 2. Do not put any links across A0, A1 or A2, in the BOARD ADDRESS section, which will give the board address 0, and so the inputs to this board will be 1 to Put a link across 5VEXT INPUT, in the POWER section, which will require the board to be powered by an external +5V supply. 4. Use a RPICON/3.5/2 plug to connect to the External +5VIN connector J1 and wire an external +5V regulated power supply to this plug, where +5V is wired to pin 1 and 0V is connected to pin Use 16 x RPICON/3.5/2 2W plugs for each input (1 to 16) or use 4 x RPICON/3.5/8 8W plugs to group the inputs into 4. Wire inputs 1 to 16, where input 1 = connector pins 1 & 2, input 2 = connector pins 3 & 4, and so on. 6. Connect a 26W IDC cable to the RPI16IN connector J2, taking note of the key in the connector, such that pin 1 (denoted by the red band on the ribbon cable) is at the top right side of connector J2. 7. Connect the other end of this 26W IDC cable to the Raspberry Pi GPIO connector P1. Take care when doing this as this Raspberry Pi port does not have a keyed socket and so ensure that pin 1 of the 26W IDC cable is connected to pin 1 on the port and that the IDC connector is not inserted with it overhanging at one side. Check this carefully before powering up. Pin 1 on the Raspberry Pi connector is denoted by a square pad on the underside of the PCB. If using a Raspberry Pi Model A+ or B+, which have a 40W GPIO connector, use the 40W adaptor ribbon cable to plug into the Raspberry Pi. Note: if the Raspberry Pi is already connected to other RPI16IN, RPI16OUT, RPIADCISOL boards, connect this IDC cable to those boards to form a daisy-chain. The board will now read inputs 1 to 16. USING 2 X RPI16IN INTERFACE BOARDS TO READ INPUTS 1 TO 32 Setup the first board as above and that board will monitor inputs 1 to 16. On the second board: 1. Put a link across CE0, in the FUNCTIONS section, which is the default chip enable for the RPI16IN and this will obviously be the same for all of the RPI16IN boards on the daisy-chain. Do not put a link across RST (reset) unless it is being used. Do not put a link across N/C (no connection). Link INTA and INTB if used (they are not used by default), but if so, IO7 and IO8 on the RPIADCISOL cannot be used. 2. Put a link across A0 only, in the BOARD ADDRESS section, which will give this board address 1, and so the inputs to this board will be 17 to 32. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

35 3. Put a link across 5VEXT INPUT, in the POWER section, which will require the board to be powered by an external +5V supply. 4. Use a RPICON/3.5/2 plug to connect to the External +5VIN connector J1 and wire an external +5V regulated power supply to this plug, where +5V is wired to pin 1 and 0V is connected to pin 2. This power can be daisy-chained down from the first board's 2W power connector. 5. Use 16 x RPICON/3.5/2 2W plugs for each input (1 to 16) or use 4 x RPICON/3.5/8 8W plugs to group the inputs into 4. Wire inputs 17 to 32, where input 17 = connector pins 1 & 2, input 18 = connector pins 3 & 4, and so on. 6. Connect a 26W IDC cable to the RPI16IN connector J2, taking note of the key in the connector, such that pin 1 (denoted by the red band on the ribbon cable) is at the top right side of connector J2. 7. Connect the other end of this 26W IDC cable to the IDC connector J3 on above RPI16IN board to form a daisy-chain. The 2 boards will now read inputs 1 to 32. USING 8 X RPI16IN INTERFACE BOARDS TO READ INPUTS 1 TO 128 Setup the first and second boards as above and continue to daisy-chain the subsequent boards with 26W IDC cables and link the external power supply to each board. Set the same chip enable CE link for all of the boards. Set different address links on each board so that each has its own unique address, 0 to 7. The 8 boards will now read inputs 1 to 128. SOFTWARE SETUP See the example software for details on how to setup and use the RPI16IN. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

36 RPI16OUT - 16 OPTO ISOLATED OUTPUT INTERFACE This is a small board which has 16 optically isolated outputs. The isolated outputs can switch 100V at 60mA and so are suitable for industrial use. They are suitable for connecting to all versions of the current Raspberry Pi (versions 1 & 2, type A, A+, B, B+ and the single card industrial Raspberry Pi Compute Module) and for connecting to any microcontroller with an SPI interface, eg Microchip PICs and Atmel. Up to 8 boards can be daisy-chained together to give 128 optically isolated outputs from the Raspberry Pi or micro. RPI16OUT - 16 channel opto isolated output interface Raspberry Pi connected to an RPI16IN, which is daisy-chained to an RPI16OUT ADVANTAGES OF BEING OPTO ISOLATED When outputs or inputs are optically isolated, it prevents high voltages from the components being switched or monitored from damaging or interfering with the Raspberry Pi. For example, outputs could be connected to switch devices which are at 500V above ground and similarly inputs could monitor switch circuits which are also at 500V above ground. An opto isolated ADC input can monitor very low differential voltages on such as a high voltage bus-bar. Even if the inputs and outputs are supposedly within 0 to 3V, if they are on a separate ground circuit or at some distance from the Raspberry Pi, ground loops will occur, which will raise the levels. Without this opto isolation the Raspberry Pi would be destroyed. Isolation considerably reduces the likelihood of impulse voltages and spikes getting back into the Raspberry Pi, which could cause it to crash or be damaged. Isolation is required when used in harsh or industrial applications. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

37 FEATURES Size = 60 x 135mm (with 4 x 3mm mounting holes at 52 x 127mm). (version 1 = 130 x 60mm, with 4 x 3mm mounting holes at 52 x 122mm). 3.5mm standard industrial connectors for use with removable 3.5mm screw terminal plugs. (uses 3.5mm screw terminal plugs: 4 x 8W, 1 x 2W) 16 channel opto isolated outputs with LED channel indicators. Expandable from 1 to 8 boards on the same bus to give 1 to 128 separate isolated outputs. Output switching = 100V at 60mA, which is useful to control industrial 24V relays. Voltage isolation tested at 1kV, see certificate of conformity, but limit to 24V for standard users. Uses Microchip MCP23S17-X_SO expander i/c - see the MCP23S17 SPI-I2C 16 bit IO Expander data sheet. SPI interface, high speed up to 10MHz, with Mode 0,0 and 1,1 compatibility. 26W IDC connector for direct connection to the GPIO port on Raspberry Pi (all versions V1 or V2, type A, A+, B, B+ and can connect to the motherboard of the industrial Raspberry Pi Compute Module). 26W IDC connector to daisy-chain to other S&S isolated boards. Auxiliary SPI interface 0.1 header connector to use with other computers, microprocessors and microcontrollers, which have an SPI port, eg Microchip PICs, Atmel, Arduino, etc. Power consumption = +5V at 150mA. Powered from the Raspberry Pi +5V bus or from an external +5V supply. Software examples written in C for the Raspberry Pi. OUTPUT OPTO ISOLATORS The output opto isolators are quad Darlington output transistor opto-isolators. They are fitted on the board using DIL IC sockets to allow changing if any should become damaged. Maximum opto output transistor switching = 100V at 60mA. Isolation is tested at 1kV, see certificate of conformity, but for standard use the max voltage should not exceed 24V. Opto isolator typical turn-on time = 50µS and typical turn-off time = 15µS, which will be in addition to the time taken by the Raspberry Pi to send the turn on or off instruction via the SPI command. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

38 RPI16OUT INTERFACE BOARD LAYOUT The RPI16OUT board layout is as below. Due to continual improvements, there may be slight variations. RPI16OUT interface layout The following illustration shows the board hardware layout and indicates which connectors are isolated and those which are not. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

39 RPI16OUT board layout showing isolated connectors labelled blue The previous illustration has been reproduced by kind permission of Everyday Practical Electronics Magazine (EPE Magazine). See the April 2015 issue at for their in-depth review of the RPI16OUT isolated interface board. The output opto-isolators fitted to the RPI16OUT are quad Darlington TLP627 output drivers. These chips are fitted to the board using four low-profile 16-pin DIL sockets so they can be easily changed if the need ever arises. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

40 Quad output opto drivers fitted using low-profile 16-pin DIL sockets and output status LEDs The internal arrangement of the Darlington drivers is shown in the following illustration. RPI16OUT board quad Darlington TLP627 output drivers SETTING RPI16OUT LINKS: POWER SUPPLY, CE, FUNCTIONS AND BOARD ADDRESS Before using and powering the RPI16OUT board all of the links need to be set to their correct positions in order to select the power supply, the chip select line (CE) and additional functions, if used. POWER SUPPLY The external power connector and links are at the bottom left of the board as shown following. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

41 Power supply connector and link POWER supply link (H4) and EXTERNAL power connector (J1) USING THE RASPBERRY PI TO SUPPLY POWER TO RPI16OUT BOARD If power to the RPI16OUT board is to be supplied by the Raspberry Pi GPIO port, put the H4 link between pins 1 and 2, which is marked '5VRPI BUS'. Note that each of these RPI16OUT boards can draw 150mA and so if more than 1 board is to be connected, it is recommended that an external +5V power supply is used. USING AN EXTERNAL 5V TO SUPPLY POWER TO RPI16OUT BOARD If the RPI16OUT board is to be supplied by an external power supply, put the H4 link between pins 2 and 3, which is marked '5VEXT INPUT'. Connect an external +5V regulated power supply to the 3.5mm J1 connector marked 150mA', taking care to connect the +5V to pin 1 and 0V to pin 2 of this connector. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

42 CHIP ENABLE (CE) AND FUNCTIONS LINKS - HEADER H1 The chip enable (CE) and functions link header H1 is at the middle left of the board as shown in the following illustration. Text, eg CE1 with a line above means that the chip enable CE1 is active when low. This can also be written with a # prefix, ie #CE1, to denote active when low. Function configuration links (H1) Chip enable (CE) and Function links, header (H1) Set the required chip enable (CE0, CE1, CE2, CE3) line. The default CE link for the RPI16OUT interface board is CE1 so select that link, which is the second link down. Use the same CE1 link for all of the RPI16OUT boards, which will enable up to 8 x daisy-chained RPI16OUT boards. Link only one CE on the board and ensure that the selected CE does not clash with any other type of SPI board. The RPI16IN and RPIADCISOL boards should use a different CE line. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

43 If more than one RPI16OUT board is used in the daisy-chain, set the same CE link on all of the RPI16OUT boards, but set a different board address for each board, see later. INTA AND INTB FUNCTION LINKS Set INTA, INTB and RST (reset) links, but only if required - see the MCP23S17 SPI-I2C 16 bit IO Expander data sheet for descriptions of these lines. The lines are not used by default and so leave these links out unless they are to be specifically used. If used, ensure that they do not clash with other boards, such as the RPIADCISOL interface board because the RPIADCISOL board uses the same GPIO pins as the INTA and INTB pin (GPIO23 and GPIO24) for IO7 and IO8 and so if either INTA or INTB are used on an RPI16OUT or RPI16IN board, IO7 or IO8 cannot be linked or used on the RPIADCISOL board. GPIO PINS USED ON CE AND FUNCTION LINKS - HEADER H1 LINK RPi i/o GPIO Pin Interface board default use CE0 GPIO8 (CE0) 24 RPI16IN = #CE CE1 GPIO7 (CE1) 26 RPI16OUT = #CE CE2 GPIO17 11 RPIADCISOL = #CE CE3 GPIO22 15 spare = #CE INTA / IO7 GPIO23 16 RPI16IN/RPI16OUT = INTA or RPIADCISOL = IO7 INTB / IO8 GPIO24 18 RPI16IN/RPI16OUT = INTB or RPIADCISOL = IO8 N/C / DR GPIO0 (V1) or GPIO2 (V2) 3 RPI16IN/RPI16OUT = N/C or RPIADCISOL = #DR RST GPIO25 22 RPI16IN/RPI16OUT/RPIADCISOL = #RESET ADDRESS LINKS Up to 8 of the same RPI16OUT boards can be daisy-chained to give 8 x 16 = 128 opto isolated outputs, where the first board are outputs 1..16, the second board are outputs and so on. Set the address for each board using the address links, header H2, which is at the middle of the board on the left side, as shown in the following illustration. RPI16OUT address links To set board address 0..7 If all of the links are out, the board address will be 0 and when all links are in, the board address will be 7. The board address links and the outputs they control are: RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

44 ADDRESS LINKS BOARD A2 - A1 - A0 ADDRESS INPUTS IN IN IN IN IN IN - IN IN IN IN IN IN When using more than one RPI16OUT interface, ensure that each has a different board address, however each one will have the same CE link set. AUXILIARY SPI CONNECTOR When using other computers or microprocessors, eg Microchip PIC devices, their SPI interfaces can be connected to the Aux SPI Connector, 0.1" header H3, which is at the left side of the interface board rather than wiring to the 26W IDC connector. Do not use this header if already connected to a Raspberry Pi with the 26W IDC cables otherwise the GPIO ports could be damaged. AUXILIARY SPI CONNECTOR Auxiliary SPI 0.1" header connector to connect to other micros 1 = +5 Vbus +5V from connected device which can be used to power this board if Vbus linked. 2 = +3.3 Vreg +3.3V from the board's regulator which can be used to power ext device, max 50mA. 3 = #CE Chip Enable CE line from ext device taken low to enable this board. 4 = SCLK SPI Serial Clock from ext device. 5 = MOSI Master Out (from ext SPI controlling device), Slave In (to on-board SPI device). 6 = MISO Master In (to ext SPI controlling device), Slave Out (from on-board SPI device). 7 = 0V 0V or Ground. 8 = 0V 0V or Ground. Do not put any of the CE0, CE1, CE2, CE3, INTA, INTB, N/A or RST links into the Functions Links section when using the Auxiliary SPI Connector. CONNECTING OUTPUTS Outputs are wired to the 3.5mm plug-in connectors and each opto output is wired in isolated pairs, where output 1 from the board is on pins 1 and 2, output 2 from the board is on pins 3 and 4, etc. (Note that if the board address is set to 2, those outputs would be outputs 17 and 18 - see board addressing). RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

45 For long life and reliability it is recommended to limit the maximum switching of the output optos to 100V at 60mA, which is suitable for switching certain heavy duty industrial contactors and relays or low powered equipment directly. The switching is electrically isolated from the Raspberry Pi or microcontroller and so stops or reduces interference and glitches getting back into the computer side of the wiring, which could damage it or cause the program to crash. Connecting outputs to the RPI16OUT EXTENDING THE OUTPUT SWITCHING CAPABILITY Provided the loads operate from low-voltage DC supplies (typically 12V or 24V) and require a current of no more than 60mA, the RPI16OUT can be used to drive a wide range of devices such as low-current relays, indicators and contactors. To drive larger loads such as actuators, motors and other high-current devices, it will be necessary to use an additional external interface to act as a 'slave' switch. This might take the form of a power transistor, Darlington driver, solid-state relay (SSR), a small relay or miniature contactor (as shown in the previous illustration). Below is an example showing how to switch a high power fan motor using an intermediate slave 12V relay. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

46 Controlling a high power fan motor using an intermediate slave relay MINIMUM LOAD RESISTANCE The maximum switching current for each output is 60mA and so the minimum load resistance at various voltages would be: Load supply drawing 60mA +5V 83Ω +9V 150Ω +12V 200Ω +15V 250Ω +24V 400Ω +48V 800Ω +100V 1666Ω Minimum recommended load resistance RPI16OUT EXAMPLE SETUP USING A SINGLE RPI16OUT INTERFACE BOARD TO CONTROL OUTPUTS 1 TO Put a link across CE1, in the FUNCTIONS section, which is the default chip enable for the RPI16OUT. Do not put a link across RST (reset) unless it is being used. Do not put a link across N/C (no connection). Link INTA and INTB if used (they are not used by default), but if so, IO7 and IO8 on the RPIADCISOL cannot be used. 2. Do not put any links across A0, A1 or A2, in the BOARD ADDRESS section, as this will give the board address 0, and so the output from this board will be 1 to 16. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

47 3. Put a link across 5VEXT INPUT, in the POWER section, which will require the board to be powered by an external +5V supply. 4. Use a RPICON/3.5/2 plug to connect to the External +5VIN connector J1 and wire an external +5V regulated power supply to this plug, where +5V is wired to pin 1 and 0V is connected to pin Use 16 x RPICON/3.5/2 2W plugs for each output (1 to 16) or use 4 x RPICON/3.5/8 8W plugs to group the outputs into 4. Wire outputs 1 to 16, where output 1 = connector pins 1 & 2, output 2 = connector pins 3 & 4, and so on. 6. Connect a 26W IDC cable to the RPI16OUT connector J2, taking note of the key in the connector, such that pin 1 (denoted by the red band on the ribbon cable) is at the top right side of connector J2. 7. Connect the other end of this 26W IDC cable to the Raspberry Pi GPIO connector P1. Take care when doing this as this Raspberry Pi port does not have a keyed socket and so ensure that pin 1 of the 26W IDC cable is connected to pin 1 on the port and that the IDC connector is not inserted with it overhanging at one side. Check this carefully before powering up. Pin 1 on the Raspberry Pi connector is denoted by a square pad on the underside of the PCB. If using a Raspberry Pi Model A+ or B+, which have a 40W GPIO connector, use the 40W adaptor ribbon cable to plug into the Raspberry Pi. Note: if the Raspberry Pi is already connected to other RPI16IN, RPI16OUT, RPIADCISOL boards, connect this IDC cable to those boards to form a daisy-chain. The board will now output 1 to 16. USING 2 X RPI16OUT INTERFACE BOARDS TO CONTROL OUTPUTS 1 TO 32 Setup the first board as above and that board will control outputs 1 to 16. On the second board: 1. Put a link across CE1, in the FUNCTIONS section, which is the default chip enable for the RPI16OUT and this will obviously be the same for all of the RPI16OUT boards on the daisy-chain. Do not put a link across RST (reset) unless it is being used. Do not put a link across N/C (no connection). Link INTA and INTB if used (they are not used by default), but if so, IO7 and IO8 on the RPIADCISOL cannot be used. 2. Put a link across A0 only, in the BOARD ADDRESS section, which will give this board address 1, and so the outputs from this board will be 17 to Put a link across 5VEXT INPUT, in the POWER section, which will require the board to be powered by an external +5V supply. 4. Use a RPICON/3.5/2 plug to connect to the External +5VIN connector J1 and wire an external +5V regulated power supply to this plug, where +5V is wired to pin 1 and 0V is connected to pin 2. This power can be daisy-chained down from the first board's 2W power connector. 5. Use 16 x RPICON/3.5/2 2W plugs for each output (17 to 32) or use 4 x RPICON/3.5/8 8W plugs to group the outputs into 4. Wire outputs 17 to 32, where output 17 = connector pins 1 & 2, output 18 = connector pins 3 & 4, and so on. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

48 6. Connect a 26W IDC cable to the RPI16OUT connector J2, taking note of the key in the connector, such that pin 1 (denoted by the red band on the ribbon cable) is at the top right side of connector J2. 7. Connect the other end of this 26W IDC cable to the IDC connector J3 on above RPI16OUT board to form a daisy-chain. The 2 boards will now control outputs 1 to 32. USING 8 X RPI16OUT INTERFACE BOARDS TO MONITOR INPUTS 1 TO 128 Setup the first and second boards as above and continue to daisy-chain the subsequent boards with 26W IDC cables and link the external power supply to each board. Set the same chip enable CE link for all of the boards. Set different address links on each board so that each has its own unique address, 0 to 7. The 8 boards will now control outputs 1 to 128. SOFTWARE SETUP See the example software for details on how to setup and use the RPI16OUT. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

49 RPIADCISOL - 6 CHANNEL ADC (4 ARE GALVANICALLY ISOLATED) This is a small board containing 4 x differential 24-bit ADC inputs (±75mV range), which are galvanically isolated to allow connecting to different earth potentials without causing damage to the Raspberry Pi or microcontroller, plus 2 x differential 24-bit ADC inputs (±600mV range). This is the first commercially available optically isolated ADC board, which will enable the Raspberry Pi or microcontroller to be used in harsh and noisy industrial environments without becoming affected by ground loops caused when trying to measure differential voltages at different earth potentials, eg on bus bars, mains supply, motors currents, power monitor, etc. The on-board ADC is a Microchip MCP3913, which can sample up to 125ksps and offer up to 24- bit resolution. In addition there are 8 optically isolated digital inputs and 8 optically isolated digital outputs so that the Raspberry Pi can either read or output via these high speed optos. They allow high speed digital switching or reading when the inputs/outputs need to be totally isolated, eg when outputting such as a Pulse Width Modulated, PWM, signals. The RPIADCISOL is suitable for connecting to all versions of the current Raspberry Pi (versions 1 & 2, type A, A+, B, B+ and the new single card industrial Raspberry Pi Compute Module) and for connecting to any microcontroller with an SPI interface, eg Microchip PICs and Atmel. RPIADCISOL - 4 channel isolated and 2 channel direct ADC and opto digital interface RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

50 RPIADCISOL - isolated ADC and digital Interface connected to Raspberry Pi RPIADCISOL - isolated ADC and digital interface daisy-chained to a RPI16IN board ADVANTAGES OF BEING GALVANIC OR OPTO ISOLATED When outputs or inputs are optically isolated, it prevents high voltages from the components being switched or monitored damaging or interfering with the Raspberry Pi. For example, outputs could be connected to switch devices which are at ±500V about ground and similarly inputs could monitor switch circuits which are also at 500V above ground. An opto isolated ADC input can monitor very low differential voltages on such as a high voltage bus-bar. Even if the inputs and outputs are supposedly within 0 to 3V, if they are on a separate ground circuit or at some distance from the Raspberry Pi, ground loops will occur, which will raise the levels. Without this opto isolation the Raspberry Pi would be destroyed. Isolation considerably reduces the likelihood of impulse voltages and spikes getting back into the Raspberry Pi, which could cause it to crash or be damaged. Isolation is required when used in harsh or industrial applications. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

51 FEATURES Size = x mm (with 4 x 3mm mounting holes at x mm). 3.5mm standard industrial connectors for use with removable 3.5mm screw terminal plugs (uses 3.5mm screw terminal plugs: 4 x 8W, 6 x 4W, 1 x 2W) 2 x channel directly coupled differential 24-bit ADC inputs, inputs 1 and 2 (±600mV max). Inputs 1 and 2 have 3.3V at 50mA available to power external sensors. This 3.3V supply is not isolated. 4 x channel opto isolated differential 24-bit ADC inputs, inputs 3, 4, 5 and 6 (±150mV max). 4 x AMC1200 isolated op-amps are used to provide isolation on the inputs 3 to 6, 60kHz bandwidth (see the AMC1200BDWV data sheet). Voltage isolation across isolated input op-amp devices and the individual power supplies on inputs 3 to 6 tested at 1kV, see certificate of conformity, but limit to 24V for standard users. Because of the isolation, the interface can be used in applications such as Motor Control, Green Energy Monitoring, Frequency Invertors, Monitoring Sensors or Bus Bar Currents, which are not at ground potentials, etc. Each isolated op-amp device on inputs 3 to 6 has its own +5V regulated isolated power supply, which can also be used to power external sensors, max of +5V at 50mA available at each isolated input. 8 x GPIO lines from Raspberry Pi s 26W GPIO port can be used as either inputs or outputs - they are not controlled by SPI and are direct i/o lines from the Raspberry Pi GPIO port to provide: 8 x direct outputs via NMOS Transistors: with a safe switching output on this board = 5V at 1A. They can be used to control high speed pulse devices not requiring isolation. 8 x opto isolated outputs (ISQ203XSM optos), safe output switching = 50VDC at 15mA. 8 x opto isolated inputs (ISQ203XSM optos) 3-8V DC inputs. Can extend this input voltage above 8V DC by using a series resistor, see later. The 8 input and 8 output opto isolators have a turn-on time = 3µS and turn-off time = 2µS. Voltage isolation across the digital input and output opto isolators tested at 1kV, see certificate of conformity, but limit to 24V for standard users. SPI interface, high speed up to 20MHz, with Mode 0,0 and 1,1 compatibility. 26W IDC connector for direct connection to the GPIO port on Raspberry Pi (all versions V1 or V2, type A, A+, B, B+ and can connect to the motherboard of the industrial Raspberry Pi Compute Module). 26W IDC connector to daisy-chain to other S&S isolated boards. Auxiliary SPI interface 0.1 header connector to use with other computers, microprocessors and microcontrollers, which have an SPI port, eg Microchip PICs, Atmel, Arduino, etc. Power consumption = +5V at 200mA. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

52 Powered from the Raspberry Pi +5V bus or from an external +5V supply. Software examples written in C for the Raspberry Pi. MICROCHIP MCP CHANNEL DIFFERENTIAL INPUT DELTA-SIGMA ADC The RPIADCISOL board uses the powerful and flexible Microchip MCP bit ADC, which has the following features: Six Synchronous Sampling 24-bit Resolution Delta-Sigma A/D Converters db SINAD, -107 dbc Total Harmonic Distortion (THD) (up to 35th Harmonic), 112 dbfs SFDR for each channel. Enables 0.1% Typical Active Power Measurement Error over a 10,000:1 Dynamic Range. Advanced Security Features: - 16-bit Cyclic Redundancy Check (CRC) Checksum on All Communications for Secure Data Transfers - 16-bit CRC Checksum and Interrupt Alert for Register Map Configuration - Register Map lock with 8-bit Secure Key 2.7V-3.6V AVDD, DVDD. Programmable Data Rate up to 125 ksps: - 4 MHz Maximum Sampling Frequency - 16 MHz Maximum Master Clock Oversampling Ratio up to Ultra-Low Power Shutdown Mode with < 10 μa db Crosstalk between Channels. Low Drift 1.2V Internal Voltage Reference: 9 ppm/ C. Differential Voltage Reference Input Pins. High Gain Programmable Gain Amplifier, PGA, on Each Channel (Gain = 1 to 32) When using signed 24-bit ADC the range is +8,388, ,388,608 so example ADC gain/bit values: - PGA Gain 1 (±600mV range): each bit will represent 600mV / = mV = 71.53nV - PGA Gain 2 (±300mV range): each bit will represent 300mV / = 35.76nV - PGA Gain 32 (±18.75mV range): each bit will represent 18.75mV / = 2.235nV Phase Delay Compensation between channel pairs with 1 μs Time Resolution. Separate Data Ready Pin for Easy Synchronization. Individual 24-bit Digital Offset and Gain Error Correction for Each Channel. High-Speed 20 MHz SPI Interface with Mode 0,0 and 1,1 Compatibility. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

53 Continuous Read/Write Modes for Minimum Communication Time with Dedicated 16/32-bit Modes. MCP3913 DESCRIPTION The MCP3913 is a 3V six-channel Analog Front End (AFE), containing six synchronous sampling Delta Sigma, Analog-to-Digital Converters (ADC), six PGAs, phase delay compensation block, low-drift internal voltage reference, digital offset and gain error calibration registers, and high-speed 20 MHz SPI-compatible serial interface. The MCP3913 ADCs are fully configurable, with features such as: 16/24-bit resolution, Oversampling Ratio (OSR) from 32 to 4096, gain from 1x to 32x, independent Shutdown and Reset, dithering and auto-zeroing. The communication is largely simplified with 8-bit commands, including various continuous read/write modes and 16/24/32-bit data formats that can be accessed by the Direct Memory Access (DMA) of an 8/16- or 32-bit MCU, and with the separate data ready pin that can directly be connected to an Interrupt Request (IRQ) input of an MCU. The MCP3913 includes advanced security features to secure the communications and the configuration settings, such as a CRC-16 checksum on both serial data outputs and static register map configuration. It also includes a register-map lock through an 8-bit secure key to stop unwanted write commands from processing. DITHERING In order to suppress or attenuate the idle tones present in any delta-sigma ADCs, dithering can be applied to the ADC. Dithering is the process of adding an error to the ADC feedback loop in order to 'de-correlate' the outputs and 'break' the idle tone s behaviour. Usually a random or pseudo-random generator adds an analog or digital error to the feedback loop of the delta-sigma ADC in order to ensure that no tonal behaviour can happen at its outputs. This error is filtered by the feedback loop and typically has a zero average value, so that the converter static transfer function is not disturbed by the dithering process. However, the dithering process slightly increases the noise floor (it adds noise to the part) while reducing its tonal behaviour and thus improving SFDR and THD. The dithering process scrambles the idle tones into baseband white noise and ensures that dynamic specs (SNR, SINAD, THD, SFDR) are less signal dependent. The MCP3913 incorporates a proprietary dithering algorithm on all ADCs in order to remove idle tones and improve THD, which is crucial for power metering applications. The MCP3913 is capable of interfacing with a variety of voltage and current sensors, including shunts, current transformers, Rogowski coils and Hall-effect sensors. APPLICATIONS Polyphase Energy Meters Energy Metering and Power Measurement Automotive Portable Instrumentation Audio/Voice Recognition RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

54 RPIADCISOL INTERFACE BOARD LAYOUT The RPIADCISOL board layout is as below. Due to continual improvements, there may be slight variations. RPI16ADCISOL board layout The following illustration shows the board hardware layout and indicates which connectors are isolated and those which are not. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

55 RPI16ADCISOL board layout showing isolated connectors The following illustration shows the simplified block schematic of the RPIADCISOL. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

56 Simplified block schematic of the RPIADCISOL The previous two illustrations have been reproduced by kind permission of Everyday Practical Electronics Magazine (EPE Magazine). See the December 2014 issue at for their in-depth review of the RPIADCISOL isolated interface board. SETTING RPIADCISOL LINKS: POWER SUPPLY, CE AND FUNCTIONS Before using and powering the RPIADCISOL board all of the links need to be set to their correct positions in order to select the power supply, the chip select line (CE) and additional functions, if used. POWER SUPPLY The power supply links and external power connector are positioned at the top right of the board and are shown below. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

57 POWER supply link (H4) and EXTERNAL power connector (J9) USING THE RASPBERRY PI TO SUPPLY POWER TO RPIADCISOL BOARD If power to the RPIADCISOL board is to be supplied by the Raspberry Pi GPIO port, put the H4 link between pins 1 and 2, which is marked '5VRPI BUS'. Note that the RPIADCISOL board can draw 200mA and so it is recommended that an external +5V power supply is used if using this with other boards. USING AN EXTERNAL 5V TO SUPPLY POWER TO RPIADCISOL BOARD If the RPIADCISOL board is to be supplied by an external power supply, put the H4 link between pins 2 and 3, which is marked '5VEXT INPUT'. Connect an external +5V regulated power supply to the 3.5mm J9 connector marked 'EXT 200mA', taking care to connect the +5V to pin 1 and 0V to pin 2 of this connector. CHIP ENABLE (CE) AND FUNCTIONS LINKS - HEADER H1 The chip enable (CE) and functions link header H1 is at the middle left of the board as shown below. Info: text, eg CE1, with a line above means that the chip enable CE1 is active when low. This can also be written with a # prefix, ie #CE1, to denote active when low. Function configuration links RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

58 Chip enable (CE) and Function links, header (H1) Set the required chip enable (CE0, CE1, CE2, CE3) line. The default CE link for the RPIADCISOL interface board is CE2 so select that link, which is the third link down. Link only one CE on the board and ensure that the selected CE does not clash with any other type of SPI board. The RPI16IN and RPI16OUT boards should use a different CE link. IO7 AND IO8 FUNCTION LINKS To use the digital inputs and outputs IO7 and IO8, the IO7 and IO8 function links need to be inserted. However, please note that INTA and INTB cannot then be used on the RPI16IN and RPI16OUT boards at the same time, because the same Raspberry Pi GPIO lines are used for both sets of functions. Therefore, if using IO7 and IO8 on the RPIADCISOL, do not link and use the INTA and INTB on the RPI16IN or RPI16OUT boards. GPIO PINS USED ON CE AND FUNCTION LINKS - HEADER H1 LINK RPi i/o GPIO Pin Interface board default use CE0 GPIO8 (CE0) 24 RPI16IN = #CE CE1 GPIO7 (CE1) 26 RPI16OUT = #CE CE2 GPIO17 11 RPIADCISOL = #CE CE3 GPIO22 15 spare = #CE INTA / IO7 GPIO23 16 RPI16IN/RPI16OUT = INTA or RPIADCISOL = IO7 INTB / IO8 GPIO24 18 RPI16IN/RPI16OUT = INTB or RPIADCISOL = IO8 N/C / DR GPIO0 (V1) or GPIO2 (V2) 3 RPI16IN/RPI16OUT = N/C or RPIADCISOL = #DR RST GPIO25 22 RPI16IN/RPI16OUT/RPIADCISOL = #RESET AUXILIARY SPI CONNECTOR When using other computers or microprocessors, eg Microchip PIC devices, their SPI interfaces can be connected to the Aux SPI Connector, 0.1" header H2, which is towards the middle of the interface board rather than wiring to the 26W IDC connector. Do not use this header if already connected to a Raspberry Pi with the 26W IDC cables otherwise the GPIO ports could be damaged. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

59 Auxiliary SPI 0.1" header connector to connect to other micros AUXILIARY SPI CONNECTOR 1 = +5 Vbus +5V from connected device which can be used to power this board if Vbus linked. 2 = +3.3 Vreg +3.3V from the board's regulator which can be used to power ext device, max 50mA. 3 = #CE Chip Enable CE line from ext device taken low to enable this board. 4 = SCLK SPI Serial Clock from ext device. 5 = MOSI Master Out (from ext SPI controlling device), Slave In (to on-board SPI device). 6 = MISO Master In (to ext SPI controlling device), Slave Out (from on-board SPI device). 7 = 0V 0V or Ground. 8 = 0V 0V or Ground. Do not put any of the CE0, CE1, CE2, CE3, INTA, INTB, N/A or RST links into the Functions Links section when using the Auxiliary SPI Connector. DIGITAL INPUT & OUTPUT OPTO ISOLATORS The RPIADCISOL contains 8 x input and 8 x output opto isolators, which are relatively high speed. They are not controlled via SPI commands as they are directly connected to the Raspberry Pi's GPIO lines in order to read or output fast changing levels. The input and output opto isolators used for the 8 x digital inputs and 8 x digital outputs have a turn-on time = 3uS and turn-off time = 2uS. AC isolation across the input and output opto devices is that shown by the CE mark. The circuit has been designed to enable these 8 GPIO pins to be used as both inputs and outputs, depending on how the GPIO ports have been set. This is to give maximum flexibility to the user applications. For example, 3 GPIO ports could be configured as inputs (to read 3 input optos) and the remaining 5 GPIO ports could be configured as outputs (to output to 5 optos). If an input opto isolator is turned on or off and the same Raspberry Pi GPIO port has inadvertently been set to on output, it will not cause any damage to the Raspberry Pi because the RPIADCISOL board contains a 2K2 resistor in series with each GPIO port line in order to limit the GPIO pin current to 1.5mA. INPUT PASSED TO OUTPUT OPTOS AND SWITCHING TRANSISTORS - IGNORING THE RASPBERRY PI The Raspberry Pi can set the relevant GPIO lines as inputs but not bother to read them and the input opto isolators can be used and their state will be passed to the output opto isolators and switching transistors to simply provide isolation between an input and an output. This is to give added flexibility to user hardware applications. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

60 INPUT OPTO CONNECTIONS Inputs are wired to the 3.5mm plug-in connectors J10 and J11, and each opto input is wired in isolated pairs, where input 1 to the board is on pins 1 and 2, input 2 to the board is on pins 3 and 4, etc. The inputs are rated at 5V DC, with a maximum input of 8V DC. Do not apply an AC voltage to these inputs. A higher input voltage can be used by wiring a resistor in series with the input. INPUT i1 AND OUTPUT o1 ON GPIO PIN 5 (ADC_IO0) - USE ONLY AS OUTPUT The i/o line connected to both the input opto i1 and output opto o1 is defined in the header file as ADC_IO0 and this is connected to pin 5 of the GPIO 26W port. This pin is used as the SCL in both hardware versions of the Raspberry Pi. Pin 5 in hardware version V1 = GPIO1 = SCL and in hardware version V2 = GPIO3 = SCL. Whenever this ADC_IO0 line on pin 5 is set to an input, it will float high and so will turn output o1 on. Therefore, this input i1 cannot be used as an input as it will always be detected as being hi (On). If the pull-up in the Raspberry Pi is disabled, this floating high will not occur. However, it can be used as an output in exactly the same way as the other outputs, o2..o8, because the i/o line can be driven low when set to an output and its level is set to 0, which will overcome the pull-up. Connecting inputs to the RPIADCISOL digital optos i1 to i8 The inputs are electrically isolated from the Raspberry Pi or microcontroller and so stops or reduces interference and glitches getting back into the computer side of the wiring, which could damage it or cause the program to crash. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

61 HOW TO INPUT VOLTAGES GREATER THAN 8V DC The standard input voltage to the opto isolators is 5V DC. The range is 3 to 8V. If higher input voltages are required to be read, simply add a suitable series resistor. On the interface board a 1K resistor is already fitted in series with the input opto isolator to limit the input current to 7mA and so to read a higher voltage use 143 ohm for every 1V above 8V. Use the nearest preferred value, eg for 30V input, use 143 x (30-8) = 3146 ohm, so use a 3.3K resistor If the full 30V is considered as being across the resistor (although it is not because there is the voltage drop across the opto LED and on-board 1K resistor) the power, P, rating in watts is P = V²/R = 30²/3300 = 0.27W Therefore, use a 3.3K resistor with a rating of 0.33W or more, wired in series with the input as shown in the above diagram. READING OPTO INPUTS i1 to i8 - GPIO PORT LEVEL, OUTPUT OPTO STATUS To read the input optos, set the relevant GPIO lines of the Raspberry Pi to inputs. The input opto isolator state is also passed to the directly connected output transistors and to the output opto isolators. 1. If the input opto is ON (current flowing through the input opto) the input to the Raspberry Pi GPIO = 1. In addition, the directly coupled NMOS output transistor is switched ON (its collector will sink current down to 0V) and the output opto isolator is turned ON. 2. If the input opto is OFF (no current flowing through the input opto) the input to the Raspberry Pi GPIO = 0. In addition, the directly coupled NMOS output transistor is switched OFF (its collector is turned off) and the output opto is OFF. OUTPUT OPTO CONNECTIONS Outputs are wired to the 3.5mm plug-in connectors J12 and J13, and each opto output is wired in isolated pairs, where output 1 from the board is on pins 1 and 2, output 2 from the board is on pins 3 and 4, etc. The max switch rating for the output optos is 50V DC at 15mA. Do not exceed this otherwise they will be damaged. Note the polarity of the switching transistors as shown on the diagram, where the collector is connected to pins 1, 3, 5, etc, and the emitter is connected to pins 2, 4, 6, etc. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

62 Connecting outputs to the RPIADCISOL digital optos o1 to o8 The outputs are electrically isolated from the Raspberry Pi or microcontroller and so stops or reduces interference and glitches getting back into the computer side of the wiring, which could damage it or cause the program to crash. SWITCHING OPTO OUTPUTS o1 to o8 - GPIO PORT LEVEL To switch and control the output optos, set the relevant GPIO lines of the Raspberry Pi to outputs. The Raspberry Pi GPIO port state is passed to the output opto isolators and to the directly connected output transistors. 1. If the Raspberry Pi GPIO = 1, the output opto isolator is turned ON. In addition, the directly coupled NMOS output transistor is switched ON (its collector will sink current down to 0V). 2. If the Raspberry Pi GPIO = 0, the output opto isolator is turned OFF. In addition, the directly coupled NMOS output transistor is switched OFF (its collector is turned off). OPEN COLLECTOR NMOS TRANSISTOR CONNECTIONS When the ADC_IO0 to ADC_IO7 GPIO port lines are toggled on/off by the Raspberry Pi or by the input opto isolators, the directly connected open collector NMOS transistors are also switched on/off as explained above. These transistor outputs o1 to o8 are not isolated and are for use with devices which do not need to be electrically isolated from the Raspberry Pi. They are provided to allow high speed switching of low voltage (5V) devices. The connector is a 0.1" header H3, which is at the bottom of the board. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

63 Eight open-collector NMOS digital outputs Connecting outputs to the RPIADCISOL NMOS output transistors o1 to o8 The example shows an LED wired to output 4, which is on pin 6 of header H3. Select a resistor to match the LED, eg use a 1K resistor. The collector of each output NMOS transistor is wired to pins 3 to 10, which are outputs o1 to o8. The emitter of each output NMOS transistor is wired to 0V. Each collector is wired to its matching output opto isolators and so the maximum voltage that the collectors of these transistors can be taken to is +5V otherwise any higher voltage would be introduced back onto the RPIADCISOL board, which could cause damage. When the transistor is switched on, it can sink 1A down to 0V. Because there are 8 output transistors, limit the overall sinking for the board to 3A, even though an individual transistor could sink 1A. SWITCHING NMOS OUTPUT TRANSISTORS o1 to o8 - GPIO PORT LEVEL To switch and control the NMOS output transistors, set the relevant GPIO lines of the Raspberry Pi to outputs. The Raspberry Pi GPIO port state is passed to the directly connected output transistors and to the output opto isolators. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

64 1. If the Raspberry Pi GPIO = 1, the directly coupled NMOS output transistor is switched ON (its collector will sink current down to 0V). In addition, the output opto isolator is turned ON. 2. If the Raspberry Pi GPIO = 0, the directly coupled NMOS output transistor is switched OFF (its collector is turned off). In addition, the output opto isolator is turned OFF. GPIO PINS CONNECTED TO THE INPUT/OUTPUT OPTOS, IO1 to IO8 The input opto i1 to i8, the output opto o1 to o8 and the NMOS output transistors o1 to o8 are all connected to the same GPIO ports and these port lines are named ADC_IO0 to ADC_IO7. The GPIO ports used for ADC_IO0 to ADC_IO7 are: IO LINE user input/output GPIO PORT 26W GPIO PIN ADC_IO0 i1 or o1 GPIO1 (V1) GPIO3 (V2) 5 ADC_IO1 i2 or o2 GPIO4 7 ADC_IO2 i3 or o3 GPIO14 8 ADC_IO3 i4 or o4 GPIO15 10 ADC_IO4 i5 or o5 GPIO18 12 ADC_IO5 i6 or o6 GPIO21 (V1) GPIO27 (V2) 13 ADC_IO6 / INTA i7 or o7 GPIO23 16 ADC_IO7 / INTB i8 or o8 GPIO24 18 RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

65 ADC INPUTS 1 TO 6 Inputs 1 and 2 are directly connected to the ADC and so do not offer any isolation. Inputs 3 to 6 are connected to isolated op-amps, AMC1200 devices (see the data sheet for full specifications). These isolated op-amps have a fixed gain of 8 with 50% attenuators on the outputs making the overall fixed gain = 4. Each input 3 to 6 has its own isolated DC to DC power supply to provide isolated power to the AMC1200 devices. This isolated power is presented at the connectors to allow a small amount of current to be used to power external sensors if required. INPUTS 1 AND 2 - DIRECT INPUTS WITH NO ISOLATION Inputs 1 and 2 go directly to the ADC, which can have a maximum differential range of ±600mV when the ADC gain is set to 1. This will give full scale reading from the ADC, which when using the ADC in bipolar 24-bit mode is +8,288,607 to -8,288,608. The MCP3913 data sheet states that the ADC inputs should be within ±1V for accuracy and it indicates that the ADC inputs can withstand ±2V, but it is not recommended to exceed ±1V, so, ensure that the max ±600mV input to the ADC is kept within ±1V of ground 0V. Inputs 1 and 2 circuitry is shown below, using input 2 as an example (which is connected to ch1 of the ADC, as those inputs are numbers 0 to 5). The 15R resistors, 330pF and 18pF capacitors are to provide minimal high frequency filtering. Direct Input 2 showing resistor and capacitor values for reference Additional input filtering and protection should be added at the front end before wiring to pins 2 and 3 of the 4W 3.5mm input connector. This is left to the user to do to enable matching the input characteristics to the application being measured. Ensure that these ADC input levels are not overloaded otherwise the ADC will be damaged. It is suggested that 10K resistors are connected to each input on pin 2 and 3 down to 0V on pin 4 so as to stop the inputs floating and to give them a 0V reference. These resistors are not included on-board as the values need to match the user's application. +3.3V from the on-board regulator at a maximum of 50mA is provided at pin 1 of the 4W 3.5mm connector to allow powering of external sensors. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

66 Remember that inputs 1 and 2 are not isolated and so the Raspberry Pi will not be isolated from any circuitry connected to these inputs. These inputs are useful for connecting to such as Linear Hall Cells and Rogowski coils, which are used in AC current measurement because these devices are isolated, see data sheet. INPUTS 1 TO 2 CONNECTIONS Reading a Rogowski Coil using non-isolated ADC input 1 The above example shows a Rogowski coil connected to the non isolated ADC input 1. The output of the coil is attenuated by resistors R1 and R2 to ensure that the ADC inputs are not overloaded and damaged. When the gain of the ADC is set to 1 the maximum differential input is ±600mV and so if the output of the coil was, for example, ±1.2V, 1K resistors could be used for both R1 and R2 to attenuate the signal down to ±600mV. The coil is shown with a load resistor, RL, connected across its output. Select this load resistor to match the coil specifications. Resistors R3 and R4 are to give the ADC inputs a reference down to 0V and they could be 10K each. INPUTS 3 TO 6 - VIA AMC1200 ISOLATED OP-AMPS Four AMC1200 ISOLATOR OP-AMPS with differential inputs are used on inputs 3 to 6 to provide isolation between reading external sensors and the ADC (and Raspberry Pi). The isolation between the input and output of these op-amps = 4000V. They have a fixed voltage gain (AV) of 8 with a bandwidth of 60kHz. See the AMC1200BDW data sheet. The galvanic representation of the AMC1200 isolated op-amp is shown as below. AMC1200 isolated op-amp galvanic representation When using a 3.3V supply voltage on the output side of the op-amps, the differential outputs sit on a bias of 1.29V, which is too excessive and out of working range of the MCP3913 ADC inputs. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

67 The output of these op-amps are attenuated by 50% to drop the output centre bias line down from 1.29V to 645mV so as to keep within range of the MCP3913 ADC. Because of this 50% attenuation, the effective AV for this input op-amp section is 4 and not 8. The attenuating resistors can be seen in the following diagram. The input circuit to the isolated op-amps on inputs 3 to 6 is shown below, using input 3 as an example (which is connected to Ch2 of the ADC, as the ADC inputs are numbered 0 to 5). The input 15R resistors, 330pF and 18pF capacitors are to provide minimal high frequency filtering. Isolated input 3 showing resistor and capacitor values for reference Additional input filtering and protection can and should be added at the front end before wiring to pins 2 and 3 of the 4W 3.5mm input connector. This is left to the user to do in order to match the input characteristics to the application being measured. Ensure that the inputs to the isolated op-amps are not overloaded or used out of range otherwise they will be damaged. It is suggested that 10K resistors are connected to each input (pin 2 and 3 of each 4W connector) down to the GND of the isolation op-amp on pin 4 of the 4W connector so as to stop the inputs floating and to give them a GND reference. These resistors are not included on-board as the actual values need to match the user's application. INPUTS 3 TO 6 ISOLATED CONNECTIONS The isolated -Vin (VINN on pin 2) can be tied to the isolated GND and so the isolated +Vin (VINP on pin 3) to the op-amp can go below the isolated GND (on pin 4). Below is an example showing how to measure current through a shunt whilst maintaining isolation from the circuitry connected to the shunt and the Raspberry Pi. The example uses input 3 of the RPIADCISOL board. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

68 Isolated reading of motor current using a shunt which is connected to the live supply The voltage across the shunt is monitored by the differential inputs (pins 2 and 3). Note that -Vin to the isolated op-amp (pin 2) is linked to the isolated GND of the isolated op-amp, which is pin 4. This is to give a reference to the +Vin and -Vin inputs. ADC PROGRAMMABLE GAIN AMPLIFIER, PGA, GAIN = 1 to 32 The ADC has a Programmable Gain Amplifier (PGA) for each channel and the gain is set using the GAIN register, see the RPIADCISOL_GAIN function. The PGA has 6 ranges from 1 to 32: PGA_CHn<2:0> Gain V/V Gain db Vin Range (when Vref = 1.20 as per internal Vref) ±0.600 volts ± ± ± ± ± Reserved (sets Gain = 1) 111 Reserved (sets Gain = 1) ADC GAIN = 1 (±600mV full scale range) When the ADC gain for a channel is set to 1, the full scale range will be ±600mV (1.2Vpp), because the internal 1.2V Vref is used as the ADC voltage reference. This ±600mV should be kept within ±1V of the ADC's 0V/ground to maintain accuracy (see MCP3913 data sheet). ISOLATED INPUTS 3 TO 6 GAIN SETTING (ADC CH3..5) Both the + and - differential outputs of the isolated op-amps sit at a centre bias of 645mV after the 1K attenuators and so the max positive swing from either output would be from 645mV to 1000mV, ie a max RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

69 swing of 355mV, hence the maximum range in order to keep within the +1V limit of the ADC inputs would be ±355mV. This ±355mV swing is ±245mV less swing than ±600mV required for full scale readings when the ADC gain is set to 1. The input to the isolated op-amp to produce this ±355mV swing would be ±355mV / 4 = ±88.75mV and so this input, which would give ±355mV to the ADC, which, when set to a gain of 1, would not produce full scale readings and any more input would take the ADC above the +1V recommended limit. If the reduced range is within working limits for the project, a gain of 1 could be used. However, to get the full scale range within the rated range of the ADC when using isolated inputs 3 to 6, use an ADC gain of 2. ADC GAIN FOR CH3..5 (INPUTS 3 TO 6) = 2 (±300mV full scale range) To enable full scale readings from the ADC when using isolated op-amp inputs 3 to 6, set the ADC gain to 2, so that its full scale range is ±300mV. To get this ±300mV from the isolated op-amp outputs the inputs to the opamps would need to be ±300mV / 4 = ±75mV. Therefore a differential input of ±75mV (150mVpp) to the isolated op-amp would produce ±300mV at its output and so the ADC inputs will swing ±300mV about a centre bias of 645mV. The ADC will therefore see a ±300mV swing from 345mV to 945mV, which is the full scale range within the ADC calibrated range. RPIADCISOL EXAMPLE SETUP USING A SINGLE RPIADCISOL INTERFACE BOARD 1. Put a link across CE2, in the FUNCTIONS section, which is the default chip enable for the RPIADCISOL. Do not link DR or RST unless they are to be used Link IO7 and IO8 if used, but if so, INTA and INTB cannot be used on any RPI16IN or RPI16OUT boards. 2. Put a link across 5VEXT INPUT, in the POWER section, which will require the board to be powered by an external +5V supply. 3. Use a RPICON/3.5/2 plug to connect to the External +5VIN connector J1 and wire an external +5V regulated power supply to this plug, where +5V is wired to pin 1 and 0V is connected to pin Use 6 x RPICON/3.5/4 4W plugs to connect to the ADC inputs 1 to Use 4 x RPICON/3.5/8 8W plugs to connect to the digital opto inputs and outputs. 6. Connect a 26W IDC cable to the RPIADCISOL connector J7, taking note of the key in the connector, such that pin 1 (denoted by the red band on the ribbon cable) is at the top right side of connector J7. 7. Connect the other end of this 26W IDC cable to the Raspberry Pi GPIO connector P1. Take care when doing this as this Raspberry Pi port does not have a keyed socket and so ensure that pin 1 of the 26W IDC cable is connected to pin 1 on the port and that the IDC connector is not inserted with it overhanging at one side. Check this carefully before powering up. Pin 1 on the Raspberry Pi connector is denoted by a square pad on the underside of the PCB. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

70 If using a Raspberry Pi Model A+ or B+, which have a 40W GPIO connector, use the 40W adaptor ribbon cable to plug into the Raspberry Pi. Note: if the Raspberry Pi is already connected to other RPI16IN, RPI16OUT, RPIADCISOL boards, connect this IDC cable to those boards to form a daisy-chain. SOFTWARE SETUP See the example software for details on how to setup and use the MCP3913 ADC and the RPIADCISOL board. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

71 RASPBERRY PI AND C PROGRAMMING - SOFTWARE EXAMPLES The software for the RPI16IN, RPI16OUT and RPIADCISOL interface boards is written in C, which was chosen because C produces efficient and fast native code, which does not use line by line interpreters as the program runs. The excellent GNU C and C++ compiler is supplied with the Raspberry Pi and so there is nothing else to obtain. The software is supplied under the terms of the Open Source Licensing GPL V2. See the comments in the source and header files and the file called COPYING file for details. This explains that the software can be freely used (with the RPI interface boards from S&S Systems) under certain terms and that the software is not supplied with any warranty at all. The software uses the bcm2835 library, which is a C library to provide low level access to the Broadcom BCM 2835 GPIO pins on the 26 pin IDE plug. This allows interfacing to the IO pin, SPI module and the I2C module, and it also can be used to access the system timers. The two files from this library are called bcm2835.c and bcm2835.h and are included in the example software folders for convenience in order to save having to download and install that library. They are also supplied under the terms of the GPL. To find the latest version go to: If there is a later version follow the instructions shown on the web to download it. Extract the two relevant files, bcm2835.c and bcm2835.h from the download and put them into the RPI example source folders to replace the existing bmc2835.c and bcm2835.h files. There is no need to install the bcm2835 library because the example software recompiles all of the relevant source files as required. A makefile is included in the source folder to take care of the compilation and linking, which is explained later. OBTAINING THE RPI EXAMPLE SOURCE CODE The software examples for the three interface boards can be obtained from the distributors, Zeal Electronics Ltd as shown at the beginning of the manual. Extract the folders and place them into your chosen development directory, for example the Desktop. The three source code folders are called: rpi16in, rpi16out and rpiadcisol. Reminder: see the earlier section to ensure the Raspberry Pi clock is set before updating or running new programs. C PROGRAMMING - GNN C and C++ COMPILER The Raspberry Pi, when using the Debian distribution (Debian distros) of Linux comes with the powerful GNN C and C+ compiler and assembler pre-installed. Before using the Raspberry Pi for C programming it is recommended to check then update the Raspberry Pi's firmware and operating system to the latest release. Follow the Raspberry Pi user instructions for updating. This information is given as a guide to assist. Ensure your Raspberry Pi is connected to the internet (see your user manual) so that it can download the relevant packages. The following notes are based on the Debian distribution of the Raspberry Pi's Linux operating system, OS. The commands need to be entered in a terminal window at super user level hence they are prefixed with 'sudo'. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

72 IMPORTANT - BEFORE UPDATING RASPBERRY PI OS AND FIRMWARE Before the Raspberry Pi's Operating System and firmware is updated ensure that the existing bootup SD or usd card is completely backed up in full, because if the update fails or the power to the Raspberry Pi gets cut off whilst updating the whole system may need to be restored. This is very important. Do not proceed until you have backed up your existing SD or usd bootup card. SET THE RASPBERRY PI CLOCK BEFORE UPDATING OR RUNNING A NEW PROGRAM If the clock on the Raspberry Pi is incorrect and set in the past, whenever you try to download an update or run a new program an error message will be displayed. Sometimes the error message will indicate that the new files or programs have modification times set in the future. The Raspberry Pi will not proceed with updating or with running new programs until the date and time are set correctly. To correct this error, simply set the Raspberry Pi's clock. See the Raspberry Pi user manual for instructions on how to set the clock using the internet or by inputting the date and time manually. To set the date and time manually, from a terminal window type, eg: sudo date --set "28 May :23" Note that whenever the Raspberry Pi is powered down, it loses its date and time settings because it does not have an on-board real time clock, RTC. There are some excellent articles describing how to build and add an RTC to the Raspberry Pi, for example see the Teach-In series which started in the November 2013 EPE Magazine. UPDATE RASPBERRY PI OS AND ALL CURRENT PACKAGES To update the Raspberry Pi Linux OS and all of the installed packages that have a newer version in the repository, type the following commands in a terminal window in sequence. They may take some time due to downloading and extracting files: sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get autoremove sudo apt-get clean UPDATE BROADCOM RPI FIRMWARE This is not the same as updating applications or updating the Raspberry Pi Linux OS. This command updates the Broadcom firmware in the Raspberry Pi. Once updated, you need to reboot the Raspberry Pi. Type the following command in a terminal window: sudo rpi-update Do a reboot afterwards with sudo reboot RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

73 Out of interest, the above two commands could be linked as one to work exactly the same, which would be sudo rpi-update && sudo reboot CHECK BROADCOM RPI FIRMWARE VERSION To check the current Broadcom firmware version, type the following command in a terminal window: uname -a The current version at the time of writing is: Linux raspberrypi v7+ #784 SMP PREEMPT Sat May 9 15:57:36 BST 2015 armv7l GNU/Linux CHECK RPI GPU FIRMWARE VERSION The graphics processor unit, GPU, used in the Raspberry Pi is extremely powerful. To check the current version of the firmware, type the following command in a terminal window: /opt/vc/bin/vcgencmd version The current version at the time of writing is: May :58:03 Copyright (c) 2012 Broadcom version f5f5ba5f2423c3dff6ccd4ca4b832264cd33f12a (clean) (release) DOWNLOAD LATEST VERSION OF bcm2835.c and bcm2835.h files The next thing to do is to ensure you have the latest bcm2385.c and bcm2385.h files as these are altered to keep up with the changes to the Raspberry Pi 2 firmware. You can get the updated versions of these bcm2385 files from the web and it is worthwhile checking often in case there are any other hardware and firmware updates. Download the latest versions of bcm2835.c and bcm2835.h by first finding the latest version (eg 1.44 as at ) at then download (eg 1.44 which is placed in the URL address as seen below) from Extract and copy the bcm2835.h and bcm2835.h files into your project source folders. RECOMPILE YOUR PROJECT APPLICATION IN FULL Do a 'clean' to first get rid of the old object files, then recompile all to renew everything - use the makefile shortcut 'make a' (for make all). You should do this whenever there are any Raspberry Pi OS or firmware updates. You will now have an up-to-date system. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

74 RPI16IN EXAMPLE SOFTWARE The files in the rpi16in source folder are: rpi16inout.c Source file containing all of the routines to read from rpi16in boards and to write to the rpi16out boards. Note that the input and output numbers in the software routines are passed as (using the program tradition of input/output 0 being the first input/output), however, the end user naturally considers them as inputs or outputs rpi16inout.h hardware.c hardware.h bcm2835.c bcm2835.h main.c Header file for the rpi16inout.c source, containing definitions and function prototypes. Source file containing functions to communicate with the SPI and to control and read the GPIO pins. Hardware_Init() needs to be called at the beginning before using any IO or the SPI functions as this function initialises the bcm2835 library and the SPI module, detects and returns the Raspberry Pi's revision number, determines the Raspberry Pi's hardware version (either 1 or 2) and sets up the GPIO definitions to match. The Raspberry Pi's revision number (currently 2 to 16) is returned if all is OK. If there is an error it returns false (0). Header file for the hardware.c source, which contains all of the definitions for the GPIO pins used in the RPI16IN, RPI16OUT and RPIADCISOL boards and the function prototypes. It also contains macros and definitions used to link to the bmc2835 library files. Source file for the Broadcom GPIO, to allow low level access to the GPIO and SPI module. Header file for bcm2835.c source, containing definitions and function prototypes. This is the main program source file. When the program is run, it starts at function main(). The prompts are displayed until ENTER is pressed. Define the first and last outputs to toggle on/off in the while() loop depending on which boards are connected (daisy-chained). Note that all board inputs or outputs are numbered 0 to 127 (because in programming, 0 is first), however, the user considers all inputs or outputs as being numbered 1 to 128 (because 1 is first). Board address Input/Outputs The below defines are set to use outputs 0 to 15 for when using one RPI16IN board set to address 0: RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

75 #define FIRSTINPUT 0 /* Define first input to read (input 1 on the board) */ #define LASTINPUT 15 /* Define last input to read (input 16 on the board) */ makefile This is the makefile containing commands to compile and link the above source file into an application called rpi16in. See later. How to control the RPI16IN board using the rpi16inout.c software In the main.c example you will see that it is very easy to use the RPI16IN board. The steps are simply these: 1. Initialise the GPIO hardware, the SPI module then the RPI16IN hardware Initialise the hardware, SPI module, GPIO ports and GPIO definitions by calling Hardware_Init() and test the return value. It will return the Raspberry Pi model revision number (currently 2 to 16) if all is OK. If false (0) is returned there is a problem and so exit the application and do not proceed. if (Hardware_Init()==0) return 1; // Exit application if error initialising the hardware To initialise all connected RPI16IN boards ready to read, pass the chip enable, CE, which is to be used for this board (default = CE0) to RPI16OUT_InitAll() and the parameters will be set up. See the RPI16IN_Init() routine in the source code for a full list of the parameters. RPI16IN_InitAll() will return an 8-bit value representing the number of connected boards found on the SPI bus, where b0 = 1 = board 0 connected, b1 = 1 = board 1 connected, etc. If false (0) is returned, no RPI16IN board was found on the bus and so exit the application and do not proceed. if (RPI16IN_InitAll(SPI_CE0)==0) return 1; // Init all connected brds 0..7 with default CE, if 0 // returned no board found on SPI bus so exit application 2. Read individual input optos to test ON or OFF status To check the status of an individual opto (0..127), pass the opto input number to RPI16IN_OptoOn(), which will return true (1) if the opto is ON or false (0) if the opto is OFF. The routine calculates the relevant board address and reads the applicable opto input on that board. For example, to test input opto 4 (which is user input 5) use this: c = RPI16IN_OptoOn(4); // c is set to true if input opto ON or false if input opto OFF Note that the status will always return true if the relevant board is not connected. 3. Read and test ON or OFF status of all 16 inputs on a single board to To check the status of all 16 inputs opto on a single board, rather than testing each one individually, pass the board address (0..7) to RPI16IN_AllOptos() which will return a 16-bit value, where each bit, b0..b15, represents input optos on that board. The bit will be set if the opto is ON and clear if the opto is OFF. For example, to read the status of all 16 input optos on board address 3: n = RPI16IN_AllOptos(3) ; // Send board address 3 to read status of all 16 input optos RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

76 If, for example input optos 3 and 5 were ON (user inputs 4 and 6), the returned value in n would have bits b3 and b4 set = 0b , which is = At the end, close the SPI module and hardware then exit the program SPI_Close(); // Close SPI module to allow SPI pins to be used as std GPIO pins if required Hardware_Close(); // Close and release the bcm2835 lib if nothing else to be done with GPIO return 0; // Back to the Raspberry Pi with no error flagged COMPILING AND LINKING RPI16IN To compile and link the RPI16INapplication, open a terminal window and change directory (cd) into the rpi16in folder, which has been downloaded and expanded (unzipped). If it is on the Desktop, the terminal command will be: cd ~/Desktop/rpi16in You will now be in the rpi16in folder. To check, type the following command to display the current working directory: pwd Now you are in the source folder, to compile and link the code to make the 'rpi16in' program, type: make This will instruct the makefile to complete the commands required to compile and link the program, which will be called 'rpi16in'. To clean out all of the object files in order to do a fresh make, type: make clean or make c You can then do another make using the above command make To clean out all of the object files and recompile in one go, type: make a Run the rpi16in program From the terminal type: sudo./rpi16in RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

77 This will run the rpi16in application within the current directory as denoted by./ Alternatively, use the command in the makefile and type: make r rpi16in makefile explained The makefile is shown below to illustrate how it works. It is shown to gain an understanding of how easy it is to use a makefile. Note that text after '#' are comments which have been included to explain how the makefile works. Text in uppercase such as EXEC are variables and to use them they need to be written as ${EXEC}. Note that tabs and not spaces are used as delimiters in sections of the makefile and if that is not observed, the makefile will not operate. There are many excellent books and articles on the web, which explain how to write and use makefiles. The rpi16in makefile is below. # rpi16in makefile # PROGRAM NAME EXEC = rpi16in # CONSTITUENT OBJECT FILES OBJS = main.o bcm2835.o hardware.o rpi16inout.o LIBS = # COMPILER, where c = gcc, c++ = gpp CC = gcc # COMPILER FLAGS, where # -OO/-O0 or nothing = debug optimisation, O2 = optimised level for release # -g = enable debugging, ansi pedantic = original strict C standards # -static = link xxx.o libs as static to not use dynamic run-time libs - note you cannot link shared xxx.so libs as static libs # -Wall = std warning level, -W -Wconversion, etc = warn about all other errors CFLAGS = -O2 -static -Wall -W -Wconversion -Wshadow -Wcast-qual -Wwrite-strings # To display all errors CFLAGS2 = -O2 -static -Wall # Used when compiling bbcm2835 lib to stop displaying numerous errors # THIS SECTION LINKS ALL OBJECT AND BUILT-IN LIB/INC FILES TO CREATE THE PROGRAM all: ${EXEC} ${EXEC}: ${OBJS} ${CC} ${CFLAGS} -o ${EXEC} ${OBJS} ${LIBS} # COMPILE INDIVIDUAL CONSISTUENT SOURCE FILES TO CREATE THE ABOVE OBJECT FILES # Also include all header files, eg rpi16inout.h, so that 'make' also checks if.h files have altered main.o: main.c ${CC} ${CFLAGS} -c main.c bcm2835.o: bcm2835.c bcm2835.h ${CC} ${CFLAGS2} -c bcm2835.c hardware.o: hardware.c hardware.h ${CC} ${CFLAGS} -c hardware.c rpi16inout.o: rpi16inout.c rpi16inout.h ${CC} ${CFLAGS} -c rpi16inout.c RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

78 # ADDITIONAL MAKE COMMANDS TO SAVE TYPING a: clean all # make anew, first clean then build all c: clean clean: # -f = force and suppress errors if files not there rm -f ${EXEC} "all files cleaned up" r: run run: sudo./${exec} RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

79 RPI16OUT EXAMPLE SOFTWARE The files in the rpi16in source folder are: rpi16inout.c Source file containing all of the routines to read from rpi16in boards and to write to the rpi16out boards. Note that the input and output numbers in the software routines are passed as (using the program tradition of input/output 0 being the first input/output), however, the end user naturally considers them as inputs or outputs rpi16inout.h hardware.c hardware.h bcm2835.c bcm2835.h main.c Header file for the rpi16inout.c source, containing definitions and function prototypes. Source file containing functions to communicate with the SPI and to control and read the GPIO pins. Hardware_Init() needs to be called at the beginning before using any IO or the SPI functions as this function initialises the bcm2835 library and the SPI module, detects and returns the Raspberry Pi's revision number, determines the Raspberry Pi's hardware version (either 1 or 2) and sets up the GPIO definitions to match. The Raspberry Pi's revision number (currently 2 to 16) is returned if all is OK. If there is an error it returns false (0). Header file for the hardware.c source, which contains all of the definitions for the GPIO pins used in the RPI16IN, RPI16OUT and RPIADCISOL boards and the function prototypes. It also contains macros and definitions used to link to the bmc2835 library files. Source file for the Broadcom GPIO, to allow low level access to the GPIO and SPI module. Header file for bcm2835.c source, containing definitions and function prototypes. This is the main program source file. When the program is run, it starts at function main(). The prompts are displayed until ENTER is pressed. Define the first and last outputs to toggle on/off in the while() loop depending on how many boards are connected (daisy-chained). Note that all board inputs or outputs are numbered 0 to 127 (because in programming, 0 is first), however, the user considers all inputs or outputs as being numbered 1 to 128 (because 1 is first). Board address Input/Outputs The below defines are set to use outputs 0 to 15 for when using one RPI16OUT board set to address 0: RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

80 #define FIRSTOUTPUT 0 /* Define the first output to toggle on/off */ #define LASTOUTPUT 15 /* Define the last output to toggle on/off */ makefile This is the makefile containing commands to compile and link the above source file into an application called rpi16out. See later. How to control the RPI16OUT board using the rpi16inout.c software In the main.c example you will see that it is very easy to use the RPI16OUT board. The steps are simply these: 1. Initialise the GPIO hardware, the SPI module then the RPI16OUT hardware Initialise the hardware, SPI module, GPIO ports and GPIO definitions by calling Hardware_Init() and test the return value. It will return the Raspberry Pi model revision number (currently 2 to 16) if all is OK. If false (0) is returned there is a problem and so exit the application and do not proceed. if (Hardware_Init()==0) return 1; // Exit application if error initialising the hardware To initialise all connected RPI16OUT boards ready to output, pass the chip enable, CE, which is to be used for this board (default = CE1) to RPI16OUT_InitAll() and the parameters will be set up. See the RPI16OUT_Init() routine in the source code for a full list of the parameters. RPI16OUT_InitAll() will return an 8-bit value representing the number of connected boards found on the SPI bus, where b0 = 1 = board 0 connected, b1 = 1 = board 1 connected, etc. If false (0) is returned, no RPI16OUT board was found on the bus and so exit the application and do not proceed. if (RPI16OUT_InitAll(SPI_CE1)==0) return 1; // Init all connected brds 0..7 with default CE, if 0 // returned no board found on SPI bus so exit application 2. Turn individual output optos ON or OFF To turn an individual opto ON pass the output opto number (0..127) to RPI16OUT_ON (), similarly, to turn an individual opto OFF pass the output opto number (0..127) to RPI16OUT_OFF (), for example, to control output opto 4: RPI16OUT_ON(4); // Turn output opto 4 ON RPI16OUT_ON (4); // Turn output opto 4 OFF 3. Control all 16 output optos on a single board, turning them ON or OFF To set all 16 output optos ON or OFF on a single board, pass the board address (0..7) and the 16-bit value, where each bit, b0..b15, represents output optos on that board. For example, to turn on output optos 1 and 3 (user outputs 2 and 4) on board 5, set bits b1 and b3 = 0b = 6 RPI16OUT_OLATAB_W(5, 6) ; // on board 5, set b1 and b3 (send 6) to turn on output optos 1 and 3 4. At the end, close the SPI module and hardware then exit the program RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

81 SPI_Close(); // Close SPI module to allow SPI pins to be used as std GPIO pins if required Hardware_Close(); // Close and release the bcm2835 lib if nothing else to be done with GPIO return 0; // Back to the Raspberry Pi with no error flagged COMPILING AND LINKING RPI16OUT To compile and link the RPI16OUT application, open a terminal window and change directory (cd) into the rpi16out folder, which has been downloaded and expanded (unzipped). If it is on the Desktop, the terminal command will be: cd ~/Desktop/rpi16out You will now be in the rpi16out folder. To check, type the following command to display the current working directory: pwd Now you are in the source folder, to compile and link the code to make the 'rpi16out' program, type: make This will instruct the makefile to complete the commands required to compile and link the program, which will be called 'rpi16out'. To clean out all of the object files in order to do a fresh make, type: make clean or make c You can then do another make using the above command make To clean out all of the object files and recompile in one go, type: make a Run the rpi16out program From the terminal type: sudo./rpi16out This will run the rpi16out application within the current directory as denoted by./ Alternatively, use the command in the makefile and type: make r RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

82 rpi16out makefile explained The makefile is shown below to illustrate how it works. It is shown to gain an understanding of how easy it is to use a makefile. Note that text after '#' are comments which have been included to explain how the makefile works. Text in uppercase such as EXEC are variables and to use them they need to be written as ${EXEC}. Note that tabs and not spaces are used as delimiters in sections of the makefile and if that is not observed, the makefile will not operate. There are many excellent books and articles on the web, which explain how to write and use makefiles. The rpi16out makefile is below. # rpi16out makefile # PROGRAM NAME EXEC = rpi16out # CONSTITUENT OBJECT FILES OBJS = main.o bcm2835.o hardware.o rpi16inout.o LIBS = # COMPILER, where c = gcc, c++ = gpp CC = gcc # COMPILER FLAGS, where # -OO/-O0 or nothing = debug optimisation, O2 = optimised level for release # -g = enable debugging, ansi pedantic = original strict C standards # -static = link xxx.o libs as static to not use dynamic run-time libs - note you cannot link shared xxx.so libs as static libs # -Wall = std warning level, -W -Wconversion, etc = warn about all other errors CFLAGS = -O2 -static -Wall -W -Wconversion -Wshadow -Wcast-qual -Wwrite-strings # To display all errors CFLAGS2 = -O2 -static -Wall # Used when compiling bbcm2835 lib to stop displaying numerous errors # THIS SECTION LINKS ALL OBJECT AND BUILT-IN LIB/INC FILES TO CREATE THE PROGRAM all: ${EXEC} ${EXEC}: ${OBJS} ${CC} ${CFLAGS} -o ${EXEC} ${OBJS} ${LIBS} # COMPILE INDIVIDUAL CONSISTUENT SOURCE FILES TO CREATE THE ABOVE OBJECT FILES # Also include all header files, eg rpi16inout.h, so that 'make' also checks if.h files have altered main.o: main.c ${CC} ${CFLAGS} -c main.c bcm2835.o: bcm2835.c bcm2835.h ${CC} ${CFLAGS2} -c bcm2835.c hardware.o: hardware.c hardware.h ${CC} ${CFLAGS} -c hardware.c rpi16inout.o: rpi16inout.c rpi16inout.h ${CC} ${CFLAGS} -c rpi16inout.c # ADDITIONAL MAKE COMMANDS TO SAVE TYPING a: clean all # make anew, first clean then build all c: clean clean: # -f = force and suppress errors if files not there RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

83 rm -f ${EXEC} "all files cleaned up" r: run run: sudo./${exec} RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

84 RPIADCISOL EXAMPLE SOFTWARE The files in the rpiadcisol source folder are: rpiadcmcp3913.c Source file containing all of the routines to read from rpiadcisol boards. Note that the input ADC channels in the software routines are passed as 0..5 using the programming tradition of numbering where 0 is the first input or output. However, the end user naturally considers them as ADC inputs 1..6 rpiadcmcp3913.h Header file for the rpiadcmcp3913.c source, containing definitions and function prototypes. hardware.c hardware.h bcm2835.c bcm2835.h main.c Source file containing functions to communicate with the SPI and to control and read the GPIO pins. Hardware_Init() needs to be called at the beginning before using any IO or the SPI functions as this function initialises the bcm2835 library and the SPI module, detects and returns the Raspberry Pi's revision number, determines the Raspberry Pi's hardware version (either 1 or 2) and sets up the GPIO definitions to match. The Raspberry Pi's revision number (currently 2 to 16) is returned if all is OK. If there is an error it returns false (0). Header file for the hardware.c source, which contains all of the definitions for the GPIO pins used in the RPI16IN, RPI16OUT and RPIADCISOL boards and the function prototypes. It also contains macros and definitions used to link to the bmc2835 library files. Source file for the Broadcom GPIO, to allow low level access to the GPIO and SPI module. Header file for bcm2835.c source, containing definitions and function prototypes. This is the main program source file. When the program is run, it starts at function main(). The prompts are displayed until ENTER is pressed. makefile This is the makefile containing commands to compile and link the above source file into an application called rpiadcisol. See later. How to control the RPIADCISOL board using the rpiadcmcp3913.c software In the main.c example you will see that it is very easy to use the RPIADCISOL board. The steps are simply: 1. Initialise the GPIO hardware, the SPI module then the RPIADCISOL hardware Initialise the hardware, SPI module, GPIO ports and GPIO definitions by calling Hardware_Init() and test the return value. It will return the Raspberry Pi model revision number (currently 2 to 16) if all is OK. If false (0) is returned there is a problem and so do not proceed. if (Hardware_Init()==0) return 1; // Exit program if error initialising the hardware/bcm2835 lib To initialise the RPIADCISOL hardware, pass the chip enable, CE, which is to be used for this board (default = CE2) and all ADC parameters will be set up. See the RPIADCISOL_Init() routine in the source code for a full list of the parameters which are set up. It will return true if a board is found on the SPI bus. If false is returned, no board was found on the SPI bus and so do not proceed. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

85 if (RPIADCISOL_Init(SPI_CE2)==0) return 1; // Init ADC with default CE, but if 0 returned no // board found on SPI bus so exit application 2. Reading ADC channels A global signed 32-bit ADC variable array consisting of 6 elements [0..5] is provided called ADCSpot[]. This is used to store the signed 24-bit results of the ADC channels whenever function the ADC read function is called: Call RPIADCISOL_ADC_R(ch) with the relevant channel number (ch) 0..5 or pass the constant ADC_ALLCHAN (defined in the header file) to read all 6 channels in one pass for maximum speed. This function will update the relevant element in the ADCSpot[ ] array with the ADC value, for example: RPIADCISOL_ADC_R(4); // Read ADC ch 4, which will update just ADCSpot[4] RPIADCISOL_ADC_R(ADC_ALLCHAN); // Read ALL ADC ch 0..5 which will update all ADCSpot[0..5] 3. Reading opto inputs i1 to i8 To read the status of the 8 input optos, numbered i1 to i8 for the user, pass the port definition, which is stored in the ADC_IO[] array to the function: GPIO_ReadPin() and read the returned value. This function is in hardware.h The element ADC_IO[0] is the IO line for input opto i1, ADC_IO[1] is the IO line for i2 ADC_IO[7] is the IO line for i8. The GPIO_ReadPin() function first sets the IO line to an input then returns its level. The IO line is left set as an input on return from the function. When the returned value is 1, the IO line is high and so the input opto is on (ie current is flowing through it). When the returned value is 0, the IO line is low and so the input opto is off (ie no current is flowing through it). Examples: c = GPIO_ReadPin(ADC_IO[2]); // c = status of IO in ADC_IO[2] = input i3 c = GPIO_ReadPin(ADC_IO[j]); // c = status of IO in ADC_IO[j], where index j = 0..7 = inputs i1 i8 4. Turning output optos or direct outputs o1 to o8 on or off To turn the 8 output optos o1 to o8 and the open circuit output transistors o1 to o8, on or off, pass the port definition, which is stored in the ADC_IO[] array to these functions: GPIO_SetHI() and GPIO_SetLO() These functions are in hardware.h RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

86 The element ADC_IO[0] is the IO line for output opto (and transistor) o1, ADC_IO[1] is the IO line for o2 ADC_IO[7] is the IO line for o8. These functions first set the IO line to an output then sets the level hi or lo. The IO line is left set as an output on return from the function. Examples: // If j = 3, ADC_IO[j] will control output opto and output transistor o4 GPIO_SetHi(ADC_IO[j]); // Set output hi & turn output opto and output transistor on GPIO_SetLo(ADC_IO[j]); // Set output lo & turn output opto and output transistor off 5. At the end, stop the SPI module, close the bcm2835 lib then exit the program: SPI_Close(); // Close SPI module to allow SPI pins to be used as std GPIO pins if required Hardware_Close(); // Close and release the bcm2835 lib if nothing else to be done with GPIO return 0; // Back to the Raspberry Pi with no error flagged ADC - ZERO INPUT OFFSET Inputs 1 and 2 are directly coupled to ADC channels 0 and 1. When the differential input to these inputs is zero, for example when the pins 2 and 3 on the input connector are short circuited together, the ADC will display a small reading due to internal ADC offset errors. Inputs 3 to 6 are coupled through the AMC1200 differential isolated amplifiers, then to the ADC channels 2 to 5. When the differential input to these inputs is zero, for example when the pins 2 and 3 on the input connector are short circuited together, the ADC will display a small reading due to internal ADC offset errors, plus an amount due to the offset output differences of the isolator op-amps. TO REMOVE ADC ZERO INPUT OFFSET To remove these zero input offset amounts, during the setup or startup routines, ensure that the inputs are set to zero then: 1. Set the Digital Offset Error Calibration registers for each channel (see the MCP3913 data sheet) to balance out the readings, or 2. Read and store the value of the ADC for each channel and subtract that 'zero' reading from any subsequent readings. This is the most common method. ADC - DIGITALLY FILTERING AND AVERAGING READINGS The SAMPLING RATE and the OSR and DITHER registers can be adjusted to match the user application and reduce digital noise - see the MCP3913 data sheet. Note that ADC noise contains valuable data, which can be suitably filtered to extract the signal within it. Once the ADC Spot values have been read, these values can be further digitally filtered. It is recommended to first use MEDIAN filtering, to remove transient noise spikes, followed by such as Kalman Averaging so as to smooth out the readings and further reduce noise so as to extract the original signal. RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

87 MEDIAN FILTERING In signal processing, it is often desirable to perform some kind of noise reduction in the signal and the median filter is a nonlinear digital filtering technique, which is often used. Such noise reduction is a typical preprocessing step to improve the results of later processing. The main idea of the median filter is to run through the signal entry by entry, replacing each entry with the median (ie the middle reading) of neighbouring entries. To do this, take an odd number of readings, sort them into numeric order and the median value is simply the middle value. A simple explanation could be: Imagine 4 people were sat discussing their income per week and wondering what the standard average income was. If their income was 200, 150, 300, 175 and if a billionaire walked in and his income was 20000, it would not be representative to simple add all together ( ) = 20825, then take a numeric average / 5 = 4165, because the billionaire's income was a 'spike' compared to the population's average. Using median filtering the 5 incomes would be numerically sorted to give 150, 175, 200, 300, and the centre value from the list would be used, ie 200, which is more representative. Median filtering removes spikes in the data and is a very useful tool. KALMAN AVERAGING The ADC values, usually after the Median Filtering, can be added together and simply averaged. For example, take the last ADC value, add it to the current value and divide by 2. Or, take a series of readings, add together then divide by the number of readings. This technique is simple averaging, which, whilst useful, does not extract as much of the original signal as the Kalman Filter. The Kalman Filter is a very useful and powerful technique, which was co-developed by Rudolf Kalman, who was born in Budapest, Hungary. The Kalman filter is a mathematical technique widely used in control systems and avionics to extract a signal from a series of incomplete and noisy measurements. It is recommended that this technique is looked at as it can be a very powerful form of digital filtering and the following will be seen in articles on the web - repeated here to illustrate its power: All measurements and calculations based on models are estimates to some degree. Noisy sensor data, approximations in the equations that describe how a system changes and external factors that are not accounted for all introduce some uncertainty about the inferred values for a system's state. The Kalman filter averages a prediction of a system's state with a new measurement using a weighted average. The purpose of the weights is that values with better (ie smaller) estimated uncertainty are 'trusted' more. The weights are calculated from the covariance, a measure of the estimated uncertainty of the prediction of the system's state. The result of the weighted average is a new state estimate that lies between the predicted and measured state and has a better estimated uncertainty than either alone. This process is repeated every time step, with the new estimate and its covariance informing the prediction used in the following iteration. This means that the Kalman filter works recursively and requires only the last 'best guess', rather than the entire history, of a system's state to calculate a new state. ADC - DITHER, BOOST, CLOCKS, OSR AND SAMPLING RATES RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

88 The dither, boost, prescaler and the over sampling rate, OSR, are set in the CONFIG0 register. The performance of the ADC is greatly dependant on these settings. The sampling rate is dependant on the master clock, the prescaler and OSR values. The boost bits need to be set as applicable to the gain and the clocking rates. The dither needs to be set as appropriate to the noise levels and the application in hand. DITHER All modulators include a dithering algorithm that can be enabled through the DITHER<1:0> bits in the Configuration register. This dithering process alters the Total Harmonic Distortion, THD, and Spurious Free Dynamic Range, SFDR, for high OSR settings, while slightly increasing the noise floor of the ADCs. For power metering applications and applications that are distortion sensitive, it is recommended to keep DITHER at maximum settings for best THD and SFDR performance. In the case of power metering applications, THD and SFDR are critical specifications. Optimizing Signal to Noise Ration, SNR or noise floor, is not problematic due to the large averaging factor at the output of the ADCs. Therefore, even for low OSR settings, the dithering algorithm will show a positive impact on the performance of the application. BOOST The Delta-Sigma modulators include a programmable biasing circuit in order to further adjust the power consumption to the sampling speed applied through the MCLK. This can be programmed through the BOOST<1:0> bits, which are applied to all channels simultaneously. The maximum achievable analog master clock speed, AMCLK, the maximum sampling frequency, DMCLK, and the maximum achievable data rate, DRCLK, highly depend on the BOOST and Programmable Gain Amplifier, PGA, settings. MCLK - MASTER CLOCK The master clock, MCLK, is provided by the crystal oscillator, which is MHz on the RPIADCISOL board. The maximum frequency for this master clock is 20MHz. AMCLK - ANALOG MASTER CLOCK The master clock, MCLK, is divided down by the PRESCALER value to provide the Analog Master Clock, AMCLK. For proper operation and for optimizing ADC accuracy, AMCLK should be limited to a maximum frequency of 16.0MHz, therefore if the prescaler was set to 1, the AMCLK would be MHz, which is just above the maximum as specified for this ADC to maintain optimum accuracy. Set the prescaler to 2 to divide the master clock down to give an AMCLK of 8.192MHz in order to maintain optimum accuracy. DMCLK - DIGITAL MASTER CLOCK The digital master clock, DMCLK, is the ADC sampling frequency, which is equal to AMCLK / 4. This is the rate at which the modulator outputs are refreshed and each period of this clock corresponds to one sample and one modulator output. DMCLK = AMCLK / 4 RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

89 OSR - OVER SAMPLING RATE The over sampling rate, OSR, is the ratio of the sampling frequency to the output data rate and the default is 256. A larger OSR rejects more digital noise, but reduces the sampling output data rate, DRCLK. Set the OSR value (32, 64, 256, 512, 1024, 2048, 4096) to suit the application. DRCLK - DATA RATE Date Rate, DRCLK, is the output data rate, which is the rate at which the ADCs output new data. Each new data is signalled by a data ready pulse on the DR pin. This data rate is equal to the digital master clock, DMCLK, divided by the oversampling rate, OSR: DRCLK = DMCLK / OSR DRCLK - SAMPLING RATE CALCULATIONS The sampling rate is calculated from the clocks and the OSR value: MCLK = Crystal Oscillator Frequency (16.384MHz on RPIADCISOL) AMCLK = MCLK / PRESCALER DMCLK = AMCLK / 4 DRCLK = DMCLK / OSR EXAMPLES OF CLOCKS, OSR AND SAMPLING RATES Some examples to clarify the above, using the MHz crystal frequency on the RPIADCISOL: EXAMPLE 1: can be used for all PGA gains 1 to 32 - DEFAULT SETTING* Boost = 2x, Prescaler = 2, OSR over sampling rate = 256 (default) MCLK = MHz AMCLK = MCLK/PRESCALER = /2 = DMCLK = AMCLK/4 = /4 = DRCLK = DMCLK/OSR = /256 = 8000 samples per sec (8ksps) EXAMPLE 2: more OSR for better noise rejection - can be used for all PGA gains 1 to 32 Boost = 2x, Prescaler = 2, OSR over sampling rate = 512 MCLK = MHz AMCLK = MCLK/PRESCALER = /2 = DMCLK = AMCLK/4 = /4 = DRCLK = DMCLK/OSR = /512 = 4000 samples per sec (4ksps) EXAMPLE 3: more OSR for better noise rejection - could only be used for PGA gains 1 to 8 This example uses no prescaler and so AMCLK is operating > MHz Boost = 2x, Prescaler = 1, OSR over sampling rate = 512 MCLK = MHz AMCLK = MCLK/PRESCALER = /1 = (AMCLK>16.0MHz specified to maintain ADC accuracy) DMCLK = AMCLK/4 = /4 = RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

90 DRCLK = DMCLK/OSR = /512 = 8000 samples per sec (8ksps) ADC FUNCTIONS See the rpiadcmcp3913.c source, the rpiadcmcp3913.h header files and the Microchip MCP3913 ADC data sheet for specifications of each register within the ADC and how to set them. For convenience, the following functions have been provided, which are called using the defines from the rpiadcmcp3913.h header file in order to set up the registers. PHASE0 AND PHASE1 REGISTERS - PHASE TIMING BETWEEN ADC CHANNELS Call these functions to alter the phase timing between the channels using Phase0 and Phase1 registers: /************************************************************************************************** * * Function: RPIADCISOL_Phase0 * Inputs: 11-bit signed phase values for C (ch4/5) 0..±1023 int16_t * Returns: None * Overview: Save entered Phase register bits into shadow ram then update the ADC register * Any write to this register automatically resets and restarts all active ADCs * * The phase value sets how many DMCLK periods there are between each channel in the pair * Delay µs = entered value / DMCLK * * phasec = delay between ch4/5 * if phase reg value is + ch4 is lagging ch5 * if phase reg value is - ch4 is leading ch5 * **************************************************************************************************/ extern void RPIADCISOL_Phase0(int16_t phasec) ; /************************************************************************************************** * * Function: RPIADCISOL_Phase1 * Inputs: 11-bit signed phase values for B (ch2/3) and A (ch0/1) 0..±1023 int16_t * Returns: None * Overview: Save entered Phase register bits into shadow ram then update the ADC register * Any write to this register automatically resets and restarts all active ADCs * * The phase value sets how many DMCLK periods there are between each channel in the pair * Delay µs = entered value / DMCLK * * phaseb = delay between ch2/3, phasea = delay between ch0/1 * if phase reg value is + ch0 or ch2 is lagging ch1 or ch3 * if phase reg value is - ch0 or ch2 is leading ch1 or ch3 * **************************************************************************************************/ extern void RPIADCISOL_Phase1(int16_t phaseb, int16_t phasea) ; GAIN, PROGRAMMABLE GAIN AMPLIFIER (PGA) RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

91 Call this function to alter the gain of the ADC input, where the gain settings are: PGA_CHn<2:0> Gain V/V Gain db Vin Range (when Vref = 1.20 as per internal Vref) ±0.600 volts ± ± ± ± ± Reserved (sets Gain = 1) 111 Reserved (sets Gain = 1) When using high gain, because of the sensitivity, electrical noise could swamp the actual signal and so digital filtering techniques may have to be used to clean up the signal, eg Median filtering, Kalman Filtering, etc. VALUE OF EACH BIT WHEN USING 24-bit ADC: When using a signed 24-bit ADC value, the digital range is +8,388, ,388,608 PGA Gain 1 (±600mV range): each bit will represent 600mV / = mV = 71.52nV PGA Gain 2 (±300mV range): each bit will represent 300mV / = 35.76nV PGA Gain 32 (±18.75mV range): each bit will represent 18.75mV / = 2.235nV ISOLATED INPUTS 3 to 6 (ADC ch2 to 5) THROUGH AMC1200 OP-AMP WITH EFFECTIVE AV = 4: On inputs 3 to 6, which are the ADC ch2 to 5, with the ADC PGA gain set to 2 and a gain of 4 through the isolated op-amps, each bit will represent: 300mV / ( x 4) = 8.94nV /************************************************************************************************** * * Function: RPIADCISOL_Gain * Inputs: Programmable Gain Amplifier (PGA) for ch5..0 uint8_t * Returns: None * Overview: Save entered Gain register bits into shadow ram then update the ADC register * With Boost = 2x, max gain = 8 when AMCLK = 16MHz * With Boost = 2x, max gain = 32 when AMCLK = 13.3MHz * **************************************************************************************************/ extern void RPIADCISOL_Gain(uint8_t gain5, uint8_t gain4, uint8_t gain3, uint8_t gain2, \ uint8_t gain1, uint8_t gain0) ; STATUSCOM REGISTER Call this function to alter the STATUSCOM register: /************************************************************************************************** * RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

92 * Function: RPIADCISOL_StatusCom * Inputs: Read mode, Write Mode, DR HIZ, DR Link, Width CRC, Width Data, En CRCCOM, En Int, * DR Status ch5..0 uint8_t * Returns: None * Overview: Update the ADC StatusCom register with entered values * **************************************************************************************************/ extern void RPIADCISOL_StatusCom(uint8_t readmode, uint8_t writemode, uint8_t drhiz, \ uint8_t drlink, uint8_t widthcrc, uint8_t widthdata, \ uint8_t encrccom, uint8_t enint, uint8_t drstatus5_0) ; CONFIG0 REGISTER Call this function to alter configuration settings in the the CONFIG0 register: /************************************************************************************************** * * Function: RPIADCISOL_Config0 * Inputs: En Offcal, En Gaincal, Dither, Boost, Prescale, OSR, Vrefcal uint8_t * Returns: None * Overview: Save entered Config register bits into shadow ram then update the ADC register * **************************************************************************************************/ extern void RPIADCISOL_Config0(uint8_t enoffcal, uint8_t engaincal, uint8_t dither, \ uint8_t boost, uint8_t prescaler, uint8_t osr, uint8_t vrefcal ) ; See the previous section (ADC - DITHER, BOOST, CLOCKS, OSR AND SAMPLING RATES), for information on the CONFIG0 settings. CONFIG1 REGISTER Call this function to alter configuration settings in the the CONFIG0 register: /************************************************************************************************** * * Function: RPIADCISOL_Config1 * Inputs: reset ch5,4,3,2,1,0, shutdown ch5,4,3,2,1,0, vrefext, clkext uint8_t * Returns: None * Overview: Save entered Config register bits into shadow ram then update the ADC register * **************************************************************************************************/ extern void RPIADCISOL_Config1(uint8_t reset5, uint8_t reset4, uint8_t reset3, uint8_t reset2, \ uint8_t reset1, uint8_t reset0, uint8_t shutdown5, uint8_t shutdown4, \ uint8_t shutdown3, uint8_t shutdown2, uint8_t shutdown1, \ uint8_t shutdown0, uint8_t vrefext, uint8_t clkext ) ; OFFSET CALIBRATION REGISTERS Call this function to alter the offset calibration for each ADC channel: /************************************************************************************************** * * Function: RPIADCISOL_OffCal RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

93 * Inputs: channel 0..5 uint8_t (send cal data for each individual channel, not all at once) * offcal value int32_t, digital Offset calibration value (max 24-bit signed) for the * corresponding channel CHn (0..5) * Returns: None * Overview: Save entered Config register bits into shadow ram then update the ADC register * **************************************************************************************************/ extern void RPIADCISOL_OffCal(uint8_t channel, int32_t offcal) ; GAIN CALIBRATION REGISTERS Call this function to alter the gain calibration for each ADC channel: /************************************************************************************************** * * Function: RPIADCISOL_GainCal * Inputs: channel0..5 uint8_t, (send cal data for each individual channel, not all at once) * gaincal value int32_t, digital gain error calibration value (max 24-bit) for the * corresponding channel CHn (0..5) * This register is 24-bit signed MSB first coding with a range of -1x to x * (from 0x to 0x7FFFFF). The gain calibration adds 1x to this register and * multiplies it to the output code of the channel bit-by-bit, after offset calibration. * The range of the gain calibration is thus from 0x to x (from 0x * to 0x7FFFFF). The LSB corresponds to a 2-23 increment in the multiplier. CHn Output * Code = (GAINCAL_CHn+1)*ADC CHn Output Code. This register is a Don't Care if * EN_GAINCAL = 0 (Gain calibration disabled) but its value is not cleared by the * EN_GAINCAL bit. * Returns: None * Overview: Save entered Config register bits into shadow ram then update the ADC register * **************************************************************************************************/ extern void RPIADCISOL_GainCal(uint8_t channel, int32_t gaincal) ; LOCK/CRC REGISTER Call this function to alter the Lock/CRC register: /************************************************************************************************** * * Function: RPIADCISOL_LockCRC * Inputs: Lock Code (default 0xA5) uint8_t, CRC Reg uint16_t * Returns: None * Overview: Save entered Config register bits into shadow ram then update the ADC register * *************************************************************************************************** / extern void RPIADCISOL_LockCRC(uint8_t lockcode, uint16_t crcreg) ; RESET Call this function to reset the ADC parameters back to the manufacturer's default. /************************************************************************************************** RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

94 * * Function: RPIADCISOL_SWReset * Inputs: None * Returns: None * Overview: Does a software reset back to manufacturer's default paramaters by clearing (0) the * software register bits RESET_CHn in CONFIG1 reg * Not used because RPIADCISOL_Init resets all registers to what are needed * **************************************************************************************************/ extern void RPIADCISOL_SWReset(void) ; TEST IF ADC IS BUSY Call this function to test if the ADC channel is busy or if it is free, ie finish sampling and the data can be read. It returns true (1) if busy or false (0) if free: /************************************************************************************************** * * Function: RPIADCISOL_Busy * Inputs: channel (0..5) uint8_t or can use ADC_ALLCH defined in rpiadcisol.h to test all channels * Returns: true (1) = channel/s busy, false (0) = free * Info: Enter with channel 0..5 (or mask ADC_ALLCH) to test if that channel/s ADC is busy by * reading the DRSTATUS_CHn: Data Ready Status bits in STATUSCOM register lsb b5..0 * **************************************************************************************************/ extern uint8_t RPIADCISOL_Busy(uint8_t ch) ; ADC PARAMETERS INITIALISATION RPIADCISOL_Init() is called with the chip enable for the board (default = SPI_CE2) and this funciont initialises all of the ADC paramaters: /************************************************************************************************** * * Function: RPIADCISOL_Init * Inputs: CE chip enable line uint8_t (use defines in hardware.h, eg use SPI_CE2 for ADC) * Returns: None * Overview: Ensure that SPI_Init has been called to setup SPI module before calling this * See header file for the relevant parameter defines * * Enter with the chip enable CE line to be used for the board (use defines in hardware.h) * and this CE is saved ready for use in RPIADCISOL spi functions * * Inits ADC regs: ADC_Phase0, ADC_Phase1, ADC_Gain, ADC_StatusCom, ADC_Config0 * ADC_Config1, Offset Cal, Gain Cal, Lock/CRC * * Info: does not clear out any of the digital filter data and running total sampling data * when using separate digital filtering routines * **************************************************************************************************/ extern void RPIADCISOL_Init(uint8_t ce) ; The following parameters are called and initialised when this RPIADCISOL_Init() function is called: RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

95 LOCK/CRC REGISTER: Send default password 0xA5 so that all registers are unlocked and can be written to then send the 0x00 lock password to lock the registers to prevent glitches corrupting the data in the registers. This unlock/lock sequence is tested to check that a board is connected to the SPI bus. Within each register initialisation routine, the above unlock/lock sequence is performed to allow writing to the registers then locking afterwards to protect the registers. PHASE REGISTER Set 0µS phase delay between each pair of channels 0/1, 2/3, 4/5 GAIN REGISTER Set gain = 2 for channels 5, 4, 3 and 2 (±300mV ADC range after the AMC1200 op-amps which have AV=4) Set gain = 1 for channels 1 and 0 (±600mV ADC range) STATUSCOM REGISTER Address loop setting = address counter loops on register TYPES (DEFAULT) Write Mode Bit = Incremental addressing Write Mode (DEFAULT) DR pin state is Hi Z when data is not ready DR link is disabled, each ADC produces its own data ready pulse on the DR pin, when used CRC data width = 16 bits (DEFAULT) ADC data width = 32 bits extended sign CRC-16 checksum = off (DEFAULT) Interrupt flag for the CRCREG checksum verification = off (DEFAULT) Data ready status bit for each individual ADC channel = 1, channel CHn data is not ready (DEFAULT) CONFIG0 REGISTER Note: set these parameters to match your application. Calibrate = off (DEFAULT) Gain calibrate = off (DEFAULT) Dithering = max (DEFAULT) - see MCP3913 data sheet for explanation of dithering RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

96 Boost = all channels have current 2x (for maximum speed) Prescaler = 2, so with MHz Osc, AMCLK = 8.192MHz and DMCLK = 2.048MHz OSR = 512, so ADC sampling rate = 2.048MHz / 512 = 4000sps (4ksps) Vref calibrate = 0x50 (DEFAULT) CONFIG1 REGISTER: Reset mode for ch5..0 = reset OFF (DEFAULT) Shutdown mode for ch5..0 = OFF (DEFAULT) Internal Voltage Reference Shutdown Control = Int Vref Clock Mode = external XT crystal OFFSET CALIBRATION REGISTERS: Init each channel with 0 offset GAIN CALIBRATION REGISTERS: Init each channel with no gain adjustment READING ADC Call RPIADCISOL_ADC_R(ch ) with the relevant channel number (ch) 0..5 or pass the constant ADC_ALLCHAN (defined in the header file) to read all 6 channels in one pass for maximum speed. This function will update the relevant element in the ADCSpot[ ] signed 32-bit array with the ADC value, for example: RPIADCISOL_ADC_R (4); // Read just ADC ch 4, which will update ADCSpot[4] RPIADCISOL_ADC_R (ADC_ALLCHAN); // Read ALL ADC ch 0..5 which will update ADCSpot[0..5] /************************************************************************************************** * * Function: RPIADCISOL_ADC_R * Inputs: channel 0..5 uint8_t or can use ADC_ALLCH defined in rpiadcisol.h to read all channels * in one SPI access for faster data collection * Returns: None, but updates global signed 32-bit ADCSpot[ch] var with 17/24-bit signed ADC values * Overview: Enter with channel number or ADC_ALLCH to read all channels in one pass for speed * Wait for the channel/s to become free then read the relevant channel/s into buf * * Puts the signed 24-bit ADC spot values into signed 32-bit global vars ADCSpot[ch] * * 32-bit signed data reads from the ADC are used so that the same routine can be used for * 16/17 or 24-bit ADC data as the sign is automatically extended into the msb * * info: the ADCSpot[ch] range when using 24-bit ADC data = to RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

97 * **************************************************************************************************/ COMPILING AND LINKING RPIADCISOL To compile and link the RPIADCISOL application, open a terminal window and change directory (cd) into the rpiadcisol folder, which has been downloaded and expanded (unzipped). If it is on the Desktop, the terminal command will be: cd ~/Desktop/rpiadcisol You will now be in the rpiadcisol folder. To check, type the following command to display the current working directory: pwd Now you are in the source folder, to compile and link the code to make the 'rpiadcisol' program, type: make This will instruct the makefile to complete the commands required to compile and link the program, which will be called 'rpiadcisol'. To clean out all of the object files in order to do a fresh make, type: make clean or make c You can then do another make using the above command make To clean out all of the object files and recompile in one go, type: make a Run the rpiadcisol program From the terminal type: sudo./rpiadcisol This will run the rpiadcisol application within the current directory as denoted by./ Alternatively, use the command in the makefile and type: make r RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

98 rpiadcisol makefile explained The makefile is shown below to illustrate how it works. It is shown to gain an understanding of how easy it is to use a makefile. Note that text after '#' are comments which have been included to explain how the makefile works. Text in uppercase such as EXEC are variables and to use them they need to be written as ${EXEC}. Note that tabs and not spaces are used as delimiters in sections of the makefile and if that is not observed, the makefile will not operate. There are many excellent books and articles on the web, which explain how to write and use makefiles. The rpiadcisol makefile is below. # rpiadcisol makefile # PROGRAM NAME EXEC = rpiadcisol # CONSTITUENT OBJECT FILES OBJS = main.o bcm2835.o hardware.o rpiadcmcp3913.o LIBS = # COMPILER, where c = gcc, c++ = gpp CC = gcc # COMPILER FLAGS, where # -OO/-O0 or nothing = debug optimisation, O2 = optimised level for release # -g = enable debugging, ansi pedantic = original strict C standards # -static = link xxx.o libs as static to not use dynamic run-time libs - note you cannot link shared xxx.so libs as static libs # -Wall = std warning level, -W -Wconversion, etc = warn about all other errors CFLAGS = -O2 -static -Wall -W -Wconversion -Wshadow -Wcast-qual -Wwrite-strings # To display all errors CFLAGS2 = -O2 -static -Wall # Used when compiling bbcm2835 lib to stop displaying numerous errors # THIS SECTION LINKS ALL OBJECT AND BUILT-IN LIB/INC FILES TO CREATE THE PROGRAM all: ${EXEC} ${EXEC}: ${OBJS} ${CC} ${CFLAGS} -o ${EXEC} ${OBJS} ${LIBS} # COMPILE INDIVIDUAL CONSISTUENT SOURCE FILES TO CREATE THE ABOVE OBJECT FILES # Also include all header files, eg rpiadcmcp3913.h, so 'make' also checks if.h files have altered main.o: main.c ${CC} ${CFLAGS} -c main.c bcm2835.o: bcm2835.c bcm2835.h ${CC} ${CFLAGS2} -c bcm2835.c hardware.o: hardware.c hardware.h ${CC} ${CFLAGS} -c hardware.c rpiadcmcp3913.o: rpiadcmcp3913.c rpiadcmcp3913.h ${CC} ${CFLAGS} -c rpiadcmcp3913.c # ADDITIONAL MAKE COMMANDS TO SAVE TYPING a: clean all # make anew, first clean then build all c: clean clean: # -f = force and suppress errors if files not there rm -f ${EXEC} "all files cleaned up" RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

99 r: run run: sudo./${exec} RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

100 CERTIFICATES OF CONFORMITY RPI16IN CERTIFICATE OF CONFORMITY RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

101 RPI16OUT CERTIFICATE OF CONFORMITY RPI116IN, RPI16OUT, RPIADCISOL isolated interface cards from S&S Systems - Instruction Manual v April

RASPBERRY PI MEGA-IO EXPANSION CARD USER'S GUIDE VERSION 2.3

RASPBERRY PI MEGA-IO EXPANSION CARD  USER'S GUIDE VERSION 2.3 RASPBERRY PI MEGA-IO EXPANSION CARD www.sequentmicrosystems.com USER'S GUIDE VERSION 2.3 GENERAL DESCRIPTION... 2 BOARD LAYOUT... 3 BLOCK DIAGRAM... 4 COMPONENT DESCRIPTION... 5 CONFIGURATION JUMPERS...

More information

BB-303 Manual Baseboard for TMCM-303

BB-303 Manual Baseboard for TMCM-303 BB-303 Manual Baseboard for TMCM-303 Trinamic Motion Control GmbH & Co. KG Sternstraße 67 D 20357 Hamburg, Germany http://www.trinamic.com BB-303 Manual (V1.04 / Jul 9th, 2007) 2 Contents 1 Features...

More information

Ultra-Accurate Temperature Measurement Instruments

Ultra-Accurate Temperature Measurement Instruments TEMPpoint Temperature Measurement Instruments Ultra-Accurate Temperature Measurement Instruments TEMPpoint is a series of precision temperature measurement instruments designed for high accuracy and industrial

More information

Arduino Dock 2. The Hardware

Arduino Dock 2. The Hardware Arduino Dock 2 The Arduino Dock 2 is our supercharged version of an Arduino Uno R3 board. These two boards share the same microcontroller, the ATmel ATmega328P microcontroller (MCU), and have identical

More information

E3B USER'S GUIDE. for QT310 / QT320 QProx IC evaluation and development Overview. Fast Start

E3B USER'S GUIDE. for QT310 / QT320 QProx IC evaluation and development Overview. Fast Start E3B USER'S GUIDE for QT310 / QT320 QProx IC evaluation and development Overview The E3B board works with Quantum s QT310 and QT320 QProx ICs. Either device can be inserted into the 8-pin DIP socket. QT310

More information

For Raspberry Pi - Getting started

For Raspberry Pi - Getting started For Raspberry Pi - Getting started Extend your PiFace Relay+ with the PiFace Relay EXTRA board, allowing you to control twice as many circuits. Product highlights Typical applications: Robotics Motor control

More information

DSP240-LPI Inverter Controller Card. Technical Brief

DSP240-LPI Inverter Controller Card. Technical Brief DSP240-LPI Inverter Controller Card Technical Brief September 2006 Manual Release 3.0 Card Revision 3.0 Copyright 2001-2006 Creative Power Technologies P.O. Box 714 MULGRAVE Victoria, 3170 Tel: +61-3-9543-8802

More information

Prototyping Module Datasheet

Prototyping Module Datasheet Prototyping Module Datasheet Part Numbers: MPROTO100 rev 002 Zenseio LLC Updated: September 2016 Table of Contents Table of Contents Functional description PROTOTYPING MODULE OVERVIEW FEATURES BLOCK DIAGRAM

More information

A general-purpose industrial input/output

A general-purpose industrial input/output A general-purpose industrial input/output Iono MKR is a versatile and compact IO module compatible with all the Arduino MKR boards. All the power of the Arduino platform, combined with WiFi, BLE, GSM,

More information

Raspberry Pi board. EB080

Raspberry Pi board.   EB080 Raspberry Pi board www.matrixmultimedia.com EB080 Contents About this document 3 Board layout 3 General information 4 Circuit description 4 Circuit diagram 5 2 Copyright Matrix Multimedia Ltd. About this

More information

Gooligum Electronics 2015

Gooligum Electronics 2015 The Wombat Prototyping Board for Raspberry Pi Operation and Software Guide This prototyping board is intended to make it easy to experiment and try out ideas for building electronic devices that connect

More information

DESIGO RX Individual room controllers. for fan-coil systems, chilled ceilings and radiators, with LONMARK-compatible bus communications

DESIGO RX Individual room controllers. for fan-coil systems, chilled ceilings and radiators, with LONMARK-compatible bus communications 3 834 DESIO RX Individual room controllers for fan-coil systems, chilled ceilings and radiators, with MARK-compatible bus communications RXC20.1 RXC21.1 The RXC20.1 and RXC21.1 controllers are used for

More information

Aarlogic TER-GX910. Product description. Rev.9 17/03/2013

Aarlogic TER-GX910. Product description. Rev.9 17/03/2013 Aarlogic TER-GX910 Product description Rev.9 17/03/2013 Contents 1 Overview... 3 2 Hardware Interface Description... 3 2.1 Main features of the TER-GX910... 3 2.2 Hardware block diagram... 4 3 Interface

More information

CDB5346. Evaluation Board for CS5346. Features. Description CS5346. Single-ended Analog Inputs. Single-ended Analog Outputs

CDB5346. Evaluation Board for CS5346. Features. Description CS5346. Single-ended Analog Inputs. Single-ended Analog Outputs Evaluation Board for CS5346 Features Description Single-ended Analog Inputs Single-ended Analog Outputs CS8406 S/PDIF Digital Audio Transmitter Header for Optional External Software Configuration of CS5346

More information

SF Innovations Ltd. Custard Pi 3-8 Analogue input board for the Raspberry Pi GPIO. User Instructions (13th December 2016) Contents.

SF Innovations Ltd. Custard Pi 3-8 Analogue input board for the Raspberry Pi GPIO. User Instructions (13th December 2016) Contents. SF Innovations Ltd Custard Pi 3-8 Analogue input board for the Raspberry Pi GPIO User Instructions (3th December 206) Contents Introduction CE Compliance and Safety Information Circuit Description Parts

More information

Modtronix Engineering Modular Electronic Solutions SBC28DC. Single board computer for 28 pin DIP PICs

Modtronix Engineering Modular Electronic Solutions SBC28DC. Single board computer for 28 pin DIP PICs Modtronix Engineering Modular Electronic Solutions Single board computer for 28 pin DIP PICs Table of Contents 1 Introduction...2 2 Features...4 3 Expansion Connectors...5 3.1 Daughter Board Connectors...5

More information

Stellar Instruments. SC1 Controller & Display System. General User s Manual. Copyright 2013 Stellar Instruments 1

Stellar Instruments. SC1 Controller & Display System. General User s Manual. Copyright 2013 Stellar Instruments 1 Stellar Instruments SC1 Controller & Display System General User s Manual Copyright 2013 Stellar Instruments 1 Contents Section 1 General... 3 Section 2 Base Unit A (Multi-Event Programmable Timer)...

More information

Q22 DATRAN II excel Owners Manual

Q22 DATRAN II excel Owners Manual Q22 DATRAN II excel Owners Manual Manual Revision No. 1.03 Dated November 2001 Copyright 2000 to QTech Data Systems Limited Christchurch, NEW ZEALAND All rights reserved The circuit details and know how

More information

Data sheet GCM MOD GMM EC.1 Communications module Modbus for GMM EC

Data sheet GCM MOD GMM EC.1 Communications module Modbus for GMM EC Data sheet GCM MOD GMM EC.1 Communications module Modbus for GMM EC ERP no.: 5206415 GCM MOD GMM EC.1 www.guentner.de Page 2 / 15 Contents 1 GCM MOD GMM EC.1...3 1.1 Functional description...3 1.2 Connections...

More information

Sierra Radio Systems. HamStack. Project Board Reference Manual V1.0

Sierra Radio Systems. HamStack. Project Board Reference Manual V1.0 Sierra Radio Systems HamStack Project Board Reference Manual V1.0 Welcome HamStack Project Board Reference Manual Revision 1.0.3 2011 George Zafiropoulos, KJ6VU and John Best, KJ6K This guide provides

More information

Contents. Please read and remember the following warnings before using the RELAYplate:

Contents. Please read and remember the following warnings before using the RELAYplate: Contents 1 Warnings o 1.1 What is a Relay? o 1.2 Basic Features of the RELAYplate o 1.3 Attaching a Load to the RELAYplate o 1.4 The RELAYplate Command Set 1.4.1 RELAY Control Functions 1.4.2 LED Control

More information

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front Arduino Uno Arduino Uno R3 Front Arduino Uno R2 Front Arduino Uno SMD Arduino Uno R3 Back Arduino Uno Front Arduino Uno Back Overview The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet).

More information

Pmod modules are powered by the host via the interface s power and ground pins.

Pmod modules are powered by the host via the interface s power and ground pins. 1300 Henley Court Pullman, WA 99163 509.334.6306 www.store. digilent.com Digilent Pmod Interface Specification 1.2.0 Revised October 5, 2017 1 Introduction The Digilent Pmod interface is used to connect

More information

WLS-TC Specifications

WLS-TC Specifications Specifications Document Revision 1.0, February, 2010 Copyright 2010, Measurement Computing Corporation Typical for 25 C unless otherwise specified. Specifications in italic text are guaranteed by design.

More information

DGSZV-EP DIGITAL GALVANIC LONGITUDINAL DIFFERENTIAL PROTECTION. Application field

DGSZV-EP DIGITAL GALVANIC LONGITUDINAL DIFFERENTIAL PROTECTION. Application field DGSZV-EP DIGITAL GALVANIC LONGITUDINAL DIFFERENTIAL PROTECTION The digital galvanic longitudinal differential protection of type DGSZV-EP is part of device family named EuroProt. This short description

More information

ADVANCED MICRO SYSTEMS

ADVANCED MICRO SYSTEMS Overview... 3 Included in the Box:... 3 Pinout... 4 Installation... 5 Power Supply... 6 Stepping Motors... 7 DIP Switch (JP1) Location... 8 Setting the Output Current (JP1)... 8 Microstep Resolution (JP1)...

More information

Temperature measurement board, optically isolated, 16/8/4 channels for thermocouples, Pt100, RTD, 18-bit

Temperature measurement board, optically isolated, 16/8/4 channels for thermocouples, Pt100, RTD, 18-bit Temperature measurement board, optically isolated, 16/8/ channels for thermocouples, Pt100, RTD, 18-bit APCI-3200 Up to 16 channels for thermocouples or 8 inputs for resistance temperature detectors (RTD)

More information

For Raspberry Pi - Getting started

For Raspberry Pi - Getting started For Raspberry Pi - Getting started Extend your PiFace Relay+ with the PiFace Motor EXTRA board, allowing you to control DC motors. Product highlights Typical applications: Robotics Motor control Home automation

More information

Shack Clock kit. U3S Rev 2 PCB 1. Introduction

Shack Clock kit. U3S Rev 2 PCB 1. Introduction Shack Clock kit U3S Rev 2 PCB 1. Introduction Thank you for purchasing the QRP Labs Shack Clock kit. This clock uses the Ultimate3S QRSS/WSPR kit hardware, but a different firmware version. It can be used

More information

USER GUIDE. Atmel OLED1 Xplained Pro. Preface

USER GUIDE. Atmel OLED1 Xplained Pro. Preface USER GUIDE Atmel OLED1 Xplained Pro Preface Atmel OLED1 Xplained Pro is an extension board to the Atmel Xplained Pro evaluation platform. The board enables the user to experiment with user interface applications

More information

2. Control Pin Functions and Applications

2. Control Pin Functions and Applications IMARY CONTROL ( PIN) Module Enable / Disable. The module can be disabled by pulling the below 2.3 V with respect to the Input. This should be done with an open-collector transistor, relay, or optocoupler.

More information

CDN503 HIGH DENSITY I/O ADAPTER USER GUIDE

CDN503 HIGH DENSITY I/O ADAPTER USER GUIDE CDN503 HIGH DENSITY I/O ADAPTER USER GUIDE 13050301 (c) Copyright DIP Inc., 1996 DIP Inc. P.O. Box 9550 MORENO VALLEY, CA 92303 714-924-1730 CONTENTS DN503 PRODUCT OVERVIEW 1 DN503 INSTALLATION 1 POWER

More information

EVAL-INAMP-62RZ/82RZ/82RMZ

EVAL-INAMP-62RZ/82RZ/82RMZ Evaluation Boards for the AD620 Series and and the AD8220 Series Instrumentation Amplifiers EVAL-INAMP-62RZ/82RZ/82RMZ FEATURES 3 generic, easy-to-use PC boards Support several related in-amp products

More information

D115 The Fast Optimal Servo Amplifier For Brush, Brushless, Voice Coil Servo Motors

D115 The Fast Optimal Servo Amplifier For Brush, Brushless, Voice Coil Servo Motors D115 The Fast Optimal Servo Amplifier For Brush, Brushless, Voice Coil Servo Motors Ron Boe 5/15/2014 This user guide details the servo drives capabilities and physical interfaces. Users will be able to

More information

Measurement Systems Datascan Installation and User Guide

Measurement Systems Datascan Installation and User Guide Measurement Systems Datascan Installation and User Guide Supplied By Contents Contents 1. INTRODUCTION... 1 1.1 GENERAL... 1 1.2 DATASCAN MODULE RANGE... 1 1.2.1 Measurement Processors... 1 1.2.2 Analog

More information

Overview Included in the Box: Pinout Installation Power Supply Stepping Motors DIP Switch (JP1) Location...

Overview Included in the Box: Pinout Installation Power Supply Stepping Motors DIP Switch (JP1) Location... DRV7 USERS GUIDE Overview... 3 Included in the Box:... 4 Pinout... 4 Installation... 5 Power Supply... 6 Stepping Motors... 8 DIP Switch (JP1) Location... 9 Setting the Output Current (JP1)... 9 Microstep

More information

BMS: Installation Manual v2.x - Documentation

BMS: Installation Manual v2.x - Documentation Page 1 of 7 BMS: Installation Manual v2.x From Documentation This section describes how external peripheral devices are connected and additional functions of the BMS are used. I you have not done so already,

More information

ARDUINO MEGA ADK REV3 Code: A000069

ARDUINO MEGA ADK REV3 Code: A000069 ARDUINO MEGA ADK REV3 Code: A000069 OVERVIEW The Arduino MEGA ADK is a microcontroller board based on the ATmega2560. It has a USB host interface to connect with Android based phones, based on the MAX3421e

More information

VLSI AppNote: VSx053 Simple DSP Board

VLSI AppNote: VSx053 Simple DSP Board : VSx053 Simple DSP Board Description This document describes the VS1053 / VS8053 Simple DPS Board and the VSx053 Simple DSP Host Board. Schematics, layouts and pinouts of both cards are included. The

More information

Arduino ADK Rev.3 Board A000069

Arduino ADK Rev.3 Board A000069 Arduino ADK Rev.3 Board A000069 Overview The Arduino ADK is a microcontroller board based on the ATmega2560 (datasheet). It has a USB host interface to connect with Android based phones, based on the MAX3421e

More information

F1000 User's Manual. (Version: V1.01)

F1000 User's Manual. (Version: V1.01) (Version: V1.01) Contents Chapter 1 Overview... 2 Chapter 2 Installation... 3 2.1 Installation guide... 3 2.1.1 Installation position... 3 2.1.2 NEMA4 standard installation... 3 2.1.3 Environment precautions...

More information

Signal Conditioning Modules and Terminal Boards

Signal Conditioning Modules and Terminal Boards Signal Conditioning Modules and Terminal Boards Terminal Board Selection Guide 17-2 Isolated Signal Conditioning Modules ADAM-3000 Series Isolated Signal Conditioning Modules 17-4 ADAM-3011 ADAM-3013 ADAM-3014

More information

Series Watt DC Power Supplies

Series Watt DC Power Supplies Keithley Instruments 28775 Aurora Road Cleveland, Ohio 44139 1-800-935-5595 http://www.keithley.com Series 2268 850-Watt DC Power Supplies Specifications SPECIFICATION CONDITIONS This document contains

More information

Ultra-Accurate Measurement for Temperature and Voltage

Ultra-Accurate Measurement for Temperature and Voltage Ultra-Accurate Measurement for Temperature and Voltage MEASURpoint is an ultra-accurate instrument for measuring any combination of thermocouple, RTD, and voltage inputs. MEASURpoint is available as a

More information

EZmoto V4.1 Product description Rev. 2 30/07/2015

EZmoto V4.1 Product description Rev. 2 30/07/2015 EZmoto V4.1 Product description Rev. 2 30/07/2015 1 Contents 1. Overview... 3 2. Hardware Interface Description... 3 2.1 Main features of the EZmoto... 3 2.2 Hardware block diagram... 4 2.3 Internal Hardware

More information

SF Innovations Ltd. User Instructions (5th January 2016) Contents. Introduction

SF Innovations Ltd. User Instructions (5th January 2016) Contents. Introduction SF Innovations Ltd Custard Pi 1 - Breakout Board with protection for the Raspberry Pi GPIO Custard Pi 1A - Breakout Board for the Raspberry Pi GPIO User Instructions (5th January 2016) Contents Introduction

More information

CDN502 HIGH DENSITY I/O ADAPTER USER GUIDE

CDN502 HIGH DENSITY I/O ADAPTER USER GUIDE CDN502 HIGH DENSITY I/O ADAPTER USER GUIDE 13050201 (c) Copyright DIP Inc., 1996 DIP Inc. P.O. Box 9550 MORENO VALLEY, CA 92303 714-924-1730 CONTENTS DN502 PRODUCT OVERVIEW 1 DN502 INSTALLATION 1 POWER

More information

!There are two kit models. The ZCTK-120 is designed to operate with.!the pulse output is isolated from the mains line voltage. A pull-up resistor

!There are two kit models. The ZCTK-120 is designed to operate with.!the pulse output is isolated from the mains line voltage. A pull-up resistor CAUTION: Please make sure you have or have access to the skills necessary to assemble and use this product. Always secure the case with the included screws before applying electrical power to the power

More information

Specifications

Specifications Specifications 18200-40 Cole-Parmer Instrument Company 625 East Bunker Court Vernon Hills, Illinois 60061-1844 (847) 549-7600 (847) 247-2929 (Fax) 800-323-4340 www.coleparmer.com e-mail: techinfo@coleparmer.com

More information

ARDUINO LEONARDO ETH Code: A000022

ARDUINO LEONARDO ETH Code: A000022 ARDUINO LEONARDO ETH Code: A000022 All the fun of a Leonardo, plus an Ethernet port to extend your project to the IoT world. You can control sensors and actuators via the internet as a client or server.

More information

Extension module for lighting control

Extension module for lighting control s 3 842 DESIGO RXC Extension module for lighting control Extension to the RXC30 / RXC31 / RXC38 room controller RXC40.1 RXC40.5 The RXC40 extension module is used in conjunction with an RXC30, RXC31 or

More information

Ocean Controls KTA-224 Modbus IO Module

Ocean Controls KTA-224 Modbus IO Module Ocean Controls Ocean Controls 8 Relay outputs (5A, 250VAC contacts) 4 Opto-Isolated Inputs with counters 3 Analog Inputs (10 bit) jumperselectable for 0-5V or 0-20mA 4 Input Counters RS485 or USB (virtual

More information

Ultra-Accurate Measurement for Temperature and Voltage

Ultra-Accurate Measurement for Temperature and Voltage Ultra-Accurate Measurement for Temperature and Voltage MEASURpoint is an ultra-accurate instrument for measuring any combination of thermocouple, RTD, and voltage inputs. MEASURpoint is available as a

More information

DEEP SEA ELECTRONICS PLC DSE103 MK II Speed Switch Operators Manual

DEEP SEA ELECTRONICS PLC DSE103 MK II Speed Switch Operators Manual DEEP SEA ELECTRONICS PLC DSE103 MK II Speed Switch Operators Manual Document number 057-135 Author : Paul Gibbons DSE103 MKII Operator Manual Issue 1 Deep Sea Electronics Plc Highfield House Hunmanby North

More information

TXP3500/4000 Series AC-DC Industrial PSU

TXP3500/4000 Series AC-DC Industrial PSU TXP3500/4000 Series ACDC Industrial PSU The TXP3500/4000 series of Fan cooled power supplies convert a universal 3 phase AC I/p to an adjustable, wide range, simple o/p @ 3.5kW. Parallel operation is possible

More information

SoundwebTM. Installation Guide

SoundwebTM. Installation Guide 105 SoundwebTM Soundweb TM 9000 Installation Guide Soundweb TM Regulatory Information An example of this equipment has been tested and found to comply with the following European and international Standards

More information

IST ULTRASTAB Power Supply for high precision transducers

IST ULTRASTAB Power Supply for high precision transducers IST ULTRASTAB Power Supply for high precision transducers High performance 6-channel power supply for multi-channel laboratory measurement applications. Features Current output or ±0 V voltage output (see

More information

Rhino Buffer Module PSM24-BFM600S. Operating Instructions

Rhino Buffer Module PSM24-BFM600S. Operating Instructions Rhino Buffer Module PSM24-BFM600S Operating Instructions RHINO BUFFER MODULE PSM24-BFM600S Description The PSM24-BFM600S Buffer Module will hold the output voltage of a 24 VDC power supply after brownouts

More information

Owner s Hardware Service Manual Frank Control Computer System

Owner s Hardware Service Manual Frank Control Computer System Owner s Hardware Service Manual Frank Control Computer System Revision 0105 ABOUT THIS MANUAL This section describes the contents of this manual and how to use this manual effectively. It was designed

More information

DT1102 V (PS) Fully Configurable Galvanic Isolator. Operating Instructions

DT1102 V (PS) Fully Configurable Galvanic Isolator. Operating Instructions (PS) Fully Configurable Galvanic Isolator Operating Instructions Contents 1. About this document...4 1.1. Function... 4 1.2. Target group... 4 1.3. Symbolism used... 4 2. For your safety...5 2.1. Authorized

More information

Evaluation Board for CS3308. Description CS Channel. Digitally Controlled Analog Volume Control. PC or External Serial Control Input

Evaluation Board for CS3308. Description CS Channel. Digitally Controlled Analog Volume Control. PC or External Serial Control Input Evaluation Board for CS3308 Features Description Single-ended Analog Inputs Single-ended Analog Outputs Supports AC and DC-Coupled Analog I/O Flexible Serial Control I/O Headers Serial Control Input Header

More information

Control unit SG-EFS 104/2W. EN Operating instructions. Innovative by tradition. Version SG-EFS 104/2W 24 V=/~

Control unit SG-EFS 104/2W. EN Operating instructions. Innovative by tradition. Version SG-EFS 104/2W 24 V=/~ Innovative by tradition. Control unit SG-EFS 104/2W EN Operating instructions Version 0.9 1005196 SG-EFS 104/2W 24 V=/~ Original instructions Mayser GmbH & Co. KG Örlinger Straße 1 3 89073 Ulm GERMANY

More information

Controlesta RCO-Compact

Controlesta RCO-Compact Commissioning NOTICE The details contained in these documents and data can be changed without prior advance notice No part of these documents may be reproduced or passed on without the specific written

More information

ARDUINO MEGA 2560 REV3 Code: A000067

ARDUINO MEGA 2560 REV3 Code: A000067 ARDUINO MEGA 2560 REV3 Code: A000067 The MEGA 2560 is designed for more complex projects. With 54 digital I/O pins, 16 analog inputs and a larger space for your sketch it is the recommended board for 3D

More information

T100MD PLC Installation Guide

T100MD PLC Installation Guide T100MD-2424+ PLC Installation Guide LCD Display Module MCR 12 to 24V DC Power Supply for PLC Master Control Relay for Output. + - EEPROM Write-Protection when J2 at WP 14-pin LCD Display Port Two-wire

More information

PMDX-108-Output. 8-Channel Isolated Output Board for PC parallel port pins 2-9. User s Manual

PMDX-108-Output. 8-Channel Isolated Output Board for PC parallel port pins 2-9. User s Manual PMDX-108-Output 8-Channel Isolated Output Board for PC parallel port pins 2-9 User s Manual Date: 25 February 2010 PMDX Web: http://www.pmdx.com 9704-D Gunston Cove Rd Phone: +1 (703) 372-2975 Lorton,

More information

Artistic Licence. Rail-Split extreme. User Guide. Serial numbers 151 upwards. Rail-Split extreme User Guide. Version 5-0

Artistic Licence. Rail-Split extreme. User Guide. Serial numbers 151 upwards. Rail-Split extreme User Guide. Version 5-0 Artistic Licence Rail-Split extreme User Guide Serial numbers 151 upwards Version 5-0 Please read these instructions before using the product. This product has been designed & manufactured for professional

More information

300 WATT, PFC, OPEN FRAME POWER SUPPLIES TABLE 1. OUTPUT RATINGS AND SPECIFICATIONS, RMW 300W SERIES

300 WATT, PFC, OPEN FRAME POWER SUPPLIES TABLE 1. OUTPUT RATINGS AND SPECIFICATIONS, RMW 300W SERIES INSTRUCTION MANUAL KEPCO An ISO 9001 Company. 300 WATT, PFC, OPEN FRAME POWER SUPPLIES RMW 300W SERIES I INTRODUCTION SCOPE OF MANUAL. This instruction manual covers the installation and operation of the

More information

USB DIO High Voltage and Relay

USB DIO High Voltage and Relay DIO High Voltage and -PDISO, -ERB, and - Series -PDISO Series -ERB Series - Series Overview Measurement Computing DIO high voltage and relay product offerings include the -PDISO Series, -ERB Series, and

More information

February 28,

February 28, February 28, 2014 1 http://www.mattairtech.com/ Table of Contents Overview...3 Introduction...3 Features...4 Hardware...5 Main Header Pins...5 ISP Header Pins...6 Solder Jumpers...6 Onboard 3.3V, 250mA

More information

TRACKER 240 SERIES. Load Cell and Weighing Indicators. A Precision Measurement Instrument with Outstanding Features

TRACKER 240 SERIES. Load Cell and Weighing Indicators. A Precision Measurement Instrument with Outstanding Features TRACKER 240 SERIES Load Cell and Weighing Indicators A Precision Measurement Instrument with Outstanding Features TRACKER 240 SERIES INDICATORS Ratiometric Measurement Tare and Auto Transducer Excitation

More information

FX-2 Control Board ASY-360-XXX Setup and Configuration Guide

FX-2 Control Board ASY-360-XXX Setup and Configuration Guide FX-2 Control Board ASY-360-XXX Setup and Configuration Guide Micro Air Corporation Phone (609) 259-2636 124 Route 526. WWW.Microair.net Allentown NJ 08501 Fax (609) 259-6601 Table of Contents Introduction...

More information

Pridgen Vermeer Robotics Xmega128 Manual

Pridgen Vermeer Robotics Xmega128 Manual Features: 12x PWM signals with 5V supply 8x A/D Inputs with 3.3V supply 2x RS 232 Terminals 1x SPI Interface 4x 8-bit Digital IO ports 3.3V Power Bus LCD Header (4-bit mode) Smart Power Connecter Power

More information

Thursday, September 15, electronic components

Thursday, September 15, electronic components electronic components a desktop computer relatively complex inside: screen (CRT) disk drive backup battery power supply connectors for: keyboard printer n more! Thursday, September 15, 2011 integrated

More information

ON4AKH Antenna Rotator controller Version 1.0

ON4AKH Antenna Rotator controller Version 1.0 ON4AKH Antenna Rotator controller Version 1.0 1. Some construction tips The project consists out of 3 boards. The 1 st board is the main board containing the PIC micro controller and the H-bridge components

More information

ADA User manual ADA RS-485 / RS-422 to RS-232 Converter. 1 io_ada-4010_v3.22_en. Copyright CEL-MAR sp.j.

ADA User manual ADA RS-485 / RS-422 to RS-232 Converter. 1 io_ada-4010_v3.22_en. Copyright CEL-MAR sp.j. User manual ADA-4010 RS-485 / RS-422 to RS-232 Converter Copyright 2001-2017 CEL-MAR spj 1 io_ada-4010_v322_en Contents 1 GENERAL INFORMATION 3 11 WARRANTED INFORMATION 3 12 GENERAL CONDITIONS FOR SAFE

More information

Ethernet1 Xplained Pro

Ethernet1 Xplained Pro Ethernet1 Xplained Pro Part Number: ATETHERNET1-XPRO The Atmel Ethernet1 Xplained Pro is an extension board to the Atmel Xplained Pro evaluation platform. The board enables the user to experiment with

More information

AVR-P development board Users Manual

AVR-P development board Users Manual AVR-P40-8515 development board Users Manual All boards produced by Olimex are ROHS compliant Revision A, January 2002 Copyright(c) 2009, OLIMEX Ltd, All rights reserved Page 1 INTRODUCTION: The AVR Microcontroller

More information

USER GUIDE. Atmel QT1 Xplained Pro. Preface

USER GUIDE. Atmel QT1 Xplained Pro. Preface USER GUIDE Atmel QT1 Xplained Pro Preface Atmel QT1 Xplained Pro kit is an extension board that enables evaluation of self- and mutual capacitance mode using the Peripheral Touch Controller (PTC) module.

More information

Temperature Measurement Instruments Ultra-Accurate... by Design

Temperature Measurement Instruments Ultra-Accurate... by Design TEMPpoint Type: Temperature Measurement Instrument Temperature Measurement Instruments Ultra-Accurate... by Design TEMPpoint is a family of temperature measurement instruments designed for high accuracy

More information

Product Manual Dual SSR Relay Board

Product Manual Dual SSR Relay Board Product Manual 3053 - Dual SSR Relay Board Phidgets 3053 - Product Manual For Board Revision 0 Phidgets Inc. 2010 Contents 4 Product Features 4 Connections 5 Getting Started 5 Checking the Contents 5 Connecting

More information

5504 Thermocouple Analog Input Module

5504 Thermocouple Analog Input Module 550 Thermocouple Analog Input Installation, Operation and Maintenance Setup Manual 5/9/0 Safety Information The information provided in this documentation contains general descriptions and/or technical

More information

IPC. Preliminary Data Brief. IPC High speed phase current sensor with digital interface Draft Review Released

IPC. Preliminary Data Brief. IPC High speed phase current sensor with digital interface Draft Review Released IPC Preliminary Data Brief Header Project State IPC High speed phase current sensor with digital interface Draft Review Released Responsible Creation 2010-07-27 Module Name IPC-A and IPC-C Hardware Version

More information

EZ864 UMTS Terminal Telit Cellular GSM Engine

EZ864 UMTS Terminal Telit Cellular GSM Engine EZ864 UMTS Terminal Telit Cellular GSM Engine Version: 01.01 EZ864 UMTS Terminal_HD_V01.01 06.Mar.2008-1 - Hardware Interface Description 1. Hardware Features of the EZ864 UMTS Terminal Feature Implementation

More information

UCBB dual port breakout board user's manual

UCBB dual port breakout board user's manual UCBB dual port breakout board user's manual 1/14 Contents 1 Features 2 Dimensions 3 Connectors 3.1 Screw terminals 3.2 IDC ports 3.3 Powering 3.4 Outputs 3.5 Inputs 4 LED indicators 5 Example connections

More information

Kvaser PCI104 User's Guide

Kvaser PCI104 User's Guide Kvaser PCI104 User's Guide Copyright 2008-2011 KVASER AB, Mölndal, Sweden http://www.kvaser.com Last updated Wednesday, 05 September 2012 We believe that the information contained herein was accurate in

More information

OPMM-1616-XT. PC/104 I/O Module with Optoisolated inputs and Relay Outputs. Rev 1.0 September 2010

OPMM-1616-XT. PC/104 I/O Module with Optoisolated inputs and Relay Outputs. Rev 1.0 September 2010 init OPMM-1616-XT PC/104 I/O Module with Optoisolated inputs and Relay Outputs Rev 1.0 September 2010 Revision Date Comment 1.0 9/26/2010 first release FOR TECHNICAL SUPPORT PLEASE CONTACT: Copyright 2010

More information

MC 11 EB-2 Power supply cabinet with external bus, AC version

MC 11 EB-2 Power supply cabinet with external bus, AC version MC 11 EB-2 Power supply cabinet with external bus, AC version USER/MAINTENANCE MANUAL 1 SLOT 0 SLOT 1 SLOT 2 SLOT 3 SLOT 4 SLOT 5 SLOT 6 SLOT 7 SLOT 8 SLOT 9 SLOT 10 SLOT 11 EB-2 (a) MC11 (b) (c) Figures

More information

ARDUINO MICRO WITHOUT HEADERS Code: A000093

ARDUINO MICRO WITHOUT HEADERS Code: A000093 ARDUINO MICRO WITHOUT HEADERS Code: A000093 Arduino Micro is the smallest board of the family, easy to integrate it in everyday objects to make them interactive. The Micro is based on the ATmega32U4 microcontroller

More information

USER GUIDE. Atmel QT6 Xplained Pro. Preface

USER GUIDE. Atmel QT6 Xplained Pro. Preface USER GUIDE Atmel QT6 Xplained Pro Preface Atmel QT6 Xplained Pro kit is a Xplained Pro extension board that enables the evaluation of a mutual capacitance touch suface using the Peripheral Touch Controller

More information

Operating instructions. Switching amplifier DN0210 DN / / 2015

Operating instructions. Switching amplifier DN0210 DN / / 2015 Operating instructions Switching amplifier DN0210 DN0220 UK 80011079 / 00 01 / 2015 Contents 1 Preliminary note...4 1.1 Symbols used...4 1.2 Warning signs used...4 2 Safety instructions...5 2.1 General...5

More information

5.1. Motor Protection and Monitoring. Contents. Product Overview. Monitoring Relays. D64R Series Digital Ground Fault Relays...

5.1. Motor Protection and Monitoring. Contents. Product Overview. Monitoring Relays. D64R Series Digital Ground Fault Relays... .1 Ground Fault Relays and Monitors Contents Description Current.................. Phase................... Voltage.................. Ground Fault Relays and Monitors D64R Series Digital Ground Fault Relays....

More information

ADC7520 SERIES. 1600W Battery Chargers and Power Supplies

ADC7520 SERIES. 1600W Battery Chargers and Power Supplies ADC7520 SERIES 1600W Battery Chargers and Power Supplies Wide output adjustment range 0 72VDC Analog control by external 0-5VDC voltage Temp.comp charging, sense as on option Power fail relay alarm Master-Slave

More information

Product Highlights. Uses:

Product Highlights. Uses: CodeBug is a fun, engaging, entry level introduction to coding, physical computing and electronics. In just a few clicks you can program the versatile little CodeBug wearable computer to display your own

More information

BV4626 General Purpose I/O. Product specification. Mar 2010 V0.a. ByVac Page 1 of 13

BV4626 General Purpose I/O. Product specification. Mar 2010 V0.a. ByVac Page 1 of 13 General Purpose I/O Product specification Mar 2010 V0.a ByVac Page 1 of 13 Contents 1. Introduction... 3 2. Features... 3 3. Physical Specification... 3 3.1. JP7... 3 3.2. Control Interface... 4 3.3. Serial

More information

MeterBuilder MB-1 PROGRAMMABLE RF POWER METER. CIRCUIT DESCRIPTION Version 1.01 June 2011

MeterBuilder MB-1 PROGRAMMABLE RF POWER METER. CIRCUIT DESCRIPTION Version 1.01 June 2011 MeterBuilder MB-1 PROGRAMMABLE RF POWER METER CIRCUIT DESCRIPTION Version 1.01 June 2011 Patent and Copyright Notices Patent Applied For Copyright Material in this document copyrighted 2011 FullWave, LLC.

More information

Release Note. How to Use the OptoCon Connection Module. 1 Introduction. Option C Revision 4 Revised 8/13/98

Release Note. How to Use the OptoCon Connection Module. 1 Introduction. Option C Revision 4 Revised 8/13/98 33 South La Patera Lane Santa Barbara, CA 93117-3214 ph (805) 681-3300 fax (805) 681-3311 tech@motioneng.com www.motioneng.com Release Note How to Use the OptoCon Connection Module Option C002-0007 Revision

More information

TXM1.8U TXM1.8U-ML. Universal modules TX-I/O

TXM1.8U TXM1.8U-ML. Universal modules TX-I/O 8 173 TX-I/O niversal modules TXM1.8 TXM1.8-ML Two fully compatible versions: TXM1.8: 8 inputs/outputs with LED signal / fault indication TXM1.8-ML: As TXM1.8, but with additional local override facility

More information

Rapid28iXL PIC Prototyping PCB User Manual

Rapid28iXL PIC Prototyping PCB User Manual Description Features This is a PCB designed to facilitate the rapid prototyping of a device based on a 28 pin Microchip PIC microcontroller. To allow users to focus on their application, we take care of

More information

Home Security System with Remote Home Automation Control

Home Security System with Remote Home Automation Control Home Security System with Remote Home Automation Control Justin Klumpp Senior Project Hardware Description Western Washington University April 24 2005 Professor Todd Morton Introduction: This document

More information