Power SuppliesSensors - Tranducers Circuits

An Isolated Analog Input Module Schematic Circuit Diagram

An isolated analog input module presented here is particularly suitable for industrial electronics applications. Sending analog signals from field sensors over long-distance cables is often difficult because the signals can be influenced by unwanted noise from various sources and by ground potential differences within the loop. One proven method to avoid these cumbersome troubles is to provide a complete isolation from the field. My solution is a voltage-to-frequency (V-F) converter circuit with reliable galvanic isolation at its output. At the heart of the design is an inexpensive yet versatile V-F converter, the LM331 IC from Texas Instruments (www.ti.com).

Circuit description

An Isolated Analog Input Module Schematic Circuit Diagram

Voltage-to-frequency converter module circuit

The circuit shown above is a basic voltage-to-frequency converter. It uses an LM331 (IC1) V-F converter and a 4N25 (OK1) optocoupler (www.vishay.com) as the galvanic isolator. With the power supply voltage set to 15 V, the input range is 0 to 10 V. Resistor R6 sets the drive current for 4N25, but it can be altered within the safe current limits of the 4N25 and the LM331. The waveform driving the output can be seen at point TPF. My design (tested with KA331) is, in fact, a mere adaptation of an application example found in the LM331 datasheet, published by TI.

Refer to the LM331 official datasheet for more complex circuits with higher accuracy and/or faster response time. Note that the frequency goes from approximately 20 Hz at 0-V input to 10 kHz at 10-V input, and the duty cycle also changes as the input voltage changes (see random scope traces). The multiturn trimpot (RP1) should be set so that the duty cycle does not fling to 0% or 100% at the input extrema.

Next is the hardcopy of two random scope traces (just as a reference), caught while fiddling with my breadboard prototype (see the succeeding image). At first, the experiment was conducted with a green LED (with its current limiter resistor) in lieu of the optocoupler component, wired to observe what’s actually taking place there on that point.

An Isolated Analog Input Module Schematic Circuit Diagram 2

Scope trace

Breadboard experiment

Breadboard experiment

Application info

  • For improved performance, all of the components should be stable low-temperature-coefficient components, such as metal-film resistors and capacitors with low dielectric absorption.
  • For an optional offset adjustment add-on circuit, refer to Page 12 of the official LM331 datasheet (SNOSBI2C — JUNE 1999 — REVISED SEPTEMBER 2015).
  • For proper operation, the supply pin should be bypassed to ground with a 1-µF, low-ESR–type capacitor. The bypass capacitor must be placed as closely as possible to the supply pin.
  • Use of a ground plane is highly recommended to provide a low-impedance ground across the circuit. Refer to Page 18 of the datasheet to learn more about PCB layout guidelines.
  • You should need a stable lab power supply, a frequency counter, and an oscilloscope for testing/evaluating the circuit. Remember, a breadboard prototype is very sensitive to the electrical grid noise (50/60 Hz) in most situations.
  • The optocoupled output of the V-F converter can be used as an analog input for a microcontroller (such as Arduino) for further treatment of the available signal.

Arduino trial

Arduino can measure frequency in more than one way. However, the simplest method is the use of the pulsein() function for period measurement. This method twice uses the function pulsein() to measure the high time and low time of the signal (with a microsecond resolution).

Now we can use the “Arduino Frequency Counter Library,” which makes it possible to measure frequencies with a high resolution and accuracy. In this library, the frequency input is fixed to Digital Pin 5 (D5) as this pin is mapped to the alternate port function T1, which is the input 16 Bit Hardware Counter1. The “FreqCounter” library can be downloaded as a zip file from here: http://interface.khm.de/wp-content/uploads/2009/01/FreqCounter_1_12.zip. For more details, visit http://interface.khm.de/index.php/lab/interfaces-advanced/arduino-frequency-counter-library/.


A simple example code for you (see my serial monitor window as well):

#include <FreqCounter.h>

/*This library uses Timer/Counter1 for counting pulses on rising edge of D5

& Timer/Counter2 for the gate-time generation with 1 ms interrupts*/

void setup() {


Serial.println("Frequency Counter");


long int frq;

void loop() {

FreqCounter::f_comp= 0; //compensation 0

FreqCounter::start(1000); //gate time 1000mS

while (FreqCounter::f_ready == 0)

frq=FreqCounter::f_freq; //read

Serial.println(frq); //print



An Isolated Analog Input Module Schematic Circuit Diagram 3

Serial monitor window

Analog fiber optics

The introduced circuit can be used to transmit an analog DC voltage over a plastic fiber cable, too! Just substitute the optocoupler in the circuit with a light-sender component and rig up the receiver module with another LM331 (plus a light-receiver component) as the frequency-to-voltage converter (F-V). A reference for the circuit diagram of such a compatible LM331 F-V converter is also included here (thanks to www.i-fiberoptics.com). For the light-sender part, you can use IF-E96E, and IF-D92 will be a good choice for the light receiver.

An Isolated Analog Input Module Schematic Circuit Diagram 4

IF-E96E – https://www.digikey.com/product-detail/en/industrial-fiberoptics/IF-E96E/FB162-ND/3461614

IF-D92 – https://www.digikey.com/product-detail/en/industrial-fiberoptics/IF-D92/FB121-ND/243778

An Isolated Analog Input Module Schematic Circuit Diagram 5


Related Articles

Leave a Reply

Your email address will not be published.

Back to top button