Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Inverting op amp with 2/3 gain.

Status
Not open for further replies.

dustovich

New Member
Hello,
This is my first post here, looks to be a pretty good resource for people learning, especially myself. Have a small amount of experience with basic electronics, but virtually nothing with op-amps and other more advanced things. After looking around here, and other places I am pretty sure I have found the configuration that I need. But I find it quite hard to select which op-amp would be best suited for my application, there are too many.

First off a description of what I am trying to do:
I am trying to read a 5v sensor with my 3.3v ADC on my micro. The sensor output is analog and will vary between ~0.2-4.8v and has an impedance of >50kohms according to the spec sheet. I have attached it here. Most micros that I have seen (arduino) prefer an input impedance of <10kohms to read properly without error, so regardless of the range shifting that I need with my new micro (teensy 3.1) I would have needed an op amp to begin with. I am going to be reading this sensor in parallel with the actual ecu in my car, so there can be nothing affecting the voltage level, which fits well with the op amp theory (infinite input impedance). I will have both a 5v and a 3.3v source, but I would assume that the op amp will require the 5v source only. There will be no AC/frequencies, and more or less a (relative to khz/mhz frequencies) very slow changing DC voltage relative to the pressure applied to the sensor. It will be subjected to outside temperatures (-30c-+40c) so this will have to be taken into account also. The micro will share a common ground (car chassis) with the ecu sensor, but will have a different power supply than the one internal to the ecu itself.

After some research my plan was to have an op-amp configured to invert the signal with a 2/3 gain so I will have a perfect inverted linear voltage adjusted down to 3.3v. So this would require a single supply rail-rail, low noise?, low offset op amp with not much change due to temperature (my guesses that is). After searching around the forums, I have found the TLV34x(A) series of op amps which seem to fit the bill for what I am looking for.

Questions that I have are:
Is there a more suitable op amp out there for this application?, or is there a more suitable way of doing this period?
Considering I don't want to affect the circuit that I am measuring at all, and taking into account the existing circuit impedance (and unknown circuits inside the ECU) what ranges of resistor values would be best to use for the input/feedback resistors?
What else am I missing?

Hopefully I have provided enough information to make this understandable.

Thanks in advance for your help also.
 

Attachments

  • 02730_[www.ic5.cn].pdf
    143.7 KB · Views: 185
I would just use an op amp as a unity gain buffer, and divide either its input or output by 2/3. I would then use software after the ADC to do any level shifting or inversion. The op amp should be rail to rail both input and output as well as able to operate off a single 5v supply. The CA3140 comes to mind but there are many choices.
 
That sir is a good idea, just using the op-amp as unity gain and then just use a voltage divider afterwards to divide the voltage down. Then no inversion necessary. The primary purpose was to linearly scale the voltage down so I could read it from the ADC, there is some processing afterwards necessary in software to convert the resultant voltage to units of pressure anyways, which is trivial. But as you say there are many choices of op-amp and that is the dilemma. Ill have a look at the datasheet for that one.
Thanks.
 
Welcome to ETO.

Congratulations on a well specified problem! That is often a rare thing in these parts.

I agree with Moffy on the idea of a unity gain buffer and an attenuator.

Your idea of using a TLV... op-amp seems ok, at a quick look at the datsheet it is rail to rail and single 5v supply compatible.

Can I make a constructive criticism of this statement:
The sensor output is analog and will vary between ~0.2-4.8v and has an impedance of >50kohms according to the spec sheet
When I read that, it appeared that you were saying that the sensor had an output impedance of >50k Ohm. That raised alarms in my head.

Looking at the datasheet, it is saying that the LOAD on the sensor output should be greater than 50k, not that the output impedance was greater than 50k.
It does not appear to be stated in the datasheet, but I would expect the output impedance to me much lower than 50k Ohm.

The idea is that a high impedance load, connected to a low impedance output, does not pull down the output voltage thereby causing measurement errors.

JimB
 
That does make sense, though when I did have this sensor directly attached to the 5v ADC on my Arduino I did notice a significant variance between the ADC reading and my multimeter (attached in parallel). I dont know what else would be causing the difference (but there are probably many things) other than a high(er) impedance that may prevent an accurate reading. Regardless that point becomes moot when using an op amp which wont change the circuit to a meaningful degree due to its high input impedance and provide a low enough output impedance to measure accurately (but you already knew that I am sure).



Thanks for the friendly welcome!
 
What is the rate of change of the sensor output? Another way to ask this is what does the ADC sampling rate have to be not to miss anything?
 
I was thinking of between 50-100msec inbetween reads. I haven't started writing the program just yet so that is flexible. The sensor is going to be read and then displayed on a small tft lcd display, I would think that 10-20fps would be more than acceptable.

Sensor itself according to the datasheet takes 4-8msec to jump between 10-90% of its output.
 
Congratulations on a well specified problem! That is often a rare thing in these parts.
I'd like to second that. It's great to see someones first post being so useful to those trying to help.

