# Integrator Circuit Issue

#### Eoin_oc

Joined Oct 24, 2015
23
Hi all,

I need a single supply integrator circuit that will accumulate charge on a capacitor as long as any positive voltage is supplied at the input.
If the input goes below the current capacitor voltage, current should flow back out of the capacitor toward the input.
Basically if any voltage is present at the input the cap should continue charging (assuming there's enough voltage room in the supply)

Eoin

#### dl324

Joined Mar 30, 2015
16,732
What will this be used for? You'll get more feedback if you show your circuit ideas.

#### Eoin_oc

Joined Oct 24, 2015
23
It will be used a for a current meter, it will basically accumulate the voltage across a sense resistor (it is buffered)

#### Eoin_oc

Joined Oct 24, 2015
23
Sorry sorry, i meant to say current should not flow back towards the input! It will be used for a current meter, the input voltage will be from a buffered sense resistor

#### Eoin_oc

Joined Oct 24, 2015
23
I had a typo in my orginial post, the voltage on the cap should never decrease, only increase, a standard single resistor and cap integrator wont seem to do this for me.

#### dl324

Joined Mar 30, 2015
16,732
Current is usually sensed with a resistor.

#### dl324

Joined Mar 30, 2015
16,732
I had a typo in my orginial post, the voltage on the cap should never decrease, only increase, a standard single resistor and cap integrator wont seem to do this for me.
Now you seem to be describing a peak detector...

#### Eoin_oc

Joined Oct 24, 2015
23
Thanks for that piece of information, irrespective of where this voltage is coming from, the circuit I need should continue charging a capacitor as long as an input voltage is present at the input, the voltage should never decrease on the cap.
Even if the current voltage on the cap is 5V and there is only a few mV present at the input, the cap should continue charging up.

#### dl324

Joined Mar 30, 2015
16,732
Should the charging current for the cap be constant or depend on the input voltage?

Seriously, if you post circuit and your ideas, it won't seem so much like some tedious guessing game.

#### Eoin_oc

Joined Oct 24, 2015
23
It should depend on the input voltage, I had a quick look and I think a peak detector is similar to what I need, but the voltage should keep increasing.
This is just a prototype for now I don't even have a schematic. Is there anyway around the diode drop of a normal peak detector?

#### #12

Joined Nov 30, 2010
18,224
Is there anyway around the diode drop of a normal peak detector?
It's called a precision rectifier.
It's an op-amp circuit.

#### dl324

Joined Mar 30, 2015
16,732
It should depend on the input voltage, I had a quick look and I think a peak detector is similar to what I need, but the voltage should keep increasing.
This is just a prototype for now I don't even have a schematic. Is there anyway around the diode drop of a normal peak detector?
But a peak detector will only charge the capacitor if the input voltage is higher than the cap voltage.

#### Eoin_oc

Joined Oct 24, 2015
23
Ok, any other circuits that will keep charging but have the non-discharge properties of the peak detector?

#### dl324

Joined Mar 30, 2015
16,732
It's called a precision rectifier.
It's an op-amp circuit.
Or put the diode in the feedback loop.

#12

#### dl324

Joined Mar 30, 2015
16,732
Ok, any other circuits that will keep charging but have the non-discharge properties of the peak detector?
See post #9.

Are you concerned with capacitor leakage?

#### Eoin_oc

Joined Oct 24, 2015
23
See post #9.

Are you concerned with capacitor leakage?
Small leakage of the cap itself is fine, so no it will not be in an issue

#### dl324

Joined Mar 30, 2015
16,732
You still haven't stated how the charging current should, or shouldn't vary with input voltage.

#### Eoin_oc

Joined Oct 24, 2015
23
It should depend on the voltage, I already stated this in post #10

#### dl324

Joined Mar 30, 2015
16,732
Even if the current voltage on the cap is 5V and there is only a few mV present at the input, the cap should continue charging up.
For this situation, a few mV would not cause a capacitor already charged to a higher voltage to continue to charge. You need to define how capacitor charging current is to be determined.