You are on page 1of 6

# 4/14/12

VOL. I - DC VOL. II - AC

## Averaging two 0-5V analog signals - All About Circuits Forum

VOL. III - SEMICONDUCTORS VOL. IV - DIGITAL VOL. V - REFERENCE VOL. VI - EXPERIMENTS WORKSHEETS VIDEOS Find

All About C ircuits Forum > Electronics Forums > The Projects Forum

## Averaging two 0-5V analog signals

Register Notices Blogs FAQ Community

Today's Posts

with their projects, this is the place to do it.

Page 1 of 2 1 2 > Thread Tools 02-22-2008, 01:09 AM Display Modes #1 Join Date: Feb 2008 Posts: 3

cambridge
New Member Averaging two 0-5V analog signals

Hi all, I am trying to figure out the best way to combine two analog 0-5V signals to output the average of the two combined signals at the same voltage level of 0-5V. This is a project for a car, specifically a twin turbocharged Mustang. The factory Ford computer uses a mass air meter that measures incoming engine airflow via a hotwire style meter. Basic operation of the meter is as follows: The air inlet tube for the engine has a heated wire running across the center of the intake tube. As air flows across the wire it cools the wire, this forces the computer to supply more voltage to maintain the set temperature of the heated wire. The changes in voltage are monitored by the computer which in turn changes fuel injector pulse width, engine timing, etc. for proper engine operation. As supplied from the factory this engine uses one mass air meter for measuring the incoming air. I am running twin turbos with two engine inlets, consequently, I need to be able to measure the airflow in two tubes simultaneously. The problem is that the Ford computer needs to see a 0-5V analog signal from one meter. How do I combine the two signals to generate the average of the two signals at the previously set 0-5V? I am not sure where to start. My electronics knowledge is very basic but I am not afraid to read and study. Can someone help point me in the right direction? Thanks in advance!

02-22-2008, 01:31 AM

## #2 Join Date: Jul 2007 Location: Orlando, FL USA Posts: 21,493

SgtWookie
Expert Member

You basically use a summing/averaging network - a pair of resistors - as input to an op amp. See this link: http://www.allaboutcircuits.com/vol_3/chpt_8/8.html However, you may actually wish to select the input to be the one with the highest reading (ie: most airflow) rather than averaging the

1/6

4/14/12

However, you may actually wish to select the input to be the one with the highest reading (ie: most airflow) rather than averaging the two; as if the airflow is unbalanced, you may wind up with an excessively lean mixture in one cylinder bank. This can happen quite easily if, for example, one turbine develops a faulty bearing - the other bank will then be fuel-starved, leading to detonation and destroyed pistons/bearings. It would be a good idea to ensure that both sides are putting out the same signal level for a given airflow. [eta] Actually, what you might wish to do is not only take the highest reading (resulting in the most rich mixture) but also give a visual indication to the driver that there is an imbalance in airflow. An "idiot light" coupled with a visual indication, such as a needle deflecting right/left of center balance would be very helpful in diagnosing which side was causing the problem. This could be easily implemented using a Wheatstone bridge. __________________ General info: If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
Last edited by SgtWookie; 02-22-2008 at 02:15 AM.

## Averaging two 0-5V analog signals - All About Circuits Forum

02-22-2008, 06:32 AM

## #3 Join Date: Jun 2006 Posts: 834

mrmeval
Senior Member

To get the more advanced display you might consider a microcontroller like the atmega168. It can do it very well.

02-23-2008, 12:34 AM

## #4 Join Date: Feb 2008 Posts: 3

cambridge
New Member Will This Work?

Thanks for the help everyone! I have completed a drawing using the 2 resistors feeding an op amp (741). Hopefully I am in the ballpark! I do have a few questions maybe you guys can help with. Reading the page describing the operation of summing circuits and Millman's formula, I see that a summing circuit is made up from the previously described two resisters. For this particular application what is the benefit to making the circuit active as opposed to using the two resistors passively? After checking Millman's formula I see that any value resistor would result in the same output providing the two resistors are of the same value. I drew the schematic using 1K resistors. Would I be better off using 100 ohm resistors or 10K resistors? If so, why? Should I be feeding the op amp with the 5 volt supply or use the 12 volt (actually closer to 14 volts) supply that the cars battery provides? Looking at the data sheet for the 741 op amp it says voltage inputs can be as high as 15 volts. Should I be concerned with any noise that may be generated by the added circuit? Do I need to add filter caps anywhere? With the impedance of the op amp being so high I would think that it's susceptibility to outside interference would be low. Am I thinking correct here? If so that would be a first! Any other input on this circuit is greatly appreciated! The idea of processing and using the highest reading from the two individual meters is interesting. I would like to pursue that circuit once I believe I have a handle on this very basic circuit. As you can see from my questions my knowledge is very limited but this stuff is pretty cool. Thanks again everyone!
Attached Images twin_MAF.gif (4.7 KB, 48 views)

02-23-2008, 02:16 AM

SgtWookie
Expert Member

Quote:

2/6

4/14/12

## Averaging two 0-5V analog signals - All About Circuits Forum

Originally Posted by cambridge I have completed a drawing using the 2 resistors feeding an op amp (741). Hopefully I am in the ballpark! A 741 op amp is quite ancient technology, and has many faults. A far better choice would be something like Linear Technology's LT1007. It can run on a single supply vs a bipolar supply, is rail-to-rail for input and output, has JFET inputs, and does not suffer from phase inversion as the 741s do.
Quote:

I do have a few questions maybe you guys can help with. Reading the page describing the operation of summing circuits and Millman's formula, I see that a summing circuit is made up from the previously described two resisters. For this particular application what is the benefit to making the circuit active as opposed to using the two resistors passively? The input impedance of a JFET-input op amp is, for all practical purposes, infinite. This means there is practically zero load on the input signal, thus the voltage "reading" is much more accurate.
Quote:

After checking Millman's formula I see that any value resistor would result in the same output providing the two resistors are of the same value. I drew the schematic using 1K resistors. Would I be better off using 100 ohm resistors or 10K resistors? If so, why? There's a trade-off. Right now, we don't know the impedance of the supply. The lower the impedance of the supply, the lower values of resistors you can use. The higher the value, the less loading on the system - up to a point. At some point, there is a diminishing return on increasing the values of the resistors; you'll wind up with noise. Under the hood of a car is an inherently electrically noisy place, with spark plugs firing and alternators alternating. I suggest that 5K resistors might be a good starting place. It will take experimentation to determine what will be the best values to use.
Quote:

Should I be feeding the op amp with the 5 volt supply or use the 12 volt (actually closer to 14 volts) supply that the cars battery provides? Looking at the data sheet for the 741 op amp it says voltage inputs can be as high as 15 volts. Never depend upon the electrical system of the car to regulate voltage. It might be as high as just under 15V, and might be as low as 10.4V (dead battery and alternator not working) along with transients that may be far in excess of normal. You need a good voltage regulator. Linear Technology has a number of low-dropout regulators that could work in your situation, giving you a steady 10V supply.
Quote:

Should I be concerned with any noise that may be generated by the added circuit? Do I need to add filter caps anywhere? With the impedance of the op amp being so high I would think that it's susceptibility to outside interference would be low. Am I thinking correct here? If so that would be a first! Absolutely right. You definitely need what's commonly called "bypass" caps across the power terminals of the op amp.
Quote:

Any other input on this circuit is greatly appreciated! Needs some work, but I'm not quite up to that this evening Suggestion: instead of routing the inverting input to ground, it should have a resistor equal to the averaging network both to ground and as feedback. That will take care of the offset voltage. Precision in resistors is important here.
Quote:

The idea of processing and using the highest reading from the two individual meters is interesting. I would like to pursue that circuit once I believe I have a handle on this very basic circuit. Well, before you go that route - it would be most helpful to know if the intake plenum is separate across banks, or is it open to both sides. In either event, you would want to know if there is an imbalance in airflow. It becomes a lot less critical if the intake plenum is shared, however.
Quote:

As you can see from my questions my knowledge is very limited but this stuff is pretty cool. Perhaps limited, but we'll expand your horizons __________________ General info: If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.

3/6

4/14/12

of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.

## Averaging two 0-5V analog signals - All About Circuits Forum

02-23-2008, 02:55 AM

#6 Join Date: Apr 2005 Location: Idaho, USA (GMT-7) Posts: 4,583

Ron H
Senior Member

I was drawing this up as SgtWookie was posting, so I wasn't aware of his suggestions. I agree with all of them except this one:
Quote:

Suggestion: instead of routing the inverting input to ground, it should have a resistor equal to the averaging network both to ground and as feedback. That will take care of the offset voltage. Precision in resistors is important here. This will give you a gain of 2, which you don't want. The circuit below uses a jellybean dual op amp, half of which is unused. It has the ability to handle zero volts on both input and output, which is a requirement for your circuit. The 741 won't do that. The LM358 (and the 741) need some headroom on the positive rail, so I've used the +12V, but with some heavy filtering (220 ohms, 100uF). This should handle glitches on the +12V supply, and in any case the LM358 can handle up to 32V. The LM358 power supply rejection is good, so regulation isn't really a big issue. If you're really concerned about glitches on the supply, you could add a 10V zener across the 100uF capacitor.
Attached Images twin_MAF1.PNG (7.0 KB, 44 views)

