Electronics > Beginners
How to make an analog circuit to proportionally scale a sensor output voltage?
<< < (9/9)
HwAoRrDk:
Back at looking at this again after the weekend, and I thought I would knuckle down and get my brain in gear to try and understand how the resistance values mikerj arrived at for the differential op-amp circuit were calculated.

Once it twigged about the relationship between slope of the line and gain (i.e. they're the same thing - and mikerj basically said so already! :palm:), and that I could calculate the slope trivially using a spreadsheet function, I thought I would work out exactly what the gain figure should be for the differential amplification. It worked out to be a slightly different value: 1.258, versus the 1.277 mikerj estimated. Using this new figure in a diff. op-amp circuit calculator, I came out with resistor values of 120k & 150k.

However, simulating the circuit with these new resistance values actually gave a slightly greater error than the original. However, the, err... parallelism? of the line on the graph matched that of the original sensor's much better; the old values actually had worsening error towards the bottom of the pressure range (as much as 5% at 0.25 Bar). All it appeared I needed to do to get a better match was to bump the output up a tad, and so I guess this is where the offset voltage divider comes in. After playing around a bit, I settled on changing the 6.8k to 7.5k, which netted me <1% error across the board. :D

Here's a graph of the results:



I'm still not clear about how the offset voltage figure was arrived at, though. Is it simply the distance on the graph between where the original sensor intersects zero on the Y-axis and the Y-value of the same horizontal point for the GM sensor? That appears to be around 0.15V, which matches what a 6.8k/220R divider gives when supplied with 5V. But the 7.5k/220R I experimentally ended up with is kind of away from that, at 0.142V... :-//
GerryR:
My guess would be that the sensor outputs are not as "linear" as indicated on the data sheets, and the values given are more nominal than exact.  I think your method of measuring, and then adjusting to suit, is the best approach. 
mikerj:

--- Quote from: HwAoRrDk on July 07, 2019, 11:02:21 pm ---Back at looking at this again after the weekend, and I thought I would knuckle down and get my brain in gear to try and understand how the resistance values mikerj arrived at for the differential op-amp circuit were calculated.

Once it twigged about the relationship between slope of the line and gain (i.e. they're the same thing - and mikerj basically said so already! :palm:), and that I could calculate the slope trivially using a spreadsheet function, I thought I would work out exactly what the gain figure should be for the differential amplification. It worked out to be a slightly different value: 1.258, versus the 1.277 mikerj estimated. Using this new figure in a diff. op-amp circuit calculator, I came out with resistor values of 120k & 150k.

--- End quote ---

I did say I got the gains from eyeballing the charts!  If you have raw data you can fit a line to, it will be far more accurate.


--- Quote from: HwAoRrDk on July 07, 2019, 11:02:21 pm ---I'm still not clear about how the offset voltage figure was arrived at, though. Is it simply the distance on the graph between where the original sensor intersects zero on the Y-axis and the Y-value of the same horizontal point for the GM sensor? That appears to be around 0.15V, which matches what a 6.8k/220R divider gives when supplied with 5V. But the 7.5k/220R I experimentally ended up with is kind of away from that, at 0.142V... :-//

--- End quote ---

Look at the diff-amp circuit and imagine the MAP sensor input is held at a fixed voltage.  The other arm which the divider is connected to is effectively an inverting amplifier, and it's gain is greater than unity (1.25 in this case) so whatever voltage you provide from the divider will be amplified by that gain.  In other words if you change the gain you will have to change the voltage at the divider to maintain the same offset voltage.

Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod