Back to main page

Hardware and Software

All hardware designs and software files on this page are open-source (Creative Commons Attribution 3.0 licensed).



Excel spreadsheets



CAD files


Pulse-Width Modulation (PWM) printed circuit board

Used to convert a 4-20 mADC or 1-5 VDC analog signal into a PWM signal of proportional duty cycle. Useful for controlling heaters, DC motors, and other electrical final control elements with standard analog instrumentation signals. Be careful to note the orientation of the two integrated circuits on the PCB layout: they face opposite directions!

The board is sized (with two screw holes) to precisely fit on the front of a standard 4 inch by 4 inch plastic electrical switch/receptacle box for easy and secure mounting.


Signal conditioning printed circuit board

Used to marshall 24 VDC power to 2-wire (loop powered) transmitters, converting this 4-20 mA current signal into a calibrated 1-5 VDC voltage signal suitable for input into various controllers, PLC analog inputs, and data acquisition modules. The PCB furnishes a diode for convenient current measurement, as well as enough power dissipation capability (ten 1000 ohm 1/4 watt resistors) to safely withstand the thermal effects of a shorted field transmitter. It also provides over-voltage input protection in the form of a zener diode.

The board is sized (with two screw holes) to precisely fit on the front of a standard 4 inch by 4 inch plastic electrical switch/receptacle box for easy and secure mounting.


Analog PID controller printed circuit board

Implements full Porportional-Integral-Derivative control in analog form, using two quad operational amplifiers. The biggest design weakness of this controller is that it requires the use of non-polarized capacitors for both integral and derivative control actions, which can be challenging to achieve long time constants for either I or D action when most non-polarized capacitors have rather modest capacitance values. The assembled photograph, in fact, shows an unwieldly array of mylar capacitors needed to achieve a modest reset (integral) time.

The PCB sports a large prototyping area to support other circuitry, such as voltage/current converters (needed for 4-20 mA output), PWM oulse output circuitry, and the aforementioned large capacitor arrays.


4-20 mA servo driver circuit board

This circuit allows the use of cheap RC (radio-control) servo motors as electric valve actuators, by driving the servo motor according to a 4-20 mA DC analog command signal. The circuit was designed by an Instrumentation student (David Polson) to use a quad LM324 operational amplifier chip and operate on a split +5/-5 volt DC power supply. It features an adjustable deadband to prevent servo ``hunting'' as the shaft position nears the target value. The design is courtesy a former student of mine, David Polson.

Some ``surgery'' is necessary on the servo to connect it to this circuit. This circuit completely bypasses the circuitry inside a typical servo, directly sending power to the DC motor and reading shaft position from the servo's potentiometer.


PID control program for Allen-Bradley (Rockwell) MicroLogix 1100 PLC

The Allen-Bradley MicroLogix 1100 PLC has its own PID instruction, but this program includes all the necessary scaling functions, conditional instructions, and other features to make it robust. It also provides the means for interface with non-Rockwell interfaces (e.g. Automation Direct C-More HMI panels) by using generic N7 integer file registers for PV, SP, Output, tuning parameters, etc. rather than PD PID file registers which may not be readable or writable by non-Rockwell devices. The program assumes the use of the model IF2OF2 dual-channel analog input/output expansion card, and provides dual PID loops accordingly. Download the program here.


PID control programs for Automation Direct "CLICK" PLC

Full PID program for the "CLICK" PLC PLC (with analog I/O) and a graphic layout for the 3 inch C-More Micro HMI panel

A wiring diagram showing how a "CLICK" PLC may be configured for convenient wiring of loop-powered transmitters, complete with protective elements.


Home-built PLC "trainer" unit

A "trainer" unit is indispensable for learning PLC programming. All you need to build one is a PLC, a set of on/off switches to drive discrete signals into the PLC's input channels, and the appropriate power and communications cables. The example shown here was constructed from recycled building materials (a wooden base plate and some used household light switches), using an Allen-Bradley MicroLogix 1000 PLC.

Note the use of terminal blocks to marshal wires between the switches and the PLC inputs, and also between the PLC outputs and any (future) output devices such as lamps and small motors. By using terminal blocks, the PLC's screw terminals are spared the wear and tear of re-making wire connections between the PLC and any optional input/output electrical devices.


Small-scale AC power grid for protective relay instruction

This was a very large student-built project I led during the summers of 2014 and 2015. The purpose of having a miniature AC power grid in our lab was to demonstrate three-phase AC power systems on a scale that was safe (each generator only capable of a couple hundred watts power output) and relatively inexpensive, as well as a test bed for the installation, configuration, and testing of protective relays.

In 2014 we constructed six motor-generator sets, each one consisting of a 24 volt Delco-Remy alternator belt-driven by a three-phase induction motor powered through a VFD for variable speed control. These generator sets were equipped with their own three-phase step-up transformer banks to raise the generator output voltage to suitable levels, CTs to measure line current, a "circuit breaker" consisting of a three-pole motor contactor and associated relays for latching operation, and a protective relay (50/51 overcurrent) to automatically trip the circuit breaker in the event of excessive output current. When completed, we paralleled all the generators to each other using extension cords and terminal blocks, then practiced synchronizing them to each other using neon lamps as sync lights connected across the circuit breaker contacts for each generator. A PLC installed in each control panel provided starting and stopping control of the driving motor, as well as manual speed control.

In 2015 we constructed two substations, each one having five circuit breakers designed similarly to the circuit breaker assemblies (three-phase motor contactor plus a pair of ice-cube relays) built for the previous year's generator skids. Each of these circuit breakers was equipped with green and red indicator lights for status, plus six CTs (three line, three load) to drive all meter and relay inputs. These circuit breakers all had banana-jack style connectors for the three-phase power, meaning we could interconnect them in any bus configuration desired using banana-jack style plugs and jumper cables. A bank of CT test switches marshalled all CT wiring to the protective relays, while a set of L-handle circuit breaker control panel switches gave manual control over each breaker. A PLC installed in each substation control panel provided remote (``SCADA'') control over each circuit breaker.

A couple of photographs show one of the completed substations: Front panel and Circuit breakers.


"caSCADA" data acquisition and control system

This is a SCADA design based on any personal computer running the Linux operating system, using Modbus/TCP to communicate to all I/O. It is optimized for low processor and memory load, which means it runs quite well on miniature systems such as the Raspberry Pi. The default I/O for this control system is the LabJack model T7 data acquisition unit, providing 14 channels of analog input and 2 channels of analog output, and which happens to support Modbus/TCP communication for approximately $400 apiece.

The following "TAR" archive file contains all the source code for building all applications within the caSCADA suite. This includes the "poll" (measurement only) and "pid" (closed-loop control) executables, as well as a PID simulator ("looptune") and a Modbus probing utility ("modprobe"). The entire project is Makefile-driven, with instructions on how to compile found in the "README.txt" file. A "CHANGELOG.txt" file documents all updates with calendar dates and version numbers.