Go Down

### Topic: Reading 0-100 mV signal (Read 18098 times)previous topic - next topic

#### danb35

##### Dec 17, 2013, 03:28 pm
I'm working on a project that needs to read a four-wire pressure sensor.  The sensor takes 10 V DC in on two wires, and outputs 0-100 mV DC, 1 mV/psi.  I need to read that voltage on an Arduino (actually a Teensy), convert it to a PSI measurement, light an LED if it's too low, and output the information over a serial line.  I'm OK on the software side of it, at least conceptually, but questioning how to read the voltage.

My best guess here is that, to get decent resolution, I need to convert 0-100 mV to 0-5 V.  My next guess is that I'd use an op-amp to do this.  From there, my guesses are running out--I've not had occasion to play with op-amps before, and I'm not even sure that they'd be appropriate here.  What would be the best (simplest, lowest parts count) way to accomplish this?

#### winner10920

#1
##### Dec 17, 2013, 03:39 pm
You can set the voltage reference to external and put a lower voltage on the aref pin, I'm not exactly how low it can go but you can probably get the range alot closer without any hardware

#### groundFungus

#2
##### Dec 17, 2013, 03:42 pm
You need an op amp.  There are lots of circuits around for single supply op amps.  If you use the 1.1V internal analog reference for the ADC, the  op amp will only need a gain of about 10.

#### 123Splat

#3
##### Dec 17, 2013, 04:21 pm
You seem to be on the right track.  Lookup the data sheet for a LM358 Dual OP-AMP (it's a little bit of overkill for what you want, but seems to be a popular IC on this site, and it will do what you need).  Using the 8-pin DIP package, you want to create a Non-inverting amp with a gain of 50 and run it through a voltage follower (non-inverting amp with a gain of 1):
pin 1 - output amp a, signal out and tied to pin 5
pin 2 - inverting input (-) amp a, tie to 10K ohm R, which is tied to ground; pin 2 also tied to a 50k ohm R which is tied to pin 1 (amp a output).  This sets/creates your non-inverting amp with a gain of about 50.
pin 3 - non-inverting (+) input amp a, 0-100mV signal in.
pin 4 - ground
pin 5 - non-inverting input amp b, tied to pin 1
pin 6 - inverting input (-) amp b, tied to pin 7 output amp b.  This sets/creates your voltage follower and uses up the other op-amp in the package (optional if you have another use for it in this application)
pin 7 - output amp b, to an analog input of the arduino.

This should work. your volues will not be exact, so you will not actually get a gain of 50, but it will get you close enough to map a full scale output.   I'm sure somebody else will eventually come along and rip this apart with a better solution, but this will get you started.  Good luck! Have fun.

#### danb35

#4
##### Dec 17, 2013, 04:24 pmLast Edit: Dec 17, 2013, 05:27 pm by danb35 Reason: 1
OK, op amp it is, and I'll look up the LM358.  Thanks for the input!

(later)  I've looked at the data sheet for the LM358, and it looks like the gain is set by the ratio of R2 to R1.  If I'm reading and understanding it correctly, this means that the 50k/10k combination would result in a gain of 6 (1 + R2/R1), amplifying 0-100 mV to 0-600 mV.  Is this correct?

#### UnoDueTre

#5
##### Dec 17, 2013, 06:24 pmLast Edit: Dec 17, 2013, 06:28 pm by UnoDueTre Reason: 1
I am assuming that the sensor will be DC coupled to the opamp and like wise the opamp's output will be DC coupled to the Arduinos ADC.
If this is the case, then you have to take drift into consideration and I don't know if the LM358 is good enough, admittedly I have never checked as always just used it in AC coupled applications.

A quick Google for "low drift opamp" or "zero drift opamp" will turn up some results which can than be compared to the LM358.

The other thing to take into consideration, are any DC offsets on the opamps output which may be created by the gain setting resistors.

#### polymorph

#6
##### Dec 17, 2013, 06:31 pm
Yes, as a noninverting amplifier, the gain for that combo would be 6.

If you use 10k and 100k, a gain of 11 will take it from 100mV full scale to 1.1V full scale. With the internal reference of about 1.1V, that will get you the most resolution. My understanding of the internal reference voltage is that it is stable over time, but varies from one AVR to the next, so you may want to include a 10t pot in there to adjust the gain. Or use 10k and 91k resistors.

You will want to add a 100nF bypass capacitor on the ARef pin.

There are better Op Amps than the LM358.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

#### retrolefty

#7
##### Dec 17, 2013, 06:53 pm
Are you sure you don't require a differential input amplifier? If you just measure one side of the Wheatstone bridge I think you find the the measurement range would be 1/2  X 10vdc + or- 50mv, not a useful signal for a single opamp stage to work with. Search for classic instrumentation op-amps to see how to properly interface with a resistive bridge sensor of any type.

#### 123Splat

#8
##### Dec 17, 2013, 07:48 pm
Yeah, I screwed up the gain calc.  I meant 1K instead of 10K. since you would most likely end up with a 47K instead of a 50K, that would calc out to 48 (close enough to 50 for this app.).
Since the OP is looking for a limit, not measuring steps, this should do.

Not sure where the idea of bridge in the sensor came from, but i would conceed that a differential or instrumentation amp would better serve in such case, but again, I do not think step accuracy was a criteria in the OP.

As far as drift and offset, you are correct, but we going for the quick and dirty here, not great step accurach. it will all settle out within the specified needs of the OP.

No, the 386 is NOT an ideal op-amp for this issue/application, but it will serve (as a starting point).

#### retrolefty

#9
##### Dec 17, 2013, 08:07 pmLast Edit: Dec 17, 2013, 08:08 pm by retrolefty Reason: 1

Yeah, I screwed up the gain calc.  I meant 1K instead of 10K. since you would most likely end up with a 47K instead of a 50K, that would calc out to 48 (close enough to 50 for this app.).
Since the OP is looking for a limit, not measuring steps, this should do.

Not sure where the idea of bridge in the sensor came from, but i would conceed that a differential or instrumentation amp would better serve in such case, but again, I do not think step accuracy was a criteria in the OP.

As far as drift and offset, you are correct, but we going for the quick and dirty here, not great step accurach. it will all settle out within the specified needs of the OP.

No, the 386 is NOT an ideal op-amp for this issue/application, but it will serve (as a starting point).

It's not just about accuracy, it's about properly measuring the proper terminals of the sensors internal bridge circuitry. Almost all what you call "4 wire" respond by changing the internal resistance  (be it a pressure sensor, load cell, etc)  of two of the four resistance elements that make up the electrical side of the sensor. You measure the voltage across the bridge while exciting the bridge with a fixed voltage or constant current across the other two terminals. It's the difference in DC voltage between the two equivalent voltage dividers that represents the measurement value not the absolute voltage. There are sensors that have built in amps and circuitry to directly output a fixed DC voltage zero to whatever, but they cost more as they just include the instrumentation op-amp front end required to increase the voltage measurement range.

#### 123Splat

#10
##### Dec 17, 2013, 08:28 pm
OK, so use the bridge current amplifier configuration in the Typical applications......

#### MarkT

#11
##### Dec 17, 2013, 08:30 pm
Sounds like you might have a _10V_ bridge sensor, this would mean you require an instrumentation amp (running from 10V), and a way to protect the microcontroller from over-voltage from the output of the opamp.  Perhaps a INA126.

Is there a datasheet for this sensor, we should get to double check what it is actually is
rather than having to guess...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### polymorph

#12
##### Dec 17, 2013, 08:32 pm
Can you give us a part number for the sensor? If it is putting out 0-100mV, it has an internal differential amplifier.

I would strongly recommend -against- amplifying it to 5V. For one, the LM358 (not LM386, I suspect that was a typo) can only bring its output to Vcc-1.5V. In addition, when you use the default reference voltage, it is really using the Arduino 5V power supply. So any noise or variation will affect the readings. The internal reference voltage is much more stable. And it only requires the output of the LM358 to go up to 1.1V max.

The issues of drift and offset voltage and current remain. But with a gain of only 10, I don't know if that is an issue for you.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

#### 123Splat

#13
##### Dec 17, 2013, 08:43 pm
Oops, my bad again.. yes, typo.

I am trying to keep it simple for the OP, who said he was not experienced with op-amps.  A good instrumentation amp probably be a better solution for accuracy, but I still believe he can get it functional and learn some things in the process with a 358.  From his description of the issue, he really does not have to go full scale, just find his trip point.  With a 5V single ended supply, the op-amp will provide any needed input protection.

Brute force may not be very elegant, but it can be used to get the job done.

#### danb35

#14
##### Dec 17, 2013, 09:17 pm
Unfortunately, I do not have a data sheet for the sensor; what I know of its characteristics has been determined by trial and error.  It came with an electronic module that was designed to be used with an aircraft engine instrumentation system.  When I applied power to the module, it was feeding 10 volts to the "in" terminals on the sensor.  Given that, I wired the "in" terminals on the sensor to a bench power supply set for 10 volts, applied air pressure in 20 psi increments, and measured the output.  In doing so, I was looking for stable readings in voltage, resistance, or current; what I got was a stable and repeatable 1 mV/psi result.

My goals are to light an LED when the pressure falls below a certain level, and also output the pressure over a serial line (a fallback would be to just manage the LED, but that should be achieveable without involving a microcontroller, I'd think).  I don't need lab-grade accuracy, but +/- 5% would be good.  The application I'll be using it in will be powered by a 14V DC bus, which I'm planning to regulate down to 5V for the Teensy, and to 10V for the sensor, using a 7805 and 7810 respectively.

Go Up