| Electronics > Beginners |
| How to make an analog circuit to proportionally scale a sensor output voltage? |
| (1/9) > >> |
| HwAoRrDk:
I have this device that takes an input from an air pressure sensor. The sensor gets a 5V reference, and the device's MCU reads the sensor's output voltage using its ADC. The sensor reads up to 2.5 Bar. However, this particular sensor is expensive and hard to get, so I have been thinking about the possibility of substituting it with something more commonly available. My mind turned to automotive MAP sensors, which are ubiquitous and cheap. In particular, the common GM 3 Bar MAP sensor would be a great candidate. But, of course, it works over a different pressure range (2.5 versus 3), so therefore the output voltage will not match for any given pressure. I found spec sheets for both my existing sensor and a Delphi-brand GM sensor, and made a graph of pressure vs. voltage using the provided transfer functions: Existing sensor is in green, GM 3 Bar in dark red. As you can see, the voltage difference is proportional to pressure; for example, at 2.5 Bar the GM one is approx. 82% of the other, but 87% at 1 Bar. The obvious solution might be to say "modify the MCU firmware with different sensor calibration data", but I can't because I didn't make the device and I can't re-program it. :) So, my question: is there some way, using purely analog means (i.e. no MCU/ADC/DAC), that I can scale the voltage from the new sensor to match the output of the old one? Ideally, I would be able to add the circuitry in-line in between the sensor and the device. |
| Mr.B:
An op amp with 1.1875 times gain? 4.75v / 4.0v = 1.1875 times higher for the old sensor than the new sensor at the same pressure. |
| Dundarave:
Interesting problem... If the curve of the original sensor was completely linear, it should be relatively easy to use an op-amp with a gain that matched the difference in slopes between the two curves. But since there is an inflection point at 0.5 Bar, it makes things a bit more complicated. However, I noticed that at 0.5 Bar, the output of the original looks to be 0.7ish volts, which brings to mind the voltage drop of a diode... Perhaps by arranging the feedback gain resistance in the op-amp circuit so that below 0.7 v, a fixed resistance (calibrated for the initial slope) is used, with a parallel second resister + diode (which would thus conduct at 0.7 v) to handle the slope (i.e. gain) difference for the rest of the curve. It's been a long time since I've played around with op-amp configurations, but perhaps this might give you (or others with greater op-amp expertise) an idea to run with. |
| rs20:
Let's take a step back here: both of these sensors are probably specced and supposed to be nominally linear with 0 bar = 0 volts. So the fact that there is not a strict proportional relationship between the two is due to an imperfection in one of these sensors. Here's the important question: do we actually WANT to emulate this crappiness? Does this application require such precision that modelling that slight inflection point at 0.5 Bar is really necessary? The OP and reply #2 here are latching on to the mathematical challenge of mapping one slightly nonlinear or offset function to another, but this is a real world problem where such efforts may be at best a waste of time, and at worse, result in successfully replicating an undesired behaviour. Stop looking at every pixel in the graph and think about the broader picture. What is this device? Could you please link these spec sheets you found? |
| Mr.B:
--- Quote from: rs20 on July 04, 2019, 05:48:55 am ---Let's take a step back here... Stop looking at every pixel in the graph... --- End quote --- This. The curves look linear enough to simply use an op amp to translate through a simple gain. If the accuracy is that important then buy the more expensive original sensor. If you are looking to cut cost you may have to sacrifice a little accuracy in the low end pressures. |
| Navigation |
| Message Index |
| Next page |