MPXA4115A picbasic code


Closed Thread
Results 1 to 40 of 104

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61


    Did you find this post helpful? Yes | No

    Default

    hi Alain how are you my friend pleased to here from you again...

    In our point now...
    Well I will stick to MPX41154 and max 187 already ordered.
    I am in the proccess of making/simulating the pcb.

    Well I think will follow the table lookup method (although there will be one more chip (eeprom) in the pcb) but I have first to solve the equation you send to calculate meters instead of milibars.
    ..and better to kPa and not milibars.

    I will let you know of my progress...

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by bitmaniac View Post

    Well I think will follow the table lookup method (although there will be one more chip (eeprom) in the pcb) but I have first to solve the equation you send to calculate meters instead of milibars.
    ..and better to kPa and not milibars.

    I will let you know of my progress...
    Hi, Alexandros

    I think the best way for the lookup table is :

    1) @ first ... take, say 200 or 250 points to calculate with the Excel Sheet ... ( just copy the formula by selecting the lines where to copy ... )

    2) compare results by taking exact 50 points, and linear approx between those points and the exact 200 points you've already calculated .... notice 50 give more precision than required ... ( lol )

    3) Take 32 points and idem 2) ...

    4) Stop when satisfied ( 32 might be comfortable for 0 -3000 m range)

    Do you really think an external EEPROM is needed ??? ... The LOOKUP command stores data in the ... Program memory !!! ( as " retlw xx " lines )


    Now, I think XL sheet gives meters too ... no ???

    On my side I shall write an XL sheet for that purpose ... might be handy one day ...

    Good Evening
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61


    Did you find this post helpful? Yes | No

    Thumbs up

    Hi! Alain

    Sorry my friend but I hav not completely followed your idea.
    Do you mean sth like the attachment one?

    (ie: I have to 'expand' the range 200 , 50 and 32 'between' 0 - 3000 m I want to calculate?)

    I have to follow your idea, so help me out , as I can see you have a point here!
    Attached Files Attached Files

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi, Alexandros

    As a good drawing is worth ...

    see this XL sheet ...

    shows how things go on ...

    And Overall shows a differential amplifier is needed between Sensor and ADC, to get a good resolution ( see the very, very limited ADC result range ... if direct connexion ).

    Note @ sea level the 300 m altitude is less than .1 v change @ sensor Output. Not that good for noise impact on signal ...

    also note the mean value for altitude meters vs pressure change is precise enough for our use and so, we can consider it only depends on reference pressure @ ground level ... or even, that variation is linear ...

    From the datasheets, It looks the ADC ref ( V+ref - V-ref ) must be, at least 3 v ... no hope from the Vref- side.


    Another way could be to use the MS 5534 Intersema sensor, a NUMERIC output sensor whose resolution is ... 15 bits. Paying attention to noise would be cancelled too ...

    Note particular calibration data from factory is included in the chip memory ... so, no further calibration would be needed ...

    For the moment, I let you play with the calc sheet ...

    Alain
    Attached Files Attached Files
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    You may want to use Darrel's A/D Oversampling routine to get some more precision. It allows you to go all the way up to 16 bit, but you may want to stick to 14 bit. That would get you accuracy of about half a meter.


    http://sites.picbasic.net/component/...,70/pageid,73/
    Attached Images Attached Images  
    http://www.scalerobotics.com

  6. #6
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61


    Did you find this post helpful? Yes | No

    Default

    So... Acetronics

    *your XL was perfect for make me understand many things!


    After a lot of experiment and according to your very usefull XL I finally decide to two different senarios

    Acording to your XL (and 10 , 12 and 14 bit results attached to xl file below)
    the 'resolution' is at 10bit -> around 8m, 12bit -> around 2m and 14bit -> around <1m

    So I am thinking of
    1st. just use simple pic 10 bit adc and Darrel's oversampling method (thank you scalerobotics for the link)

    2nd use an LM385 for example dual amp and take just 'a window' od the mesurements of MPX4115 between 0-2300 meters

    3rd compine LM385 and MAX187 (12bit) to get better resoloution

    My onle concern is that as I want to keep pcb at minimum of costs / and parts count if Darrel oversampling method works , it would be Great!

    I let you know.

    I am in the progress of schematic and pcb design BUT I have to decide the method first!!
    Attached Files Attached Files

  7. #7
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bitmaniac View Post
    Acording to your XL (and 10 , 12 and 14 bit results attached to xl file below)
    the 'resolution' is at 10bit -> around 8m, 12bit -> around 2m and 14bit -> around <1m
    Not that it matters much, but in your graph, you are breaking it down to measurements every 0.10 mBar (not A/D conversion resolution). For every 0.10 mBar, your altitude changes by about 0.82 meters. However, this is not the resolution of your analog to digital converter at 14 bits. You will notice that from 0 to 22.13 meters altitude, your a/d conversion reading changes by 40. So ... 22.13 meters/40 = 0.55325 meters per 14 bit increment of your a/d converter. A lot closer to half a meter of resolution with a 14 bit conversion.
    Last edited by ScaleRobotics; - 3rd June 2009 at 17:14.
    http://www.scalerobotics.com

Similar Threads

  1. sample code for AT45DB642D in Picbasic Pro
    By itsssyam in forum General
    Replies: 0
    Last Post: - 10th March 2010, 06:01
  2. 16f887 44 pin demo board code problem?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th December 2008, 14:17
  3. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 18:31
  4. PicBasic code problems with a 16F84A
    By Lauren Barta in forum mel PIC BASIC
    Replies: 3
    Last Post: - 30th May 2006, 22:50
  5. PicBasic Fundamentals
    By Billyc in forum General
    Replies: 9
    Last Post: - 4th May 2004, 10:04

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts