# Opamp, diode as a feedback

Discussion in 'General Electronics Chat' started by Xufyan, Aug 30, 2011.

1. ### Xufyan Thread Starter Member

Aug 3, 2010
114
0
like we connect capacitor for Integration and Differetiation , thats ok but When we connect diode as a feedback in operational amplifier how it takes the logarithm of input signal ??

can anybody explain the derivation ?? or link me to it?

i m n00b

Jul 17, 2007
22,183
1,728
3. ### Xufyan Thread Starter Member

Aug 3, 2010
114
0
This is quite good..thnks
however what are the constants doing there ?

like if we calculate logarithm of 2 then its 0.30

but if we calulate it through the derived equation , its 0.150 (if R=100k, Is = 50nA, and 0.025)

why this difference ??? please explain

4. ### steveb Senior Member

Jul 3, 2008
2,433
469
The parameters Is and Vt are part of the transistor physics. Actually, they are not really constant but depend very strongly on temperature. The parameter R, which is very nearly constant with temperature changes (relatively speaking), is easily changed. So, for a given temperature (held constant), you can scale IsR as needed, and the Vt you can scale by putting an amplifier or attenuator in front of the stage.

Basically, if you need a pure natural logarithm, you can make it act that way. Or, if you want a base 10 or base 2 logarithm, you can do that too. But often, the scaling is arbitrary, or definable as needed, and it isn't necessary to make precise mathematically perfect functions.

Note that because of the temperature dependence, that simple circuit is not practical at all. There are better circuits, but even these need to be implemented with all transistor on one integrated circuit chip so that temperature is nearly equal for all devices, hence allowing compensation techniques to be used.

5. ### Xufyan Thread Starter Member

Aug 3, 2010
114
0
Ofcourse i can vary 'R' but what about thermal voltage and reverse current ? the reverse current is in nano meter , but how to keep such value of thermal voltage that give accurate log of input voltage ?
like , log of 2 is 0.300 but according to multiSIM ITS DIFFERENT, how to set the values of Vt and Is in multisim ?? and how to set them practically for accuracy ?
is Vt 25mV in multisim ???

2nd question,
the second question , the circuit will only work for the positive half of the cycle if i want to make it work for a complete cycle can i connet a reverse diode in parallel with the forward diode ?

Last edited: Sep 1, 2011
6. ### steveb Senior Member

Jul 3, 2008
2,433
469
Since R is multiplied by Is, then R is the way to control Is, effectively. Within limits, you can scale the value of Is to the voltage you need from RIs which scales the input voltage Vin.

As far as scaling Vt, I told you the wrong thing in my previous post. The scaling of Vt can be done by putting an amplifier or an attenuator on the output after the log amp stage. Above I mentioned to do this on the input, but scaling the input voltage is similar to scaling the resistor R. So, that was wrong and the correct way is to scale the output.

Vt is given by KT/q, where K is Boltzmann's constant, T is temperature in Kelvin and q is the magnitude of electron charge. K and q are truly constants, but T is variable. So, the value that Multisim uses for Vt depends on the temperature you assume in the simulations.

Yes, you can do that, but keep in mind that you are not being mathematical if you do that. For example ln(1)=0, but ln(-1)=i*pi. Or, more generally, ln(-x)=ln(x)+i*pi. This is an esoteric point and may or may not be a problem, but you seem intent on trying to make a proper natural logarithm function, rather than just a logarithmic scaling conversion, as is more typical.

I have to stress again that that circuit is not practical, so this is a bit of an academic discussion, which is no problem, as long as you understand that.

Xufyan likes this.
7. ### Xufyan Thread Starter Member

Aug 3, 2010
114
0
Thanks alot Friend, great explanation