# Integrate Your Signals Before Digitizing Them

As an applications engineer for a company making configurable analog products, I occasionally get asked to provide a design to integrate a signal before digitizing it. In many cases, the people doing the asking are interested in the area under the waveform. Sometimes they just want to use the integrator to amplify a very small dc signal. They initially envision a resettable integrator followed by a sample/hold (SH) that feeds a successive approximation register (SAR).

The op-amp circuit in Figure 1 is an inverting integrator. The switch across the feedback capacitor is used to discharge it and zero the output. When the switch opens, the input signal is integrated, and its output is determined by:

1. In a classical integrating ADC, the integrator is held in reset until the signal sample is started. The integration is completed with the capture of the integrated signal.

The output voltage is determined by the values of the input signal, the integration time, and the values of the passive components. For a dc input, this equation simplifies to:

Control signals are required to take the integrator out of reset, capture the value of the integrator’s output, and trigger the analog-to-digital converter (ADC). I immediately show them a simple cost-reducing alteration (Fig. 2). Adding a switch to the input allows it to be disconnected from the integrator. With no more input, the integrator holds the value, and the discrete SH is no longer necessary.

2. The addition of an input switch allows the sample/hold (SH) to be incorporated into the integrator, and the external one can be removed.

Suppose you want to integrate a 20-mV signal for 30 ms. This works out to 600 mV-s. Suppose the ADC has a ±1-V input range. If a capacitor value of 4700 µF is selected, to keep the output within 1 V the resistor must be at least 128 kΩ. Selecting a resistor value of 150 kΩ produces an integrator output voltage, after 30 ms, of:

This fits comfortably in the range of the ADC. At this point, I recommend using a capacitor with low dielectric absorption since 30 ms is a long time to keep a charge on a capacitor. To make sure that some charge isn’t absorbed, use a polyester or polycarbonate capacitor (see “Using Delta-Sigma Can Be As Easy As ADC, Part 2”). So, you have a solution that requires an integrator with an expensive capacitor, a couple of switches, an ADC, and some hardware signals to control it. But there’s a simpler way.

### A Different Approach

Instead of continuing to store the charge on the capacitor, suppose you precisely remove it and keep track of the amount that has been removed. If the input voltage is positive, a current is pushed into the cap and the inverting integrator output goes negative. For a negative output, if a precise amount of charge is pulled out of the cap, then the output moves back toward zero. Do this continuously and no long-term charge is stored on the capacitor, enabling a less expensive capacitor to be used. The circuit in Figure 3 can be implemented with an inexpensive 7XR ceramic capacitor.

3. By monitoring the polarity of the integrator output, it’s possible to push or pull a quantum of charge to move the integrator’s output back toward zero.

As with Figure 2, there is an inverting integrator. However, negative feedback has been added. A positive input causes the output of the integrator to move negative. When below AGND (Vdd/2), the comparator switches low. Latching this value with a flip-flop guarantees that –0.5 Vdd, referenced to AGND, will be applied to the feedback resistor for a fixed time of one period.

A reference of the opposite polarity of the input is fed back to the integrator, causing the output to move back to the center. A negative input causes a positive output on the integrator, in turn causing a positive reference to be fed back. This circuit is still an integrator except now the charge is removed from the capacitor precisely.

Since it is precisely measured, this information can be used to determine the total amount of charge originally placed in the integrator. If you run it for an integration time of “n” cycles of a sample clock (fs), the input will be integrated for n/fs seconds. If DOut is high for “m” of those counts, then a negative reference (–0.5 Vdd) is fed back for a time of m/fs seconds. If DOut is high for m counts, then it must be low for n-m counts, causing a positive reference to be fed back for (n-m)/fs seconds. The output of the integrator is:

By keeping track of the values “n” and “m” and measuring the output of the integrator, you can calculate the average input voltage. Suppose, like before, you want to integrate a 20-mV signal for 30 ms with a 250-kHz sample clock and a 5-V supply. This means you would want to run this integrator for 7500 cycles.

The RC timing value is set so the integrator output, caused by the input signal, moves no more than 1 V. This value is determined by the slew rate limitation of your op amp. Lower the value if your op amp has a lower slew rate, but remember, less gain in the integrator requires more sensitivity in your comparator. Given these parameters, the RC time constant is:

