Shop OBEX P1 Docs P2 Docs Learn Events
Pressure sensor — Parallax Forums

Pressure sensor

Mike15Mike15 Posts: 109
edited 2006-04-15 04:08 in Learn with BlocklyProp
·I am using the Motorolla MPX4115 and a MAX 187 ADC.·I have it wired as shown in the attachment, but when I run my program is 4095.

SCLK CON 6
CS CON 7
SerData_in CON 8
adc VAR Word

main:
GOSUB convert
GOSUB print
GOTO main

print:
DEBUG DEC adc, CR
RETURN

convert:
LOW CS
SHIFTIN Serdata_in,SCLK,MSBPOST,[noparse][[/noparse]adc\12]
HIGH CS
RETURN

·I did have a little trouble finding the data sheet for the MPX4115 And never found a pin out for the side port version but using the reference notch and the other pinout I gather this is what its should to be:
·· 1 - N/C
·· 2 - Vs
·· 3 - Gnd
·· 4 - Vout
·· 5·to 8 -·N/C

Any help would be extremly helpful

Thanks
658 x 537 - 39K

Comments

  • Robert@HCCRobert@HCC Posts: 80
    edited 2006-04-09 08:29
    take a look at this link: It uses the same components as you are working with - http://geocities.com/SiliconValley/Orchard/6633/altimeter.html

    Also, attached below is the PDF I have for that pressure sensor, it lists data for a few different body types w/pinouits for the MPX4115.

    I've got that pressure sensor/ADC/OPAMP setup at that link working in the past - however, I am also trying to get just the pressure sensor/adc working with the BS2 for my application with no luck. Please post any results ( good or bad ) that you come up with, as I would be very interested [noparse]:D[/noparse]

    Alohas and hope that link helps!
    Robert

    Post Edited (Robert@HCC) : 4/9/2006 8:34:54 AM GMT
  • Mike15Mike15 Posts: 109
    edited 2006-04-09 21:08
    How well did it work with the OPAMP? I am trying to determin altitude of a rocket.
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2006-04-09 21:43
    At first glance, it looks like the REF pin is not connected to anything but a 4.7uF cap.
    You need to either tie this to +5V or another regulated supply. Check the PDF on the
    MAX IC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Mike15Mike15 Posts: 109
    edited 2006-04-09 21:57
    I have another MAX187 connected in the same fashion to an ADXL 178 accelerometer and it seems to work. Would this mean my accelerometer data is wrong?
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2006-04-09 22:11
    Looking at the datasheet, it looks ok. ( Figure 3a on page 9 )

    http://www.vincenzov.net/datasheet/MAX187_M.PDF

    Figure 3a on page 9




    I just saw the REF connected to a cap in your diagram and it looked odd to me.
    Usually a reference is provided externally.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Mike15Mike15 Posts: 109
    edited 2006-04-10 02:40
    So here is my conclusion. I get an output of 4095. checking the data sheet this is 120 kPa.
    Which would place mee at an elevation of about 1700ft. Checking the elevation of my location this would be correct.

    So in short the voltage at Vout decreases with elevation?
  • iamscottymiamscottym Posts: 30
    edited 2006-04-10 03:29
    well yes, since elevation is inversely proportional to pressure, which is proportional to Vout.
  • Robert@HCCRobert@HCC Posts: 80
    edited 2006-04-10 06:32
    Mike said...
    How well did it work with the OPAMP? I am trying to determin altitude of a rocket.


    Mixed results (mostly because of my limited but growing electronics knowledge), but usually fairly accurate for my location. According to the author, he gets better resolution with the OPAMP. I will be using the sensor much as you are - except I will be determining altitude of a payload ( CanSatellite) released from a rocket after a short freefall. I need altitude info so I will know when to release the parachute for the payload.
    Ever heard of ARLISS?

    If I have tinme later in the week, I may hook up my MPX4115 and MAX187 as you did and see if I get similar results. Will post data if I can.

    Anyways, a bit of code attached - contains a calc to convert ADCIN data to pressure (offset is error correction ,contained in datasheet) , perhaps it may be useful.

    Alohas,
    Robert
  • Mike15Mike15 Posts: 109
    edited 2006-04-10 17:54
    ·Thanks for the help. I am also interested in the CanSat program. Where can I find more info?
  • Mike15Mike15 Posts: 109
    edited 2006-04-10 20:12
    Also if you might have a breif description of the math?

    P = (ADCin*/1991/10+7744)+offset
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2006-04-10 23:58
    Mike15,

    Have you tried something like this as a sanity check to make sure that your ADC is working properly?

    Here is a link that covers some of the basics of Analog to Digiital conversion:

    www.parallax.com/dl/docs/books/edu/baad.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 4/11/2006 1:50:58 AM GMT
    579 x 387 - 44K
  • Robert@HCCRobert@HCC Posts: 80
    edited 2006-04-11 00:33
    Beau, can you please give a brief description ( for the slightly less informed like me [noparse]:)[/noparse] ) of what that schematic does? looks like it tests the adc, and looks like it would be useful for me as well. [noparse]:)[/noparse]


    Mike,

    For the math, you need to find answers among the wiser here, my downfall is maths - the calc is from the website I posted above. Worked for me, so I just trust in the other guys work...err...working [noparse]:D[/noparse] P is pressure, adcin is the input to the ADC from the P.sensor and the offset is an error correction for the pressure sensor. The rest, I assume, is what is needed to convert the raw data to Kpa x100.


    As for CanSat, http://home.honolulu.hawaii.edu/~robertal/Cansatpics/hcc_cansat_04_05/HCC_CanSat_04_05.htm ( HCC'S cansat project last semester) , http://www.arliss.org/ . http://www.aeropac.org/ , http://www.cansatcompetition.com/ are good places to start. there are quite a few sites out there, google CanSat. Its is a college level project usually. Basically, sensors, a microcontroller and RF modules are packed into a twelve oz soda can, a parachute is attached , and the "CanSatelite" is deployed from a rocket. A ground station computer recieves the data from the sensors via rf. For the ARLISS competition, the main requirement is to autonomously maneouver the cansat to a predetermined GPS location on the ground. First team within 50 meters of the target gets 6000.00usd! [noparse]:D[/noparse]

    Since you are into rockets, take a good look at the aeropac site! some really awesome high-powered rocketry! They also provide the rockets for the ARLISS comp.,launching cansats 8000 -12000 feet up!
  • evergreenevergreen Posts: 43
    edited 2006-04-15 04:08
    mike15 said...
    So here is my conclusion. I get an output of 4095. checking the data sheet this is 120 kPa.
    Which would place mee at an elevation of about 1700ft. Checking the elevation of my location this would be correct.

    So in short the voltage at Vout decreases with elevation?

    Mike, are you sure that's right? If you're using a 12 bit ADC, then your max reading would be 4095. And if that's your max, then it means you can't measure an altitude below 1700'...

    I'm also working on an altimeter for a rocket project!
Sign In or Register to comment.