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.