I'm with everyone else, use a unity gain op-amp. Just for your information many op-amps are unstable below unity gain so this is why a unity gain op-amp is good advice.

A note on the voltage divider. If you put it on the input side you'll want a high impedance resistive divider to avoid loading the sensor. But if you put it on the output you'll need a lowish impedance voltage divider so it can drive the ADC.
This arrangement can work but personally I'd use two stages. A unity gain buffer to present high input impedance to the sensor followed by a voltage divider and a unity gain buffer to present the ADC with a low impedance signal. Another benefit of this is that duel op-amp packages usually allow for shorter feedback paths so reducing noise pickup.

There are many op-amps, you want a rail-to-rail that works from you're (single sided?) supply rails with a push-pull output. The LM358A should work but there are many options and it will depend where you are in the world.

One last note, if you are driving your op-amp buffer from a different voltage than the ADC you should include an schottky diode between the ADC input and supply voltage for protection.
 
The dual stage looks like a good idea. From what I was reading on op amps, more are stable below unity gain only when they are used to invert the signal, correct? They are unstable when used non-inverted. I'm sure though it still is better to not push the envelope below unity gain. Sounds like I have a good plan now. Thanks.

What would the difference between a automotive grade op-amp and one of these other ones? The one I found looking at TI's website would be the OPA2314, not that I wont have a look at the LM358A one.

Also whats the difference between the zener and the schottky diode for the voltage clamping/protection on the inputs? I was reverse biasing some 5.1v zeners before for my 5v ADC before.

Sorry for so many questions. Getting into electronics is somewhat of a high learning curve. Lots of reading to do.
 
From what I was reading on op amps, more are stable below unity gain only when they are used to invert the signal, correct? They are unstable when used non-inverted.
Nearly all are stable at unity gain except for some very high frequency types which are only stable at a minimum gain. This application is nowhere near that. Used to be in the 70's, LM301a, you had to compensate your op amp but not these days.
What would the difference between a automotive grade op-amp and one of these other ones? The one I found looking at TI's website would be the OPA2314, not that I wont have a look at the LM358A one.
Automotive grade normally have a wider temperature range.
Also whats the difference between the zener and the schottky diode for the voltage clamping/protection on the inputs? I was reverse biasing some 5.1v zeners before for my 5v ADC before.
A zener will clamp when reverse biased at its breakdown voltage e.g. 5.1v and in normal direction like a silicon diode at 0.6 to 0.7v. A schottky will conduct in the forward direction at around 0.3 to 0.4v preventing an unfortunate phenomna called latch up in CMOS ICs. Can also be prevented by placing a resistor in series with the input to limit latch up current.
 
Why complicate things? A unity gain opamp followed by a resistive voltage divider will do the job. If you suspect that the input may go above 5V then a simple resistor and 5.1V zener will protect the opamp. However, I'm not a big fan of protecting against things that can't normally happen. I.E the sensor giving out greater than 5V.

Mike.
 
I'm not a big fan of protecting against things that can't normally happen
It's always good to protect against incorrect connection, voltage spikes, ESD / EMI. Particularly in noisy environments ... say near a alternator or spark plugs, this is the difference between a design that works in the lab and one that works in a system for >20 years.

Even with a voltage divider on the output a dormant failure in one of the resistors could cause an over voltage. In the long run its cheaper to replace a resistor than it is a PIC, so for high value PCB (not standard consumer grade) there is usualy a lot of input protection.
 
Last edited:
It's always good to protect against incorrect connection, voltage spikes, ESD / EMI. Particularly in noisy environments ... say near a alternator or spark plugs, this is the difference between a design that works in the lab and one that works in a system for >20 years.

Even with a voltage divider on the output a dormant failure in one of the resistors could cause an over voltage. In the long run its cheaper to replace a resistor than it is a PIC, so for high value PCB (not standard consumer grade) there is usualy a lot of input protection.
I agree completely. However, how does putting a second opamp after the voltage divider protect against anything?

Adding more components adds failure points. A second opamp will not protect against any of the things you suggest. In fact, it increases the odds of failure by a factor of two.

Mike.
 
I was suggesting a shottky for input protection, I wasn't suggesting the second unity gain stage would perform any protection function.

Using a single unity gain stage would require a high impedance voltage divider on the input or a voltage divider on the output with a suitable impedance for the ADC. Both of these options are possible and will work but with the voltage divider on the input side you risk loading the signal line which may be acceptable we're but we're not sure but you'll also have a high impedance signal at the op-amp input these can be prone to noise and voltage offset particularly with a bad circuit design. With the voltage divider on the output you would have a higher than necessary power dissipation due to the low impedance of the voltage divider.

With a two stage you can have a very high input impedance to avoid loading the sensor (remember this signal is being used by other circuitry which is unknown to us), and you can provide an output which is well matched to the ADC for suitable sample acquisition time. the power cost and footprint of using a duel packaged op-amp is minimal. The only downside is that latency will be increased.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top