analog circuit to divide two currents - Page 1
Forum section: electronics / beginners

author: KTP
author_rank: Frequent Contributor
timestamp: October 14, 2010, 01:27:13 am
content: So say I wanted to build a demonstration circuit that would graph the beta (Ic/Ib) of a bipolar transistor vs the collector current (Ic). I could fix the collector voltage with a regulator at, say 3V, and have a small series resistance the voltage across which would represent my collector current. I could then sweep the base resistor with a ramp voltage going from 0 to 3 volts and measure the voltage across the base resistor to represent the base current. Further say I scale these with amplifiers such that 10mV represents 1mA of current or some such factor.Now, I am kind of stuck on how to generate a voltage to represent Ic/Ib such that I can feed this and the voltage representing Ic into the oscilloscope in x-y mode and get the plot I want.I remember there is an op-amp circuit using a common base transistor in the negative feedback path to generate a negative logarithm of the input voltage, but I think it would greatly depend on the saturation current and the thermal voltage. Aside from that, I guess two of these circuits fed into a subtractor and then a anti-log circuit would give me what I want? (going on the premise that x/y = e^(ln(x)-ln(y)) if me maths is still rememebered).Totally stupid and not the way to go about getting an analog version of x/y? Thanks for any help.

author: Simon
author_rank: Unknown
timestamp: October 14, 2010, 06:03:04 am
content: surely just imputting the base voltage to one channel and the collector voltage or the voltage across the collector resistor will achieve it ? why do you want to transform voltage to current and back to voltage, you may need a diff amplifier to get the collector resistor voltage but having a fixed supply the collector will take up the rest anyhow and be referenced to ground. you might want to amplify the voltages to get the scales you want but thats all

author: KTP
author_rank: Frequent Contributor
timestamp: October 14, 2010, 01:33:55 pm
content: Quote from: AcHmed99 on October 14, 2010, 10:49:29 amNo, that is the IV relationship...I already know how to do that.Here is a much simpler explanation of what I would like to do real time, with an analog circuit:Vertical axis of plot: Ic/IbHorizontal axis of plot: Ic

author: KTP
author_rank: Frequent Contributor
timestamp: October 14, 2010, 03:59:13 pm
content: A little more digging around and decided that yes, analog division can be done with discrete op-amps but it is messy.A better way would be to include something like the AD633 4 quadrant multiplier in the feedback path of an op-amp to get Vout = V1/V2. Unfortunately I can't find a AD633 in my parts bin of scrap analog boardsPerhaps at low frequencies it would be easier just to ADC -> Microcontroller division -> DACI really was interested in the analog discrete solution though...

author: Simon
author_rank: Unknown
timestamp: October 14, 2010, 04:31:56 pm
content: DON'T use an MCU to do the job, you looking at 10 bits in and 10 bits out with at least a +/-1 bit error at each conversion so up to 2 bits error (in theory, if you check the specs possibly worse), I don't know what analogue error would be like but get a gut feeling that by the time you have done it with the MCU you might as well do it with analogue which will respond much better

author: jimmc
author_rank: Frequent Contributor
timestamp: October 14, 2010, 04:49:49 pm
content: Quote from: KTP on October 14, 2010, 03:59:13 pmTry log, subtract, antilog approach.Seehttp://www.national.com/an/AN/AN-30.pdffig 5Jim

author: Zero999
author_rank: Super Contributor
timestamp: October 14, 2010, 05:59:10 pm
content: Quote from: Simon on October 14, 2010, 04:31:56 pmIf that's true, a MCU is better than the AD633 analogue multiplier which has an accuracy of 2%, a 2-bit error in 10 bits is 1/512 <0.2%http://www.analog.com/static/imported-files/data_sheets/AD633.pdfEven an 8-bit ADC has a better than the AD633. The question is getting an MCU which is fast enough to process the maximum frequency of interest but note the price of the AD633 vs how much processing power you can get for the same price.

author: Simon
author_rank: Unknown
timestamp: October 14, 2010, 06:03:03 pm
content: yea I've not looked in depth at the two options, the 2 bits is theoretical, it would depend on the specific device, speed would be a problem and is 1/512 of the full scale sufficient resolution ? analogue with give practically infinite resolution, digital will not

author: KTP
author_rank: Frequent Contributor
timestamp: October 14, 2010, 06:13:34 pm
content: yes, I think Hero999 is correct in that a microcontroller solution is cheaper and maybe more accurate than using the analog solution of a AD633 and op-amp.Since what I really want is a dc operating point graph of beta (Ic/Ib) vs collector current (Ic) and I am using the oscilloscope in X-Y mode, I probably can get away with a fairly slow division if my ramp input to the base of the transistor DUT has a small dv/dt. Even 10K divisions per second would probably allow me to view a reasonable representation of Ic/Ib vs Ic on the scope.jimmc: If you go back and read my first post, I had orginally said I knew the log, subtract, antilog approach would work, but thanks for the link to that pdf as I had not seen it before. You can see though how if you implement all of the required circuits in that link it would be really messy (especially if you are breadboarding it).This is all extra stuff I am doing, the lab we are required to do wanted a hand drawn graph of Ic/Ib vs Ic taken by 100 measurements with a multimeter while varying the base current and holding the collector at 3V. I like to try and automate tests like this for fun.What I really need for my lab experiments is a little board with 4 ADC inputs accepting -10V to +10V range, perhaps with some sort of autorange mechanism and 4 DAC outputs with -10V to +10V range, source/sink 100mA, 10uS or so settling time. Perhaps a trigger input/output also. USB interface would be swell. Does such a little board exist?

