Maker Pro
Maker Pro

Conversion from [-10,10]V to [0,5]V range

cphus

May 1, 2012
8
Joined
May 1, 2012
Messages
8
Hello,

I need to convert some analog signals from -10,10V range to 0-5V range to interface with a microcontroller. I prototyped something on a breadboard but it did not work well so I modified it and made the attached schematic.

What I actually did is that I reproduced AD628 chip internals using TL082 amplifier. All the values of the components are specified in the eagle file attached. Also, I added a little module to obtain a reference value of 2.5V. Vcc is 5V.

Please have a look and tell me if it looks ok for you. I'm quite a noob in electronics. I understand basic principles but it's not my domain, so I'd appreciate any help and suggestions.
 

Attachments

  • level_converter.sch.zip
    18.6 KB · Views: 114

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
We would have to have the same program as you to be able to see it in the .sch format.

Post am image of the schematic instead. Your program should have a way to export it as an image of some sort.
-tim
 

cphus

May 1, 2012
8
Joined
May 1, 2012
Messages
8
I thought .sch is some general format in layout design software... I use Eagle.
But anyway, here it is the schematic (a modified version).

My problem is actually the power supply for the amplifiers. They receive input from -10 to 10 so I guess their supplied power should cover this area. Or not?
 

Attachments

  • range_converter.png
    range_converter.png
    10.9 KB · Views: 521
Last edited:

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
well the schematic states that Vcc = +5V it also indicates that the opamps are running off that 5V single rail supply

not sure how thats going to work with a +10/-10V signal input... possibly not too well
I would have expected the supply rails for the op-amps to be at least the same or higher than any input voltage.
Am sure some of the experts on here will clarify :)

cheers
Dave
 

cphus

May 1, 2012
8
Joined
May 1, 2012
Messages
8
The thing is, the datasheet for AD628 states that is possible to supply the chips from ±2.25 to ±18 and that it measures voltages up to ±120.

I'd guess this problem is solved by those 82k and 8.2k dividers but I admit I don't exactly know how. If someone thinks he understands how this thing is supposed to work, please enlighten me!

Other suggestions are welcomed also.
 

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
I am just learning opamps, so I was kind of waiting for the expert to chime in as well, but anyway.

I think your right about the voltage divider. Because of that IC1A only sees a voltage swing of -1 to +1 V coming from R1 and R4, so you don't need the larger supply rails.

I think rails of 0 and 5v are fine for all 3 except, I think your not supposed to expect the swing on the output to go fully from rail to rail. For instance if you want your final output to be the full 0V to 5V swing, then your -rail should be below 0V, not exactly 0V and your + rail should be more than 5V, not exactly 5V. If you want to use the 0V and 5V rails, then calculate your gains so that your final output has a slighly smaller voltage swing than that.

And it looks like you did. 20V swing times .1 gain is 2V swing times 1.5 gain is only 3V swing. (centered at 2.5V) so your final output will go from 1V to 4V. Well within the 0V to 5V rails.

In other words the rails are fine, your just going to get slightly less due to the gains that you selected? If you want the full 0V to 5V swing, then change the second gain from 1.5 to 2.5. But that's where I think there would be a concern about the rails.

One thing I have never seen before is what you did with IC2A. Anyone know if it is ok to connect the output directly to the input like that. Its an interesting way to set the bias piont for the whole circuit. I hope that work. I'll have to try and remember that one.

Did you try this circuit out? Did it work?
--tim
 
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
IC2A
This is a common circuit. The input impedance is very high since the IC will take negligible current. The output impedance is very low since the IC drives the output to match the input.
 

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
cphus,

Where is the AD628? All I see is a TL082.

The TL082 is not a very good choice because it is meant for higher supply voltages than 5V. If you have 30V, or even 24V total, it will work much better. The TL082 outputs cannot drive a load close to the supply rails.

Look for a "rail to rail" output op-amp.

The AD628 appears to be a better bet, as its outputs can drive the load to about one volt from each supply. However, a "rail to rail" output op-amp can do better.

If you have to use a very common part, the LM358 / LM324 can drive a very light load over a wider range than can the TL082. A pull-up resistor on the output will get you within tens of millivolts of each supply rail.

Ted
 

cphus

May 1, 2012
8
Joined
May 1, 2012
Messages
8
I just tested it and it outputs from 1.36V to 4.4V which is not bad though. When I input 0V the output stands nicely at 2.5V. When I increase the input, at about 7V it reaches it's max 4.4V output. When I decrease it, it reaches 1.4V when the input is about -5V and then decreases very-very slowly to 1.36 at -10V.

I think it's about the negative voltage in the inputs, the chip being powered at 5V..

I slightly modified the gain of the second op-amp and I still get quite the same output.
 

cphus

May 1, 2012
8
Joined
May 1, 2012
Messages
8
TedA,

I actually reproduced the internals of the AD628 using TL082 and the resistors. So, the upper part of the schematic is the internals of the AD628 so I only added a 2.5V reference voltage generator in the lower left part.

It might not be the best choice TL082 but it should do the job for now. I didn't want to buy some other if I had this one. But if I get a 0-5V range at the output I'll change it with something more reliable in the final product.

Edit: Sorry, I forgot the attachement. Solved now..
 

Attachments

  • dual_level_converter.png
    dual_level_converter.png
    15.6 KB · Views: 306
Last edited:

cphus

May 1, 2012
8
Joined
May 1, 2012
Messages
8
I have a working version, quite different from what I did untill now. It needs 2 sources that give +10V and -10V and GND at 0V and also a reference voltage to define the output range which is also used as a source. Not the best but for what i need it suffices.

The trimpot is just for tuning the amplifier, not necessarily needed.
 

Attachments

  • range_converter.png
    range_converter.png
    7.9 KB · Views: 183

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
You could eliminate the op amp making the 2.5V reference and instead use a 5K to 0V and a 5K to 5V on the + input. Thevenin's equivalent theorem says this is equivalant to 2.5K to 2.5V.

Bob
 

cphus

May 1, 2012
8
Joined
May 1, 2012
Messages
8
I prefer using the buffer since it isolates and I'm really sure it'll output exactly 2.5 without being influenced by the signal input.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Except that it is deriving it's reference from the same 5V supply and is therefore subject to exacly the same variation my method would be.

Edit: Actaully, if you put a capacitor across the lower resistor in your divider, you would get increased stability of the 2.5V reference, so that might be a reason for doing it.

Bob
 
Last edited:

cphus

May 1, 2012
8
Joined
May 1, 2012
Messages
8
Needed the inverse operation also, that is converting from a [0,5]V range to a [-10,10]V range.
So I added the lower part that does the thing for whoever needs this in the future. It's tested and it works.

Note that if Vref is other than 5V it will also work. You can interface it with 3.3V logic also. I think it will go down to 2.2 (if I remember well, the chips lower limit).
 

Attachments

  • dual_level_converter.png
    dual_level_converter.png
    15.2 KB · Views: 145
Last edited:

Wabajig

Apr 14, 2012
75
Joined
Apr 14, 2012
Messages
75
Based on frequency on would select a diode to chop off the bottom part of the wave. Then use a simply voltage divider network or in other words to 1k resistors in series from diode to ground. Take your sample of the last resistor to ground. Also use cap in front of the diode so it has no dc going into diode. Then run signal into compartor circuit with supplies of 5V and ground. Should give you plenty of fan out. Good Luck
 
Top