This circuit handles both 0 to 10V and 0- to 20-mA inputs, and digitises the inputs and feeds a low-cost microcontroller.
Designers typically utilise 0- to 20-mA, 0 to 10V isolated inputs for industrial-application-control signals. A combination of isolated supplies, the built-in isolation of an Analog Devices AD7400 sigma-delta modulator, and a Texas Instruments MSP430 microcontroller creates a design for industrial designers requiring complete, isolated, and robust analogue-signal interfaces. A precise signal-conditioning circuit generates the small differential voltage that the AD7400 requires (figure 1). The circuit generates the required 200-mV differential voltage. For clarity, the figure omits over-voltage diodes and protection circuits.
__Figure 1: __This simple ac-mains voltage monitor’s output is a square wave whose width is proportional to the input-voltage level.
A 0- to 20-mA current loop converts to a voltage through a properly scaled resistor, R2, and enters a precision operational amplifier. The signal level, which connects to the negative input, gets a positive offset by maintaining constant voltage on the positive input of the amplifier. The 0 to 10V signal, such as that from a potentiometer, also scales to a similar voltage to that of the 0- to 20-mA signal and gets summed into the negative terminal of the Analog Devices OP1177 amplifier, IC1. Shifting the signal above 0V results in a signal that is similar to a positive, single-ended analogue signal. A differential ADC-driver amplifier, Analog Devices' AD8138, drives the AD7400. The gain scales such that the resultant signal is within ±200 mV, which the ADC requires. Finally, before connecting to the AD7400, the signal runs through a lowpass filter, which R10, R11, and C4 create between the positive and the negative terminals. The AD7400 converts this differential signal and processes it using a low-cost microcontroller. Sigma-delta-modulator ADCs, such as the AD7400, commonly interface to an FPGA or a DSP. However, this approach comes at a high price in both cost and complexity. For cost-sensitive applications not requiring advanced filtering, you can use a simple microcontroller.
__ Figure 2: __These oscilloscope traces show MDAT, inverted MCLKOUT, and the resulting data stream (courtesy LeCroy).
The AD7400 device has two outputs, MCLKOUT and MDAT (figure 2). MCLKOUT, a 10MHz clock, synchronises the modulated data stream, MDAT. The AD7400 interprets MDAT as a percentage of ones over time. Because MDAT changes only at the rising edge of MCLKOUT, the circuit must AND together MDAT and MCLKOUT to create a stream of pulses that the microcontroller can count. The microcontroller first inverts MCLKOUT to prevent unintentional glitches from being counted at the transition edges of MDAT. The figure shows MDAT, inverted MCLKOUT, and the resulting data stream.
Figure 3: The AD7400 serial ADC digitizes the analog input and feeds the simple, low-cost microcontroller.
The pulsed data signal and the inverted MCLKOUT each feed into a separate timer/counter on the microcontroller (figure 3). The TI MSP430F2274 provides two 16bit counters and can support operation as fast as 16MHz. The circuit measures the ADC value by sampling the data counter when the clock counter signals an overflow interrupt. For this application, running an average number of data measurements on a circular buffer may conveniently filter the data.
This article is a Design Idea selected for re-publication by the editors. It was first published on July 5, 2007 in EDN.com.