×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Need help for 12V->5V opamp buffer for A/D

Need help for 12V->5V opamp buffer for A/D

Need help for 12V->5V opamp buffer for A/D

(OP)
Hi All -

Please take a quick look at http://www.eng-tips.com/gthreadminder.cfm/lev2/6/lev3/35/pid/108 if you get a chance ...

I'm building a datalogger for in-car use, and am stuck at the A/D input design stage.  I don't know analog/opamps :(

Basically, I need an opamp buffer for each input channel that will take a signal that can range from 0-14V and map it to the A/D input range of 0-5V.

It should have high input impedance so as not to load down the signal being monitored, and have low output impedance to allow the A/D to sample nice and quickly.

What little I know about opamps leads me to believe I can use a 14k resistor for RI and a 5k for Rf to get a less-than-unity gain to do that mapping.  Is that right ?

Help ...

Thanks -

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
Dang it - got the thread wrong ...  Use this one :

Thread108-20335 'bout that.

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

Hi, use a resistive divider say 9k and 5k.

RE: Need help for 12V->5V opamp buffer for A/D

You can have an input divider -- 9k/5k or even 900k/500k --
buffered with a voltage follower ( OP AMP output and -inp.
connected, input to +inp.)

<nbucska@pcperipherals.com>

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
Would you *have* to use a voltage divider to front the opamp ?  Couldn't you set up the opamp to have a less-than-one gain, to reduce the signal voltage range ?

Less parts, less cost, easier pcb routing ...

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

Non-inverting amp's gain is not less than 1. -- you have to divide the input.

<nbucska@pcperipherals.com>

RE: Need help for 12V->5V opamp buffer for A/D

Hi, you can't get much simpler than 2 resistors.

RE: Need help for 12V->5V opamp buffer for A/D

Hi, and by the way you also need to put in a low pass filter for antialiasing.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
True, 2 resistors is pretty simple, even easier using resistor packs for multiple opamps.

I just want to be sure that I don't change the signal being measured by pulling too much from it.  For example, a 180k/100k divider will pull about 0.5mA - that isn't much, but it might be enough to throw the signal to the car ECU off ...

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

you may use FET input (J or MOSFET) amp with femtoAmp
input current. You can't reduce the current to zero but
close...

<nbucska@pcperipherals.com>

RE: Need help for 12V->5V opamp buffer for A/D

Or just add a simple clamping diode.  Actually, you will want to clamp your input to VCC (5V) and Ground.  By clamping it high, you will protect for excessive voltage if your resistive divider breaks down.  And by placing a ground, or negative transient, clamping diode, you will protect against any negtive voltages in excess of -0.7V.  This will help protect your micro.

Otherwise, I agree with the resistor posts.  There is really no need to try an buffer you input signals too much.  By simply providing a good resistive divider (try to stay away from large R values, any amount of leakage current will produce voltage that can become signifigant), you will effectively clamp your input signal.  One reason I feel so strongly about this, is because I use these circuits to level shift input singals for automotive applications.  Therefore, these circuits are subjected to very hostile applications and have always proved to be very robust (providing that you size the components correctly).

Good luck and keep us posted!!!

RE: Need help for 12V->5V opamp buffer for A/D

Hi, in your 1st post you mentioned 14k and 5k resistor values, now you want to change things.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
The 14k and 5k were to get an opamp to do an appropriate <1 gain to reduce the signal from 14V to 5V.

The 180k and 100k are for a voltage divider to do the same thing.  This would go in front of a unity voltage-follower opamp.

Problem is, I don't know if the opamp-only way will work, me being opamp-clueless.  I would prefer it muchly if it would ... two less resistors per channel, 16 channels, that's a fair amount of board space.

Dean.

PS, Ron/buzz41 has shown a nice way to do it in thread

Thread108-20335 will handle all the cases I would need I think.  0-5V, 0-14V and 9-14V.

RE: Need help for 12V->5V opamp buffer for A/D

Hi, i would suggest you buy a book on op amp theory.

RE: Need help for 12V->5V opamp buffer for A/D

Adding active components only compounds your problems.  I am a big believer in the KISS theory.  Passive components are much more robust and will generally be easier to troubleshoot / characterize.  Adding an op-amp circuit will only increase the complexity of the circuit, while giving limited benefits.  Resistors vary the same with repect to temperature, while op-amps follow a non-linear trend.  If the A/D reading has to be stable over temperature, then keeping the input voltage at a constant level, with respect to temperature, is easily accomplished with a simple resistive divider.  Once you start putting in op-amp circuitry to compensate over temperature, then your circuit complexity get higher (getting away from KISS).

Did you try a simple resistive divider with clamping diodes?  If not, take a few minutes to wire it up.  You might be pleasantly surprised!

Good luck and keep us posted!!!

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
melone:

I'll take a look at just the divider, but I'm a little worried about the loading that will put on the signal.  The AVR wants a 10kohm or less output impedance from the sensor in order to drive the successive-approx A/D.  Any higher and it takes too long.

I want to make sure that the act of measuring won't affect the signal itself.  So an ideal interface between the signal and the A/D would have a high input impedance and low output impedance.  

I've talked/emailed a linear.com engineer, and it looks like there isn't a simple way to do the 0-14V -> 0-5V scaling with just an opamp.  So it will need the resistor divider up front, with a voltage-follower opamp buffer after.

What do you think of Ron/buzz41's design in the other thread ?

Thread108-20335

RE: Need help for 12V->5V opamp buffer for A/D

If you use large R values (I know, it contradicts my earlier post), then your input impedance will be fairly high.  BTW, what type of signal are you trying to sample?  What is the frequency, current, output drive capabilities, etc.?

Don't get me wrong, Ron/Buzz41's suggestions will work, but I just try to avoid putting in active components as much as possible since they are the most likely to fail.  They are also the most difficult to troubleshoot since you generally don't know exactly the internal workings of the IC, and "strange" outputs can be easily attributed to IC functionality.

Good luck and keep us posted!

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
melone:

Unfortunately, most of the signal definitions are vague at best from Toyota.  They are simply to allow the service engineers to know whether or not a signal is within spec.

I'm sure it's the same case with most of the other car manufacturers ...  Although they do define when the signals are pulse-generation ones.

For example, throttle position is a resistive element, providing a variable voltage.  The service manuals spec this out as "2.3-4.9V" being valid.  I've measured this one, and it's a linear representation, so that's an easy one.

Some of the others are spec'd out as "9-14V" with engine running, or "1.2-2.2V" with ignition on.  I tend to think that these are HI/LO signals - low voltage when ignition is on, and higher after the engine actually starts.  But we won't know until we actually start grabbing values.

As so current or output drive capabilities, no way will ToyCo release that info.  Heavens-to-Betsy, you might be able to <gasp> alter those signals to fool the ECU into doing things it wouldn't normally do !  Umm, kind of how most aftermarket fuel-management computers do, like the Apex'i S-AFC.

So you think we can do away with the buffers, and just use a high-R voltage divider network ?  That would be a lot easier to do, especially just for 0-5V or 0-14V signals.  What about the 9-14V ones ?  Putting that through a 0-14V divider will lose the bottom 2/3 or the range.

Ideally, I would like to be able to map

0-5V   ->  0-5V   unity mapping
0-14V  ->  0-5V   scale down
9-14V  ->  0-5V   unity mapping with offset

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

Let's just say that I have been designing automotive engine controllers for the past 3 years for a very large American automobile manufacturer, and I use resistive dividers exclusively.  The 5V signals are very simple, just have a good series element to prevent over-driving the input.  The 14V signals, simply need a resistive divider that will drop the voltage down to 5V.  The 9-14V signals, are a little unique.  You might have to translate the signals with an op-amp network, but I would be willing to bet that basically they are using these signals as ON/OFF (digital) signals.  

Wait, another idea, how about a series zener to drop the incoming voltage from 9 to 1V.  This should allow a simple resistive divider the ability to translate the remaining voltage.  If you choose your resistors correctly, the current through the zener will be around 2.5-5mA and everything will work.

Good luck with your customer.  I have dealt with them in a previous job and do not envy you.  Take everything they say with a grain of salt, and always ask what is the circuit supposed to do, and what is it connected to EXACTLY (no approximations).

Good luck and keep us posted!

RE: Need help for 12V->5V opamp buffer for A/D

A very important piece of info is missing : How many of this
do you need ? One or more ?

The more information you can give the more we can  help .

<nbucska@pcperipherals.com>

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
melone:

Thanks for all the help.  Heh, this isn't for ToyCo as a customer, this is for our enthusiasts group.  Originally it was a much smaller project, just for myself and a couple of friends.  It has since grown somewhat, with pretty high interest from the MKIV community, as well as others from the Honda and DSM crowds.

http://www.nemkiv.com  and  http://www.mkiv.com

As such, the only information we have is what's available in the main service manuals.  Needless to say, that's enough for a service tech to determine if a sensor/line is good or not, but not enough to log with :(

How many do I need ?  The AVR Mega128 micro I'm using has 8 channels of A/D.  8 is not quite enough, so we're muxing 16 inputs.  Although it would be nice to have complete control over all 16 channels, that's not absolutely necessary ...

We can put the dividers/buffers/etc after the 2->1 mux switches.  So every *pair* of channels would be selectable for 0-5V or 0-14V or 9-14V.

I tend to agree that the 9-14V signals are probably the HI part of a HI/LO setup.  But that's just for the Toyota Supra case.  DSM or Honda or whatever may be different.  Dammit, can't handle every single potential case out there, not without lots of DigiPots or something.  Maybe Version II ...

So I think I'll go with simple resistor voltage dividers with a shorting jumper across the top one to allow 0-5V signals.  Given that the addition of the opamps isn't that arduous, I think I'll also design a daughterboard with them in place, just in case, or as an option.

The A/D section will be a daughterboard, so it will be relatively easy to replace.

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

In this case the component cost is not critical. I suggest:

Use a laptop as controller, use the printer port for interface. Divide the input. by 3 ( 100k/50K . Select the channel with an analog multiplexer to a common ADC.
Select a more accurate ADC to compensate for the division.

Put on the inputs a known appr. 10 V, and measure the attenuation, store them and use them as a channel-chanel cal. factor.

 

<nbucska@pcperipherals.com>

RE: Need help for 12V->5V opamp buffer for A/D

melone's idea of using a zener to get the offset on a 9-14v signal is a good one. It allows you to keep the source loading low. BTW, it is possible to wire a transistor as a variable zener if you want an accurate offset.

Have you already decided on the controller and getting the results to the display, or are you sorting out the A/D inputs first?

Using a micro with in-built A/D conversion on several ports would save the MUXing and give fast conversion, and also allow a serial link to the PC for display.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
Hi Guys -

Not sure I understand about the zener.  You're talking about putting a zener diode in series with the input signal being measured to get a voltage drop, or having that feed into the divider ?  How would that offset the 9-14V signal down to near 0-5V ?

Gah, I don't know enough analog like this.  Reading and learning here ...

The controller is an Atmel AVR Mega128.  Actually, this has been a thread for a while on the AVRFreaks site.  Check out the latest revision at :

http://www.avrfreaks.net/phorum/read.php?f=3&i=18914&t=18914#18914

The first post there has a schematic attachment, and there's a later revision about 1/2way down as well (Datalogger-sch-M128d.pdf).  That only has the inputs going directly into the A/D of the micro, no divider/buffer.  Once I finish up the schematic changes to add in the divider/buffering, I'll start a "part7" thread with the new schematic for comments.

This is what I'm planning on at the moment, if I don't go down the zener path.  This will allow the use of an opamp if desired, or just a resistor voltage divider.

 +5Vref O     100K         180K
        0——/\/\/\/———0————/\/\/\/————0
   GND  O            |               |
                     |   _____       |     0-5V
     O————O A O———O  |  |     \      |     output    
     |    jumper  |  0——|-     \     |     to A/D
     |            |     |       >————0———/\/\/\/—0
  0——O——/\/\/\/———0—————|+     /            1K   |
 9_14v   180K     |     |_____/                  |
 input            |    RAIL TO RAIL              |
           100K   |       OPAMP         jumper   |
  GND O——/\/\/\/——O—————————————————————0 B 0————O

1) When NOT using an opamp, only two jumpers are used.  The bottom one B is always in place, and passes the output of the divider to the output point.  The middle one A is used to handle a 0-5V input signal, effectively bypassing the divider.  For a 0-14V input, jumper A is removed, and you get the normal 0-14V -> 0-5V divide-down.

2) With an opamp, both jumper A and B are removed.  The 3-pin jumper at the top is used to select the input signal range to produce a 0-5V output :

+5V-middle = 9-14V
GND-middle = 0-5V
none/open  = 0-14V

So the same pcb can handle both the simple divider setup as well as provide for nice opamp buffering.  Now, can you tell me more about the zener ?

Thanks -

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
Bleah.  That asciiart got all chewed up.  Cut-n-paste it into Notepad and it looks OK.

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

Place the zener before your voltage divider network.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
melone:

OK, so input to zener diode to top of divider.  Middle of divider to A/D input.  What specific charateristics for the zener ?

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

I wonder why you chose a complex micro with 8 x 10bit A/D, when a micro like the SGS-Thomson ST62 series would give you 12 x 8bit channels without MUXing, and with a conversion time of 80microsecs. 8bits would give better than 0.04% resolution - good enough for your purposes, bearing in mind your sensors would probably not have an accuracy better than that.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
Valid question.  I like the AVR architecture, basically.  It's clean, simple, fast and efficient.  Tools are free or cheap.  In opposition, I loathe the PIC with its' paged memory and non-vectored ints.

To be honest, I don't know the ST6/7 series at all.

Dang it, too much to learn, too little time.

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

Fair enough.  I agree on the PIC.  It's primitive.

RE: Need help for 12V->5V opamp buffer for A/D

quite informative thread... keep it up friends

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
Heh, OK.  If you would like to see more information on the project, check out :

http://www.avrfreaks.net/phorum/read.php?f=3&i=19554&t=19554#19554

That has two pdf's - the mainboard and the analog interface board.  Already made a change to the analog one - Ron pointed out that the DG333a mux switches could only handle rail-to-rail inputs.  That is, 0-5V, and sending a 12V signal through them would probably let out the magic smoke.

So the top leg of the voltage divider had to be moved in front of the mux switches.  I'll be posting a new schematic set tonight I think with those changes.

Any comments etc are welcome.

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
Interesting.  I just ran across this Tip/Technique from "Test & Measurement World" Feb 15 1999

http://www.intrepidcs.com/articles/voltlevel.htm

or

http://www.e-insite.net/tmworld/index.asp?layout=article&articleId=CA187458

They show the opamp in *front* of the voltage divider network.  The premise here is to allow one to use very low value resistors, with comparitively lower errors in tolerance, hence more accuracy.

What do you think ?

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

I really don't think that you need to concern yourself with minimizing your error due to circuit tolerence.  Once again, I design engine controllers for a living, and if the signal was that darn sensitive, the auto manufacturer would use a differential signal configuration.

I applaud your effort in striving to achieve the most accurate circuit, but I really believe you are shooting yourself in the foot with all of these front end opamps.  What happens when a 35-70V inductive spike hits the opamp?  My only advice is to keep your circuits as simple as possible, and if you don't absolutely need it, don't put it in!  Extra components, especially active ones, cause your reliability to decrease.  It sounds like you want a robust circuit that will be around for a while.  Why would you want to jeopordize it with extra components?

Also, the low value resistors probably are a very good idea for the simple fact that they will offer no current protection.

Good luck and keep us posted.

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
melone:

Dang it, you keep making me THINK.  It hurts :)