Meet this requirement by setting the integration cap to 47 pF and the input resistors to 1.74 kΩ. The feedback can only change the output by the same amount. Given all the other values, the value of the feedback resistor is determined by:

If the integrator had no feedback and no supply rails, its output after 30 ms would be over 7000 V. With feedback, the integrator’s output voltage is guaranteed to be within ±0.5 Vdd and can be considered an insignificant residue. Knowing this, Equation 4 simplifies to:

This ADC has a usable range of ±20.7 mV. Its resolution is determined by the number of cycles it is operated. Increasing cycles increases resolution. To increase the range, just increase the input resistance. What is really sweet is that since the feedback removes the charge from the capacitor, you don’t have to provide reset circuitry. Figure 4 shows a variable length integrator:

4. By measuring the total number of counts with one counter and those that are high with the other, it’s possible to measure the average input voltage.

With the addition of two counters, it’s possible to measure the total number or cycles as well as the number where the logic output is high. To operate, start the integration and trigger at the desired start time. This trigger will latch the present values of the counters and generate an interrupt. This interrupt will allow your microcontroller to record the values of the two counters. (Call then m0 and n0.) Trigger it again at the desired stop time, and let the microcontroller collect the counts (m1 and n1). The average voltage is:

If you require the area under the curve, just multiply the total number of cycles and the time each cycle takes:

So, it’s possible to digitize an integrated input using only an integrator, a comparator, a flip-flop, a feedback resistor, and a couple of counters. No other ADC is needed, though you may suspect that this is just a delta-sigma modulator (DSM) with a SINC digital filter. A DSM allows more of the signal processing to be completed with simple logic, and it can greatly reduce the cost of your circuitry.

dcschmidt71
on Oct 15, 2012
If you happened to work for McDonald-Douglas Astronautics in the mid-1970's, you may have been familiar with the DRIMS (Digital Redundant Inertial Measurement System) used on the Delta lauch vehicle. Its accelerometers, and perhaps the gyro's, were analog designs whose outputs were fed to analog averaging circuits very much like your examples. This compromised essentially a sigma-delta A/D, with the flight computer doing the signal integration. A satellite could be placed precisely into geo-synchronous orbit with this system.
dubturbo
on May 17, 2013

Thankfulness to my father who told me on the topic of this website, this blog is really amazing.

dubturbo review q1w2e3r4t5

kitapbigi (not verified)
on Apr 6, 2013

This is a bit intimidating. I will be starting with an Associates from a correspondence college that is nationally accredited. (CIE) It seems a bit hopeful that I would be able to get into the field in the 80K salary range even if I graduate with a 3.5-4.0 GPA? My goal is to start my own musical instrument audio equipment company, specifically for guitar and this will occur at least a year before I even attain my associates but obviously I can not bank on that providing an income to live off of. evim şahane

josefclare (not verified)
on Apr 25, 2013

Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a little bit, but other than that, this is wonderful blog. An excellent read. I will definitely be back.
buyer of structured settlement

teddymichael
on May 7, 2013

Electronic circuits that will be read by someone and changed some of the items or components must be concerned about this formula. You can not replace it carelessly. premiumseocompany.com

JackEdison
on May 7, 2013

You should check for the signal. If it's good, then you can using it well.
Seattle Electricians

annabelleslessor
on May 8, 2013

I do not know much about this formula. There are many people who choose to avoid formulas that are very puzzling. One of them was me who was not gifted with the matter. Mule Deer Hunting

AnthurMoon
on May 11, 2013

The integration of the signal sequence is associated with a job that requires concentration. But you will be familiar with the equipment after testing. Safety Equipment Supplies

anthonychou
on May 12, 2013

Electronic circuits it needs a complex formula like this. I think all the people who will come in and learn this formula will change his mind and become reluctant. http://jocelyns.co.id/

on May 15, 2013

It's good for preparing it. So you can use your gagdet better then.
porsche rims

##### Commentaries and Blogs
###### What’s The Reach Of Your Wireless Router?
Posted 1 day ago
in Joe Desposito's Blog
###### Automotive-Safety Design Gears Up For 65nm ARM Cortex MCU
Posted 3 days ago
in London Calling
###### PCIM 2013: Solid state battery is fully implantable
Posted 3 days ago
in Crosstalk
##### Forums

Pick Your Components With Confidence:
"Here are the procedures can help you
make the right choice..."