Go Down

Topic: Air Pressure - SM5420C (Read 415 times) previous topic - next topic

silly_cone

I'm working on a project that uses these SM5420C absolute air-pressure sensors, and I have a question about their analog output. 

In the datasheet it shows that they have a +SIG and -SIG analog pin, and my question is whether you have to utilize both of them and do some kind of comparative analysis, or if using just the +SIG to an analog pin would be sufficient for detecting a positive or negative change in pressure; the actual absolute amount isn't necessary in my application, just the ability to detect a change. 

When I hook up the sensor's +SIG pin and do an analogRead(), it stays stable right at a value 523, which does go up with increased air-pressure applied, and down with a vacuum, so it does respond in this setup.  I'm just confused by -SIG, and whether my readings will be meaningful without it.

TIA.

DaveEvans

It's a wheatstone (full) bridge and you should be able to get actionable information from one leg, but without an amp the change in analogRead() will be small.   Not the normal way to use it, 'course.

silly_cone

thanks for the info.

I haven't ventured into the world of op-amps as-of-yet.  If there's any additional guidance you can offer such as what sort of op-amp I'd be looking at to interface this with an arduino either through a single leg or both, that would be much appreciated.

Paul_KD7HB

The whole thing is explained quite well in the evaluation kit Documentation.

Paul

silly_cone

I hadn't seen that document yet, thanks for pointing it out.  I'll study on it a bit.  :-)

DaveEvans

The easy-to-use HX711 with channel B (32x gain) would give you about 80% of the full range.   If you need full range, you could use something like the ADS1115.  You'd use +SIG and -SIG with both devices.

silly_cone

thanks again, and I have one more probably-stupid question:

do these sensors have to have a pressure differential from their inlet to the atmosphere surrounding their housing such as by connecting a tube from the sensor's inlet to the pressure chamber, or can they be completely disposed within the pressure chamber with only the wires passing through the pressure chamber wall?

Wawa

If you only want to detect a (big) change in pressure, then connect the two outputs of the sensor to two analogue inputs.
Subtract the two A/D values you get from each other to find the difference (positive or negative).
Don't expect a lot from these unamplified sensors (~20 A/D values over the whole pressure range).
You should have bought sensors with buildin instrumentation amp.
Leo..

silly_cone

I didn't realize you could read negative analog values.  Are there any particular measures to take when doing so?

and yeah, these don't seem to be the optimal sensors to use, but they were what was already in the drawer, so I decided to give them a go.  And it may be a good opportunity to learn about op-amps, so silver lining...

On that note, I tried looking around for the hx711 op-amps, and they don't seem to be readily available.  All I could find are pricey break-out boards that are on back-order at the major distributors.  I'm not shy about making my own breakout boards, but that op-amp doesn't seem to be very available even as a standalone IC.  Are there any other recommendations?  Or better yet, what sort of specs should I look for to judge the fitness of a given op-amp?

Wawa

#9
Oct 08, 2018, 10:44 pm Last Edit: Oct 08, 2018, 10:52 pm by Wawa
I didn't realize you could read negative analog values.
You don't.

If you connect Vexc (excitation voltage) and Gnd of the sensor to 5volt and ground of the Arduino,
then you have about 2.5volt on both Sig outputs of the sensor.

Pressure changes that 2.5volt slightly, but one output more positive and the other one more negative.
Both return about 512 without pressure, but if one returns 514 and the other one 510 then the difference is 4.

int pressure = analogRead(A0) - analogRead(A1); // should do something.

Leo..

silly_cone

thanks for that!  I'll keep tinkering with it tomorrow and see what results I'm able to get.

DaveEvans

#11
Oct 08, 2018, 11:39 pm Last Edit: Oct 08, 2018, 11:40 pm by DaveEvans
On that note, I tried looking around for the hx711 op-amps, and they don't seem to be readily available.
There are dozens of eBay sellers of inexpensive HX711 breakout boards.  You can also get them from Sparkfun, RobotShop, etc.

But if all you need is the "ability to detect a change" (your first post), then using analogRead with +SIG alone may be all you need to do (or +SIG and -SIG as per @Wawa).  No one here knows what "a change" means, since you haven't defined it.

silly_cone

Hooking up both outputs to two analog pins the way Wawa described worked well.  It doesn't have to have a great-resolution.  If I'm able to detect a pressure change of a small number of PSI, that is sufficient.  And this setup achieves that: if I connect a tube to the chip's inlet port and the other to a syringe, the analog difference value rises from 21 to over 30, and approaches 0 if I pull a vacuum.

One thing I'm wondering, though, is this is an absolute pressure sensor with a range of up to 15 PSI.  But atmospheric pressure itself is ~14.69 PSI.  So does that mean the sensors is basically maxed-out in atmospheric conditions?

silly_cone

#13
Oct 11, 2018, 04:39 pm Last Edit: Oct 11, 2018, 07:51 pm by silly_cone Reason: added schematic and results from attempts
okay, please excuse one more stupid question....

I'm still not comfortable with my understanding or use of op-amps, but I did find a package of LM358N (datasheet) and MC1458 (datasheet) op-amps in my toolkit.  Will these be at all useful with this sensor?  I'm looking at the datasheet, but like I said, I'm still not sure what it is I'm looking at exactly (I learn far better through example), so any tidbits anyone can share would be much appreciated to help it all come-together for me.

From what I've read so far of the various ways op-amps can be set up, it sounds like I need to use it as a differential amplifier of the two outputs of the SM5420 to get a single analog value that reflects the difference between the two inputs.  Is that correct?

{edit - tried some stuff out}

Okay, I made some progress.  Right now I have things connected as shown in the schematic below.  I originally started out with R1 and R2 both equal to 51K, then switched one resistor to 100K (tried it in both places) and tried it again, and seem to have improved resolution.

With each resistor placed as shown in the schematic, analogRead() returns a consistent value of 307-308 with a range of approximately +/- 210.  If I swap resistor positions, then it analogRead() returns a value of 650-651, but with a range of only about half the other configuration.




So, functionally it seems okay, but I'm sure there are ways to optimize, and I'm still not real clear on how I would go about intentionally dialing-in the gain/range other than "let's see what happens if I...", and then after enough trials I'll pick up on the pattern.

Also, are there places I should place any caps to smooth the output?  

Wawa

Wrong diagram for a Wheatstone bridge sensor.
You need an instrumentation amp (three opamps).
Leo..

Go Up