If it's something simple to do, like 1% components and a slight moving around of connections, to gain accuracy, then why not ?  Heh, thanks for the kudos on effort.

My basic idea is to keep things isolated.  It's a lot cheaper to replace a $0.86 opamp chip than a microcontroller if it does get hit with a huge inductive spike.  Desoldering a 14-pin DIP (or pulling it from a socket) is way easier than desoldering a TQFP-64 micro ...  By the way, what's a good way to protect against spikes like that ?

Given that the micro needs a 10k or less output impedance from the signal, how much current can we steal from a typical sensor signal to drive the ADC ?  Would it affect the ECU ?

The analog interface is a daughterboard - one DB25 for input signals, and machine-pin sockets to plug into the mainboard.  Aside from that, the board is completely replaceable with a new design, etc.  How would you do that part of it ?  Accuracy and protection for the ECU and the datalogger being criteria ...

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

After spending many weeks trying to guarentee signal intergrity while connecting additional "things" to my module, I have found that IC's tend to have input capacitances of around 10-30pF.  Hopefully, this will not hurt your ECU from operating properly, but I can definitely say from experience, that if your signals operate faster than 1 MHz, your will start severly modifying your signals.

You are right, replacing a 14 pin IC is much simplier than replacing a micro, but a resistor is even easier!  If you are concerned about inductive signals, place good capacitors (0.10u & 0.010u ceramic), a pull-down (10K) to disapate energy, and clampling zener with a resistor in the base.

