Pressure sensor and MCU ADC

Well, I tried using the net to find a simple answer for this - without much luck, so thought I'd at least ask here again hoping that someone has done something similar.

What started this was my volunteering to make a grey water pump with auto cutout. I've at least created a board using an Atmel ATtiny13, pushbutton and relay. The timeout and pushbutton code is working, but I've yet to interface a pressure switch to an ADC input indicating lack of water pressure.

I was given an SX01DN sensor to test (see

formatting link
and please forgive my ignorance (or stupidity), but I really can't see how to interface this with an MCU without substantial op-amp circuitry. Even then, how to get an output range of 0-5 volts is still beyond me at this stage.

Any hints would be appreciated, any 'you d***head' messages not .

Cheers, Phil.

Reply to
philbx1
Loading thread data ...

formatting link

--
   W  "Some people are alive only because it is illegal to kill them."
 . | ,. w ,      
  \|/  \|/              Perna condita delenda est
---^----^---------------------------------------------------------------
Reply to
Lionel

In the PDF you mention, there's a circuit Fig V, page 5 and 7 to give ADC scaling and offset adjustments.

VO goes to the input of the ADC.

While it looks simple enough... your first instrumentation sensor project like this will be a challanage and ultimate reward if you get it going.

Joe

Reply to
Joe G (Home)

Phil,

I have done this with other makes of pressure sensor. More expensive devices have inbuilt amplifying circuitry however for yours you will need an opamp. With the right set of resistors you should be able to scale the data to 0-5V. The data sheet gives an example. For accurate values it needs temperature compensation also. You should be aware that your pressure sensor is not really suitable for contact with liquids and therefore you will probably need to isolate it. The usual method is with a bubbler. An aquarium pump will be OK for 1 psi

If you just want a cutout then a $10 float switch is the cheapest and easiest solution. Very simply on-off condition that can easily be read by one microcontroller pin.

Regards

Reply to
Peter

Thanks Joe G,

Much appreciated indeed. When I get it working I'll send you the project (only if you're interested of course).

I assume you watch 'Iron Chef' also :-).

Reply to
philbx1

Do you need to actually measure exact pressure, or do you just need know whether it's above or below some point? Considering your application, I think that making a proper pressure-measuring instrument is massive overkill. ;^) If so, I'd just connect one of the two outputs to a comparator & connect the other comparator to a trimpot. You'd need to measure the output voltage at the pressures you'll be using it with to see if it changes enough to detect reliably, & given that your switching doesn't sound like it needs respond very fast, I'd put a small (1nF?) cap between the output & ground to keep noise from causing false-triggering.

(Note that the two outputs are simply voltage dividers that go in opposite 'directions', so I'm guessing that a single output will give you half the volt/PSI output, compared to measuring the differential between the two outputs the way you normally would with a Wheatstone bridge.)

I'm not familiar with the Atmel MCUs, but if it has comparator input, you could use that, & if it's like some of the PICs & has a comparator that can be connected to an internal DAC, you could skip the trimpot & set the trip point in software.

(PS: you should probably still temperature-compensate the sensor anyway. I'd just use the simple 4 diode circuit on page 5 of the datasheet.)

--
   W  "Some people are alive only because it is illegal to kill them."
 . | ,. w ,      
  \|/  \|/              Perna condita delenda est
---^----^---------------------------------------------------------------
Reply to
Lionel

Thanks also Peter,

Nice idea with the bubbler BTW. I had thought of a float switch also, but then I wouldn't learn how to interface a pressure sensor, also I need to keep the complexity level high :-)

Much thanks again, Phil.

Reply to
philbx1

Hi Lionel,

Well, I was wondering why you previous message only contained a tag line, and after a bit of self-reflection assumed you were referring to myself.. "Some people are alive only because it is illegal to kill them." Anyway, after meditating on that for a while and hiding the sharp knives in the kitchen found that you had posted an excellent response.

That's exactly what I was after (excluding op-amps). Now working out how to do it is another challenge.

Thanks heaps, Phil.

Reply to
philbx1

Yes, sorry about that. I hit 'reply', & cleverly bumped the mouse button against one of the monitors whle the cursor was over the 'send' button.

I've been using this .sig for nearly ten years, you'd amazed at how good a net-kook detector it is. Every now & then, somebody takes it seriously, & thinks it's directed specifically at them. So far, each one of them has been a genuine nutcase, & their reaction is usually hilariously funny. The best ever was the infamous Archimedes Plutonium, who wnet into hysterics about my 'death threat' towards him, & complained unsuccessfully to my Internet provider, then spent weeks spamming the net-abuse administrative groups, trying to get me banned from Usenet. ;^)

Always a wise move. ;^)

Thanks Phil.

Don't thank me too loudly until it's working. The one thing I'm not sure about is whether you'll get enough voltage swing on one output to reliably switch a comparator, & noise might be a problem. The rest of my advice should be reasonably reliable, insofar as that's possible without me actually breadboarding & debugging it.

OTOH, if all goes well, you can shout me a beer if our paths cross. ^)

--
   W  "Some people are alive only because it is illegal to kill them."
 . | ,. w ,      
  \|/  \|/              Perna condita delenda est
---^----^---------------------------------------------------------------
Reply to
Lionel

Another method in the 'Kiss' principle, is to use a pressure switch from a dishwasher or washmachine. No electronics or pics, it just switches the mains directly and is very reliable !!

--
Cheers .......... Rheilly P
Reply to
Rheilly Phoull

Excellent suggestion, Rheilly.

--
   W  "Some people are alive only because it is illegal to kill them."
 . | ,. w ,      
  \|/  \|/              Perna condita delenda est
---^----^---------------------------------------------------------------
Reply to
Lionel

formatting link

Intersema manufactures a range of pressure sensors with digital outputs, obliviating the need for any analog amplifier or buffer circuitry. We used their MS5534 with great success. Pricey though.

formatting link

A simple pressure switch, or a float switch should be a more cost effective solution.

Reply to
dmm

Thanks dmm,

Yep, pricey is good if it's not a hobby project and the idea of a pressure switch is sounding like a better option.

Another option my mate with less electronics knowledge than myself (if that's possible) suggested is 2 pin probes close together into the water outlet pipe at a high point. I think that may just work in this case.

their

solution.

Reply to
philbx1

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.