EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: nonzies on November 17, 2023, 06:32:07 pm

Title: How do you decide what model of an op-amp to use?
Post by: nonzies on November 17, 2023, 06:32:07 pm
Sorry if this is a dumb question, this is my first experience with this stuff so I'm not really sure how to go from what I learned to school to implementing it in real life. I have an input voltage that will range from 0 V to 10 V. When the input voltage has a range from 0 - 6.5 V, I want the output voltage to be -0.01 V. When the input voltage has a range from 6.5 V to 7.5 V, I want the output voltage to increase from -0.01 V to 0.04 V with a linear slope. When the input voltage has a range from 7.5 V to 10 V, I want the output voltage to stay at 0.04 V. My current approach is to connect my input voltage to an op-amp and then connect that to a voltage divider so I can bring the output down to the mV range.

I have two questions: how can I figure out which op-amp model to get? I was told to make it inexpensive but I honestly have no idea how to even gauge that because I have 0 professional experience with this stuff. I've only modeled ideal op-amps in my classes. I'm very lost. My second question is how do I get an output range from -0.01 V to 0.04 V? I don't know how to get a negative output. Please help, thank you so much!
Title: Re: How do you decide what model of an op-amp to use?
Post by: magic on November 17, 2023, 07:29:30 pm
You obviously need a negative supply to produce negative output. If none is available, ICL7660 is an easy to use chip that makes it from a positive.

Cheap could be LM358, although cheap is often not very accurate.
Title: Re: How do you decide what model of an op-amp to use?
Post by: Faranight on November 17, 2023, 08:07:01 pm
The "-0.01 V to 0.04 V" is an unusually short output range for an opamp. What kind of output impedance do you need for the generated -10mV to +40mV signal? Or rather I should ask what are you supposed to be feeding this signal into?
If impedance isn't an issue then you'd be right to generate a wider output range and then use a resistor divider network to bring it down to acceptable levels.
Title: Re: How do you decide what model of an op-amp to use?
Post by: nonzies on November 17, 2023, 08:11:10 pm
This is an offset. So, I would connect this offset to an output voltage, and then I would read this voltage on my Raspberry Pi. I don't want this to draw a lot of power since it is just an offset, so I don't think it would be good to have a high output impedance.
Title: Re: How do you decide what model of an op-amp to use?
Post by: magic on November 18, 2023, 07:21:33 am
How are you adding this generated "offset" to the other voltage and could the steps be combined?
Title: Re: How do you decide what model of an op-amp to use?
Post by: MrAl on November 18, 2023, 07:47:50 am
Sorry if this is a dumb question, this is my first experience with this stuff so I'm not really sure how to go from what I learned to school to implementing it in real life. I have an input voltage that will range from 0 V to 10 V. When the input voltage has a range from 0 - 6.5 V, I want the output voltage to be -0.01 V. When the input voltage has a range from 6.5 V to 7.5 V, I want the output voltage to increase from -0.01 V to 0.04 V with a linear slope. When the input voltage has a range from 7.5 V to 10 V, I want the output voltage to stay at 0.04 V. My current approach is to connect my input voltage to an op-amp and then connect that to a voltage divider so I can bring the output down to the mV range.

I have two questions: how can I figure out which op-amp model to get? I was told to make it inexpensive but I honestly have no idea how to even gauge that because I have 0 professional experience with this stuff. I've only modeled ideal op-amps in my classes. I'm very lost. My second question is how do I get an output range from -0.01 V to 0.04 V? I don't know how to get a negative output. Please help, thank you so much!

Hi,

Your three range voltage problem would require biasing the op amp such that it does not kick in until the voltage reaches level 1, then when you get to level 2 it gets pinned high.  This would probably be done with a resistor divider on the output to lower the value of the actual op amp output.

To get to a negative voltage, you need a negative supply, but that can come in various ways.  The simplest is to add a negative supply, but often that is a lot of extra work and parts.  Another idea is to create an artificial ground.  This artificial ground is biased maybe 1v above the actual power supply ground.  That means that power supply ground is actually at -1 volt, and that's your negative supply.

This will take a little  more thought because of your voltage range requirements.  Biasing the input and voltage divider on the output could do it, depending on the accuracy requirement of your project.

What you need to specify next is the accuracy of the spec's you quoted so far.  How off can the -0.01 volts be, and how off can the +0.04 volts be.  Usually you would provide a percentage for each such as 1 percent, 2 percent, 5 percent, 10 percent, etc.  The wider the tolerance the simpler this becomes.  The tighter the tolerance the more complex the circuit might become and even require more parts.
You also might specify the speed requirements.  How fast does the circuit have to respond to a change in input range.  Is it 1us, 2us, 5us, 10us, 50us, 100us, 1ms, 5ms, 10ms, 100ms, 1 second, etc.  100us or above should be easy with an LM358 perhaps, but if you need high speed then you may not be able to use that, and go with a faster device.
 
BTW, a typical way to provide an artificial ground is to use an op amp where the output becomes the artificial ground.  You can usually use an LM358 voltage follower, with a voltage divider on the input.
Title: Re: How do you decide what model of an op-amp to use?
Post by: magic on November 19, 2023, 07:37:23 am
If I were to do it at minimum cost, I would first limit the input voltage to 6.5~7.5V because it's still relatively high voltage and a cheap opamp may be accurate enough. Then divide and shift.

It seems that a 19k/1k divider "grounded" to -352.6mV produces about the exact output you want. This voltage could be produced by TL431 pulled to the negative rail and a suitable voltage divider, maybe with potentiometer.
Title: Re: How do you decide what model of an op-amp to use?
Post by: zapta on November 19, 2023, 06:36:00 pm
>> This is an offset. So, I would connect this offset to an output voltage, and then I would read this voltage on my Raspberry Pi.

Can you first read it by the RPI and then change the values with software as needed?