author: Bored@Work
author_rank: Super Contributor
timestamp: October 14, 2010, 06:43:44 pm
content: Waitaminute ...... to see what I think you would like to see, you would have to vary Ic over approximately a factor of 10^5 for a small signal transistor, from 1 µA to 100 mA. To display such a range you need a logarithmic scale on the horizontal axis.Ic/Ib approximately varies by a factor of three over this range. In other words, the variation of Ib, is in the same order of magnitude as Ic, 10^5. If you want to do the math with OpAmps you have to deal with an awfully large dynamic input range.It is also not simple with an MCU. 10^5 means at a minimum a 17 bit DAC for signal generation and a similar or better ADC for measurement to go over the range, assuming perfect devices, and no noise.Pencil, paper and two good multimeters might be a simpler way to get the curve.

author: KTP
author_rank: Frequent Contributor
timestamp: October 14, 2010, 06:52:20 pm
content: Quote from: BoredAtWork on October 14, 2010, 06:43:44 pmYes, that is about right. Some of the analog multipliers have a 5 decade range, so possibly could plot from 10uA to 100mA?I was thinking about sweeping the base with a log ramp with the assumption that this would make Ic (the horizontal axis) a log representation. My function generator can do this....maybe this wouldn't work...have to think about that a second...it *seems* like it would work.I know, I know, pencil, paper and my Fluke 289 would make quick work of this problem...but hey, what if you wanted to view this curve for 200 different parts? Then my ideas might not look so silly!

author: Bored@Work
author_rank: Super Contributor
timestamp: October 14, 2010, 07:25:37 pm
content: Quote from: KTP on October 14, 2010, 06:52:20 pmIt won't work. The oscilloscope works linear. If you give it 1V input the trace moves to the 1V position. If you give it 5V input it moves to the 5V position. It doesn't matter if the 1V or 5V are on a logarithmic curve. The curve shape just determines how fast or slow you move along the axis.You need a logarithmic amplifier or an exponential amplifier.

author: Zero999
author_rank: Super Contributor
timestamp: October 14, 2010, 08:08:40 pm
content: I think BoredAtWork is right regarding the dynamic range of the signal, I didn't think of that so yes, I think a log amplifier is the best way to go.Just a couple of points regarding the digital solution, for purely educational purposes of course:For optimum accuracy, the DAC should have twice as many bits as the ADC because 2552= 65025 which requires 16 bits.For an extra bit of accuracy a full wave precision rectifier and zero crossing comparator can be used before the ADC and a switched inverting/non-inverting amplifier used after the DAC but it's probably not worth it as you'd need low offset op-amps and precision resistors so you don't loose the bit of accuracy gained by it.Of course all of the above points are mooted by the one about dynamic range.

author: KTP
author_rank: Frequent Contributor
timestamp: October 14, 2010, 08:33:50 pm
content: Quote from: BoredAtWork on October 14, 2010, 07:25:37 pmIR confused. If the input to a linear equation (Ic = beta*Ib) is a log function, then wouldn't the output of the equation also be a log function?let me play around with this a bit in LTspice and get back to you. Thanks.

author: KTP
author_rank: Frequent Contributor
timestamp: October 14, 2010, 09:42:51 pm
content: Ok, it took quite a bit of time to figure out how to make the LTspice B type sources obey me, but in the end I prevailed!(I found a link to all of the different functions LTspice supports in arbitrary sources (the B types). I wanted 10^x but had to implement it as pow(10,x)Anyway, here is a screenshot of the simple LTspice circuit. I have generated a exponential (base 10) current into the base of the 2n2222 which ranges from .1uA to 1mA over a period of 1mS in the fashion I think I wanted. (You can see this in the plot of IB1 on the graph).A plot of Ic/Ib shows a beta that is smaller at low currents and high currents, which I believe is correct. I think there may be a simulation error or a model error in the 2n2222 at really low currents because the beta starts off higher then dips instead of starting off at the low value.Anyway, this would tend to support my idea of pumping the base with an exponentional current in order to display log values on a linear scale (the horizontal scale is linear in the picture).

author: allanw
author_rank: Frequent Contributor
timestamp: October 14, 2010, 09:04:19 pm
content: An easier way to do that would have been to use DC sweep analysis on the current source. It can do decade plotting.

author: jimmc
author_rank: Frequent Contributor
timestamp: October 15, 2010, 10:37:13 am
content: Quote from: KTP on October 14, 2010, 06:13:34 pmIt does annoy me when people post without reading the whole thread first, and now I've done it myselfsorry KTP.The closest device I know of for your experiments ishttp://labjack.com/u12The good...# 8 Single-Ended, 4 Differential 12-Bit Analog Inputs# ±10 Volt Analog Input Range# PGA with Gains of 1, 2, 4, 5, 8, 10, 16, or 20 V/V# Up to 8 kSamples/Sec (Burst) or 1.2 kSamples/Second (Stream)and the bad...# 2 Analog Outputs. Each analog output can be set to a voltage between 0 and the supply voltage (+5 volts nominal) with 10-bits of resolution. The analog outputs are controlled in command/response mode at up to 50 Hz per channel.Output current is nowhere near 100mAJim