02-23-2008, 04:18 PM

## #7 Join Date: Dec 2007 Location: Ontario, C anada Posts: 7,406

Audioguru
Senior Member

I think you need to add the outputs of the MAPs, not average them. Then the opamp needs to have a gain of 2. Or else the computer will think there is half as much air as there really is and make the mixture much too lean. Then the engine will blow up if it has turbo boost. Or the mixture might be too lean for the engine to run. Actually the computer will receive a conflicting report from the oxegen sensor that the mixture is much too lean and will cutoff the turbo boost and limp home.

02-23-2008, 05:12 PM

#8 Join Date: Apr 2005 Location: Idaho, USA (GMT-7) Posts: 4,583

Ron H
Senior Member

Quote:

Originally Posted by Audioguru I think you need to add the outputs of the MAPs, not average them. Then the opamp needs to have a gain of 2. Or else the computer will think there is half as much air as there really is and make the mixture much too lean. Then the engine will blow up if it has turbo boost. Or the mixture might be too lean for the engine to run. Actually the computer will receive a conflicting report from the oxegen sensor that the mixture is much too lean and will cutoff the turbo boost and limp home. Each sensor has a 0-5V range. Obviously, the ECU shuld still see that range. The average will yield that range. The sum will overdrive the ECU. Whether or not the average is actually advisable, I have no idea. SgtWookie may be on the right track with his suggestions.

02-23-2008, 05:28 PM

#9

4/6

4/14/12

rollertoaster
New Member

## Join Date: Feb 2008 Location: royersford, PA Posts: 4

Quote:

Originally Posted by Audioguru I think you need to add the outputs of the MAPs, not average them. Then the opamp needs to have a gain of 2. Or else the computer will think there is half as much air as there really is and make the mixture much too lean. Then the engine will blow up if it has turbo boost. Or the mixture might be too lean for the engine to run. Actually the computer will receive a conflicting report from the oxegen sensor that the mixture is much too lean and will cutoff the turbo boost and limp home. Abolutely correct... if you average the signal the ecu will only see 1/2 of the actual airflow into the engine. I wouldn't go this route with a twin turbo setup. You're better off retrofitting a MAP setup. If you keep the Maf setup you'll run into idle and decel problems if you don't recirculate your blow off valve. If you don't use a BOV you will damage your turbos from compressor surge. You'll need much larger injectors too, because you'll be running a much richer mixture(11.5-12.5:1 under boost). But then the car won't run right at idle. You could use a rising rate fuel pressure regulator but I would discourage it (they suck!!). I just turbo charged my Honda element about a month ago, thank god Honda uses map sensors instead of maf. Even still I had to use an AEM piggyback computer to control the much larger injectors and allow the car to stay in closed loop during boost without leaning out due to O2 control. What year car is it? Obd 0, obd1, obd2? I manage to turbo my obd2 car with no check engine light and all emissions controls intact.

02-23-2008, 05:35 PM

#10 Join Date: Apr 2005 Location: Idaho, USA (GMT-7) Posts: 4,583

Ron H
Senior Member

Quote:

Originally Posted by rollertoaster Abolutely correct... if you average the signal the ecu will only see 1/2 of the actual airflow into the engine. I see your point, but will an ECU set up to handle a 0-5V MAF signal be able to handle a 0-10V signal?

Page 1 of 2 1 2 >

## Bookmarks Digg del.icio.us StumbleUpon Google

Tags 05v, analog, averaging, signals Previous Thread | Next Thread Posting Rules You You You You may may may may not not not not post new threads post replies post attachments edit your posts

BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules Forum Jump The Projects Forum Go

Thread Multiplexing analog signal how to find resultant vector of 3 analog signals? Thread Starter adrian.dmc Geert-Jan Forum General Electronics C hat The Projects Forum Replies 10 1 Last Post 02-06-2008 12:13 AM 01-14-2008 11:02 AM

5/6

4/14/12
Servo input: PWM or analog Servo input: PWM or analog Need analog optical isolator

## Averaging two 0-5V analog signals - All About Circuits Forum

lisandro lisandro saha The Projects Forum General Electronics C hat General Electronics C hat 2 1 1 10-30-2007 10:56 PM 10-30-2007 10:00 PM 06-04-2006 08:14 PM