Good Luck and keep us posted!

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
melone:

Well, you know the basics of what we're trying to do here.  Simple datalogger, pulling most but not all, the signals from the sensors lines going to/from the factory ECU.  Some will be from other systems, either factory or aftermarket.  Things we want to monitor include :

rpm
speed
throttle position
boost pressure
intake air temp
intercooler outlet temp
under-hood temp
inline and lateral G's (ADXL202 G-sensor)
fuel pressure
fuel pump high/low pressure switch
timing advance/retard
knock sensor (on/off probably)
MAF signal
modified MAF signal (from fuel computer if there)
ECU A/F ratio
injector duty cycle
front O2 sensor
rear O2 sensor
wideband O2 sensor (if there)
exhaust temp
wheelspin indicator

Maybe more :)

I don't believe any of the signals will be high high freq ones.  From the manuals, it appears that there are several variations on the signals.

* 0-5V or some subset within
* 0-14V or some subset within, EG. 9-14V
* 0-5V pulse train
* 0-14V pulse train (actually one was spec'd at 7-14V pulse I think)

Although they're all important signals, probably the two critical ones are the MAF and boost-pressure inputs.  Hmm, injector duty output is probably another ...  Screw those up and things melt/break/do-bad-things.  I've seen the results of a bad injector lead causing the injector to intermittently run low, producing a very lean condition in one cylinder.  Blew the piston, rod and one of the exhaust valves - ugly.  Hence my paranoia about modifying the signal in the act of measuring it.

Given that, and the 10k max input impedance to the A/D section of the micro, how would you design the analog input to the A/D ?

This isn't for a million unit production run, so pennies don't count.  This is for us Supra geeks primarily, and others afterwards.  There appears to be enough interest to warrant looking into a potential production run, but the numbers will probably be just too low that the setup/tooling will just be too dang $$$.  So either we build them, or perhaps a kit.

Heh, then again, who knows.  It may be the next Elmo, though I kind of doubt it :)

Dean.

RE: Need help for 12V->5V opamp buffer for A/D

Your idea of using a front-end op-amp will work, but it will be more complicated than it needs to be.  I am just trying to make the circuit simple, robust, and cheap.

BTW, your knock sensor, should be going at a very high frequency and the data integrity is very important.  I can tell you the on Ford products, the Knock Sensor is differential.

How do you plan on acquiring these sigals?  Obviously your ECU takes in these values, are you just going to poll the ECU micro?

Good luck and keep us posted!!!

RE: Need help for 12V->5V opamp buffer for A/D

(OP)
The complexity is a balance against paranoia :)  Since the analog interface is a daughterboard, I have flexibility to make it anything I want, from a simple resistor voltage divider all the way to a programmable gain and offset buffering opamp setup.

For these first couple of prototypes I'm going to try the simpler ones, just plain divider, and basic opamp buffered.  Anything built after prototype will be a single board setup with as much SMD as I can.  Right now a lot of stuff is thru-hole just to ease construction.

Toyota has two knock sensor inputs.  The signal format appears to be a deep dark secret - no-one seems to know it, or they aren't telling.  In the service manual, the sensors appear as a resistive element, one side to GND, the other to the ECU.  In the ECU, the interface symbol is an RC filter - one capacitor and one resistor coming off the signal input.  

