# Integrator Circuit Issue

#### #12

Joined Nov 30, 2010
18,222
I keep seeing this as a voltage driving a proportional current generator. Problem for me is that the accumulating capacitor is always inside the feedback loop (no end grounded). I suppose one could take that information to a differential amplifier in the following stage.

#### dl324

Joined Mar 30, 2015
12,871
Ok I understand the problem, the charging current should be directly proportional to the input voltage.
Ic = Vin/ R.
This is what I came up with:

Vin sets current in Q1. R3 sets current in Q2 to be equal to current in Q1.

#### Eoin_oc

Joined Oct 24, 2015
23
This is what I came up with:
View attachment 93426

Vin sets current in Q1. R3 sets current in Q2 to be equal to current in Q1.
I will try this and let you know how I get on, could I use FET transistors in place of those BJTs?

#### dl324

Joined Mar 30, 2015
12,871
I will try this and let you know how I get on, could I use FET transistors in place of those BJTs?
Yes, but you'll need to employ the usual techniques to avoid oscillations with capacitive loads.

#### crutschow

Joined Mar 14, 2008
27,232
Here's a circuit that generates a current proportional to the positive input voltage into a grounded cap to provide the integrate function.
The circuit uses a differential connection op amp with its input referenced to the plus supply along with a P-MOSFET to generate a current to a grounded load.
The LTspice simulation below shows that it only integrates on the positive half of the input sine-wave.
You will need to add a switch to ground the cap and reset it for the next measurement.

#### Attachments

• 2 KB Views: 2
Last edited:
#12

#### crutschow

Joined Mar 14, 2008
27,232
As an alternate circuit (offset not sensitive to resistor values), below is the simulation of dl324's circuit using MOSFETs.
I had to change to a rail-rail input and output op amp since the the common-mode range of the LM358 only goes to within about 1.5V of the positive rail.

#### Attachments

• 2.1 KB Views: 1
Last edited:

#### Eoin_oc

Joined Oct 24, 2015
23
Here's a circuit that generates a current proportional to the positive input voltage into a grounded cap to provide the integrate function.
The circuit uses a differential connection op amp with its input referenced to the plus supply along with a P-MOSFET to generate a current to a grounded load.
The LTspice simulation below shows that it only integrates on the positive half of the input sine-wave.
You will need to add a switch to ground the cap and reset it for the next measurement.

View attachment 93428

Which resistor is used here to set the current that flows into the capacitor?
Is it Rsense? I would like for a capacitor of around 1uF to charge up to 3.5V in 100ms with a constant 3.5V input level.

Last edited:

#### PeterCoxSmith

Joined Feb 23, 2015
148
You could use a v/f converter and a counter to do the integration. You could even design a non-volatile counter if the power goes off.

#### JamesBond007

Joined Oct 25, 2015
24

this has always worked like charm for me.
the effect of the diode in the emitter stops any current leaking out of the cap.

#### crutschow

Joined Mar 14, 2008
27,232
Which resistor is used here to set the current that flows into the capacitor?
Is it Rsense? I would like for a capacitor of around 1μF to charge up to 3.5V in 100ms with a constant 3.5V input level.
Yes, Rsense is one resistor that sets the flow.
For 3.5V out in 100ms for a 3.5V input requires an integrator time-constant of 100ms.

That time-constant with 1μF will give an offset problem with the circuit in post #25 so you would need to use the one in post #26, modified as shown here.

#### crutschow

Joined Mar 14, 2008
27,232
View attachment 93483
this has always worked like charm for me.
the effect of the diode in the emitter stops any current leaking out of the cap.
To get an integration, you need a constant current source into a capacitor.
Your circuit has an emitter follower feeding the capacitor, which has a constant voltage output.
It does not provide the integrate function.

#### JamesBond007

Joined Oct 25, 2015
24
Now you seem to be describing a peak detector...
As a peak detector, this works perfectly.

#### dl324

Joined Mar 30, 2015
12,871
As a peak detector, this works perfectly.
The resistor would discharge the cap and it isn't clear how the diode drop is being compensated.

#### Eoin_oc

Joined Oct 24, 2015
23
You could use a v/f converter and a counter to do the integration. You could even design a non-volatile counter if the power goes off.
This is a perfect solution for me! I will then feed the Frequency output to a counter and simply read that

#### crutschow

Joined Mar 14, 2008
27,232
As a peak detector, this works perfectly.
It doesn't compensate for the base-emitter voltage drop so I would say it's less than perfect.
And the OP wants an integrator, not a peak detector.

#### JamesBond007

Joined Oct 25, 2015
24
Are we summing (integrating) the current or the voltage ?

#### crutschow

Joined Mar 14, 2008
27,232
Are we summing (integrating) the current or the voltage ?
It's a voltage that represents a current.

#### JamesBond007

Joined Oct 25, 2015
24
OK. What is summation (integration) ?
The addition of all values of a variable (voltage) over a period of time.
Integration is: over some time, a voltage is sampled at infinitely small periods of time, and measurements are taken over such a short period of time that they are equivalently zero, yet multiplying these infinity small and discrete sums over an infinite time frame (according to Newton), gives us a finite value.