The other side of those components isn't marked, but it isn't GND.  Other sensor inputs use other symbols, NPN transistor and resistor with emitter to GND, or two resistors, one to GND, one just hanging, etc.

Heh, that's part of what we might find here, what the knock signals might look like.  Initially, I would think just noting presense or not would be a good start.

The ECU doesn't provide any output for collection at all.  Not mine (94, pre OBD-II) nor my buddy's 97 OBD-II.  Well, OBD-II does provide output, but not nearly fast enough for tuning purposes.  So we will be tapping right into the sensor lines as they feed into the ECU.  We could use a Fields harness which provides a 6" wire loom to go inline with the connectors to the ECU, but that's $175 ...  Just for the blasted two connectors and LOTS of bits of 6" wire ...

There's some of the paranoia - we're stealing the signals right from the ECU's mouth.  Move along there, nothing to see, nobody here but us electrons, nothing to see.

The 3 temp sensors are all on their own.  Simple 2n3904 transitors as the remote element at the end of shielded twisted pair.

Having the analog interface off the main board will also allow a higher resolution set of off-chip A/D chips to be used too.

Hmm, here's a question.  How important do you think it will be for this to live in a die-cast aluminum box ?  Or, how bad will living in a plastic box be ?

It's interesting to see you (melone) and buzz41 with the two different philosophies for this.  I don't think either is wrong - both are right.  I very much appreciate the time and attention you guys have all given here.  This is the best way to learn, listening to you all help solve problems.

Dean.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources