MPXA4115A picbasic code


Closed Thread
Page 1 of 3 123 LastLast
Results 1 to 40 of 104
  1. #1
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326

    Default MPXA4115A picbasic code

    Good day to all,
    I am searching for a reference picbasic code to get pressure from a Motorola MPXA4115A absolute pressure sensor.
    Did someone write such a code ?
    thanks
    Ambrogio

    Edit from Moderator:
    A Wiki has been created from some of the posts in this thread. It is located here: http://www.picbasic.co.uk/forum/cont...-picbasic-code
    Last edited by ScaleRobotics; - 8th June 2010 at 15:45.

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


    Did you find this post helpful? Yes | No

    Default

    Darrel has the basic formula here: http://www.picbasic.co.uk/forum/showthread.php?t=182
    http://www.scalerobotics.com

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    It's been a few years since that thread. Don't even remember doing it.

    However, I think pt3rg asked the wrong question back then.
    I'm sure he also wanted to convert the A/D reading from the sensor to a pressure value.
    May be why he never came back.

    With the formula for Vout ...
    Vout = Vs*(0.009*P - 0.095)

    For 10-bit A/D and 1 decimal, the reverse would be
    P = ADC * 0.1086 + 10.6

    -- OR --
    Code:
    ADCIN 0, ADval
    P = ADval * 1086
    P = DIV32 1000
    P = P + 106
    
    LCDOUT "P=",DEC P/10,".",DEC P//10,"kPa"
    hth,
    DT

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default MPX4115A Calculator

    In case you didn't want 10-bit A/D with 1 decimal place in kPa ...

    This should cover the other possibilities.
    http://www.pbpgroup.com/Calculators/...A/MPX4115A.htm
    <br>
    DT

  5. #5
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel for your very professional reply on the matter.
    I saw your last post just now.
    I think your assistance is great for all people in the forum.
    Regards,
    Ambrogio
    IW2FVO
    North Italy

  6. #6
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default

    Hi Mr. Taylor,

    I am goping to prepare an home made weather station : this will be an hobby project for my small radio ham station.
    I have seen the pressure transducer calculator you have post to me: it is very interesting.
    I would like to use the PIC 10 Bit ADC instead of using an additional 12 bit ADC.
    I have considered that my home is at about 1050 ft above the mean sea level and the baro pressure will never change so widely. I have in mind to put the PIC ADC " -REF " to 3.75 Vdc and the ADC " +REF" to 5Vdc.
    The 3.75 Vdc is about 938 mB of presssure that has never been observed here in the years.
    In this case I will use 10 bit to read the voltage output from 3.75Vdc to 5Vdc.
    What do you think about that ? Do you recomand this solution ?
    If it will be Ok, what will be the final PICbasic code ?
    Thanks a lot for the interest.
    Regards,
    Ambrogio
    IW2FVO
    North Italy

  7. #7
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    I'll let Darrel help with the coding but, if you haven't used this sensor, you should be aware that decoupling its voltage supply line is critical (Figure 3 in the datasheet). Otherwise, it will be too noisy to make use of its output.

  8. #8
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default

    Thanks,
    any suggestion for a practical good decoupling of the power supply based on your experience ?
    Thanks
    Ambrogio

  9. #9
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    I used the 1.0µF and 0.01µF as well as the 470pF capacitor values shown in Figure 3 (Page 5) of the datasheet and the output was clean. Before adding them the output was wildly erratic. In my case, I used SMD ceramic caps.

  10. #10
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by iw2fvo View Post
    I have in mind to put the PIC ADC " -REF " to 3.75 Vdc and the ADC " +REF" to 5Vdc.
    The maximum VREF- is (VREF+ -2.0V). So with VREF+ at 5V, VREF- can be 3.0V MAX.

    I'll add the option to the calculator later tonight and see what happens.
    <br>
    DT

  11. #11
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel,
    I forgot the vref- constrain. So the VREF- will be 3Vdc.
    Ambrogio

  12. #12
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You're welcome Ambrogio,

    I've added the Vref+/- to the calculator.
    It should come up with a good formula for you now.

    I haven't figured out how to deal with the +/-1.8% error yet.
    So these numbers represent an "Ideal" sensor.

    MPX4115A Calculator
    http://www.pbpgroup.com/Calculators/...A/MPX4115A.htm

    Now I gotta go back and redo the MPX4250D for Walter.

    hth,
    DT

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    Did you find this post helpful? Yes | No

    Wink

    Hi, Darrel

    Handy tool, indeed !

    Could you add ( or allow ) the 4.096, 2.56, 2.048 and 1.024v "Classical" Vref values ( 3 decimals !!! ) ???

    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 " !!!
    *****************************************

  14. #14
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Could you add ( or allow ) the 4.096, 2.56, 2.048 and 1.024v "Classical" Vref values ( 3 decimals !!! ) ???
    Done.

    MPX4115A Calculator
    http://www.pbpgroup.com/Calculators/...A/MPX4115A.htm

    Hit refresh if you already have the page open.

    DT

  15. #15
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default

    Darrel,
    it is a very usefull calculator: thanks again.
    I will use a 5Vdc Vref+ and a divide by resistor divider for Vref-. Could it be OK ?
    Is there any possibility to compensate for the accuracy error ?
    ( I am not familiar with those sensors .. ).
    Thanks,
    regards,
    Ambrogio
    IW2FVO
    North Italy

  16. #16
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Resistors will work fine.
    It's difficult to get exactly 3.0V using standard values, but with a 4.7K and 6.8K divider, you'll get about 2.96V. Use 1% or better resistors.

    These pressure sensors are "Ratiometric" which means that their output voltage changes proportionally to the power supply voltage. So using resistors allows the Vref to change with the power supply voltage too, which is a good thing. A voltage reference that does not change with PS differences can cause incorrect readings if VDD is not exactly 5.00V. Many 7805 type regulators will be anywhere from 4.85 to 5.15V

    For the accuracy, each sensor will be off by a different amount up to 1.8% of full scale.
    You would need to take readings from the sensor being used at both the high and low ends of the range, and compare them against values read by some other device that is known to be calibrated.

    The slope and intercept can then be recalculated for the measured values to create a new formula for that specific sensor. The calculations can be done with the PIC, but I wouldn't recommend it. Or you can do the calculation manually and just enter the slope and intercept into the PIC for that specific sensor.
    DT

  17. #17
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    And if you need more resolution - you can use an 18F8723. They have 12 bit A/D's.
    Charles Linquist

  18. #18
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I've updated the Calculator again to include a Calibration section at the bottom.

    Once you have test data for a sensor, it will calculate the new slope and intercept.
    Be sure to set the number of decimals at the top, it affects the calibration numbers.

    Cheers,
    DT

  19. #19
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    Did you find this post helpful? Yes | No

    Wink

    Hi, Darrel

    This tool is becoming from good to better and better !

    Just one point :

    Don't you think, for a 10 bits ADC i.e., the LSB is Vref / 1024 and not Vref /1023 ???

    as 0 is 0v and 1023 is NOT Vref ( see µChip apps ...), but Vref x 1023/1024 ...


    Not so big an error ... but for those looking for the 224th bit error !!!

    and it is neater tho get exact 4 mv/bit for a 4.096 v ref. ...


    BTW ... I think ! ( yes ... I can ! ) ...

    What about a " Mouseover " on the graph to show the Pressure and AD Count values pointed at ???

    Regards

    Alain
    Last edited by Acetronics2; - 17th May 2009 at 10:52.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  20. #20
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Actually, it's 1024 bits, but you include ZERO, so the range is 0-1023.

    But your math is always divided by the MAXIMUM (Full Scale) value (which is 1023).

    That is because there are 1023 equal portions of whatever you are dividing up to make your whole. Zero is not a portion! I'd get the hump (big-time) if I went into Maison Alain (French Restaurant) and got the Zero portion of the Cream Cake!

  21. #21
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    Did you find this post helpful? Yes | No

    Default

    Hi, Mel

    I found that in the MAX 1241 datasheet:


    Output Coding and Transfer Function

    The data output from the MAX1240/MAX1241 is binary,
    and Figure 10 depicts the nominal transfer function.
    Code transitions occur halfway between successiveinteger
    LSB values. If VREF = +2.500V, then 1 LSB =
    610μV or 2.500V/4096
    This is not the first ADC datasheet where i've found that ...

    from MAX 187


    Output Coding and Transfer Function

    The data output from the MAX187/MAX189 is binary,
    and Figure 10 depicts the nominal transfer function.
    Code transitions occur halfway between successive
    integer LSB values. If VREF = +4.096V, then
    1 LSB = 1.00mV or 4.096V/4096.
    From MCP 3202


    4.2 Digital Output Code

    The digital output code produced by an A/D Converter
    is a function of the input signal and the reference voltage.
    For the MCP3202, VDD is used as the reference
    voltage. As the VDD level is reduced, the LSB size is
    reduced accordingly. The theoretical digital output code
    produced by the A/D Converter is shown below.
    where:
    VIN = analog input voltage
    VDD = supply voltage
    Digital Output Code = 4096 * VIN / VDD
    From MIC 640 ( a pre-programmed 12F675 )


    · Résultat = 256 x VIN/VCC où VIN est la tension d’entrée et où résultat est arrondi à
    l’entier le plus proche.
    Ainsi par exemple, si VCC = 5 volts et VIN = 3,5 volts, le résultat de la conversion sera :

    Résultat = 256 x 3,5 / 5 = 179,2 arrondi donc à 179 soit encore B3 en hexadécimal.
    so, I'm a bit confused, here ...

    Regards
    Alain
    Last edited by Acetronics2; - 17th May 2009 at 11:49.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  22. #22
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I'm sorry, bit I'm going to 'DISAGREE' with them ALL...

    Common sense...

    Let's go to the extreeme... a ONE BIT ADC... (the kind every PIC has on every I/O Channel)...

    Are you going to consider your I/O pin as having TWO states ZERO and ONE?

    Well, I suppose it has got two states... so the 'ADC' range is 0-1.

    So therefore whenever I use TWO in my calculations I can never get any more than 50% of the true answer? So with 5v as my VREF, I'll never get more than 2.5v in the calculations with an input state of 1. I must get an input state of 2 before I get 5v... Kinda tough getting 2 out of 1 bit!!!!!!!!

    Are you dividing your 'cake' into 1023 or 1024 portions?

    Is your range 1024 portions ie 1/1024 all the way to 1024/1024??? No it's not because 1024 is an INVALID number, you NEVER get 1024 out of your ADC... your range is 1/1023 all the way to 1023/1023 because 0/1023 although being the 1024th value is not counted when dealing with mathematical equations.

    Taking what you read as Gospel without question is what crashes Mars Landers...

    Yes... this is a 'simplistic' view, because many chips have peculiarities which have to be additionally accounted for (like for example not being true rail-to-rail)... what I am arguing is pure mathematics here.

  23. #23
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Melanie,

    I usually illustrate this with a short staircase of 4 equal steps. The bottom level is 0 and the top is 4. While there are 5 levels (0-4), there are only 4 steps (or intervals) each of which is 1/4 of the total height. It you let people draw and number it themselves, it sticks with them longer.

  24. #24
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    Did you find this post helpful? Yes | No

    Wink

    Gosh ...

    One more manufacturer ( Linear ) in error ?? ...



    But here ... he shows output number vs input voltage


    look at this joined piece of datasheet ...

    Code "1023" is NOT corresponding to Vref ... but Vref MINUS one LSB ...

    so ... Vref corresponds to code "1024" !!! and there are 1024 steps, the "1024" value never being displayed ...

    May be the explanation is here ...

    Alain
    Attached Images Attached Images
    Last edited by Acetronics2; - 17th May 2009 at 13:30.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  25. #25
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Well, in this instance ADCMAX is correct because VREF is never attainable.

  26. #26
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    Did you find this post helpful? Yes | No

    Wink

    Hi, Mel

    ...

    and I do think it's the same for all the manufacturers ...

    just have a look to µChip AN 544d ... or the Midrange Manual ... they all show code $3FF for 1023 LSB ... not Vref , which is 1024 x LSB ! ( see § 23.12 )

    Would be interesting to verify which input voltage give code 255 for a 2.56v ref ( quite simple !) , ... give code 4095 for a 4.096 v Vref ( less simple ), etc, etc.

    don't you think ???

    Regards
    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 " !!!
    *****************************************

  27. #27
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I agree with Melanie.

    Let's forget about what the overpaid engineers and datasheets have said, and look at it from purely a results perspective.

    With 10-bit A/D the resulting values go from 0 - 1023.
    If Vref=5.00V and you apply 5.00 volts to the A/D you get a reading of 1023.

    If you then use 1024 as the Vref divisor, the formula to calc the Voltage from the A/D reading would be ...

    5.00/1024 * 1023 = 4.99 ; Not the 5V we were looking for.

    But if you use 1023 ...

    5.00/1023 * 1023 = 5.00 ; this is what I want it to read.
    &nbsp; Notice how the (/1023 * 1023) cancels out.

    In the context of this thread, the results are similar.
    If the manufacturer states a pressure of 115kPa at 4.7V ... using 1024 with a 4.7V input, you will only read 114.xxkPa, again not the reading we wanted.

    So for this (and any other analog projects), I'll continue using the maximum ADC value for the divisor (255, 1023, 4095).
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Smile

    Hi Darrel ,
    hi Acetronics (It's me bitmaniac from rcgroups -navlights)

    I am in the progress of developing my own ALT timer for F5J category
    I want to deactivate/arm a mechanism at 300m for example.

    I am using MPX4115A a max187 (12bit) and a pic to read altitute.

    thought #1: I wonder if I can use an eeprom to store look up table of all alt values you can meat here in Greece (0m to 3000m max) and not use extensive calculation to determine alt.

    thought #2: Also I am thinking of just usin ground kPa - specific height kpa and the difference (in kPa) gives me the heigth I want to calculate.

    Are my thoughts correct or I miss something?!!

    Thank you for your time my friends!


    .

  29. #29
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    Did you find this post helpful? Yes | No

    Wink

    Hi, Alexandros

    Nice to hear from you !!!

    Good choice for sensor and ADC ... also think to MPX 6115 and LTC 1286 , that also are good choices ...

    for the tow release mechanism, no big soucy. just think the Zeroing command will be used very often, so it must be really handy ...

    lookup tables will be the simplest solution, linear approx between two table values will be enough, as the goal is not to reach EXACT altitude, but everyone being released at the SAME altitude ...

    Also think the pressure value will need some smoothing: if some air intake in the nose of the gliders ... measure will be false if no mean value calculated.

    I join you a small handy tool to create the lookup table ...

    Read you soon
    Alain

    PS: AZLights have been also seen aboard jet models ... ( a nice "Rafale", between others ... )
    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 " !!!
    *****************************************

  30. #30
    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...

  31. #31
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    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 " !!!
    *****************************************

  32. #32
    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

  33. #33
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    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 " !!!
    *****************************************

  34. #34
    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

  35. #35
    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

  36. #36
    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 18:14.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Talking

    @scalerobotics

    Of course you have not notice that in the last attached XL I upload there are three XL sheet in the file 10,12,14bit

    Test it

    My only concern is what method to choose (to start building) pic A/D with oversampling tehnicue , 12bit MAX and pic or DIF AMP + MAX + pic?

    I cannot decide yet.

  38. #38
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,619


    Did you find this post helpful? Yes | No

    Default

    Hi, Alexandros

    I'd recommend you to read the Freescale AN 1646 ...

    Interesting matter !

    take care to the LM 358 output voltage range ... I think it's not the good choice ...
    LMC662 or AD 623 would be better ...

    Have a good Evening

    Alain
    Last edited by Acetronics2; - 3rd June 2009 at 20:42.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  39. #39
    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
    @scalerobotics

    Of course you have not notice that in the last attached XL I upload there are three XL sheet in the file 10,12,14bit
    Actually, I did notice, and it looks to be 100% correct. I am only pointing out that the increments with the 14 bit is 0.553 meters (near sea level), and not the ~1 meter that you mentioned in your previous post.

    Thanks,

    Walter
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    I just tested Darrel's oversampling, using the MPX4115a and a PIC12F675 that I quickly soldered up, and it works very well. I just used the two capacitors on the power side of the MPX4115a, like the data sheet shows, but with no filter capacitor on the output. Even at 16 bit resolution, the A/D output values only varied by +/- 1 digit. It varied more when I breathed though! 16 bit is really sensitive!

    My vote is for oversampling, parts count is at 6, running the board from the power of the PicKit2.

    Pic12f675
    3 capacitors
    mpx4115a
    20 mhz resonator
    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, 07:01
  2. 16f887 44 pin demo board code problem?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th December 2008, 15:17
  3. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 19:31
  4. PicBasic code problems with a 16F84A
    By Lauren Barta in forum mel PIC BASIC
    Replies: 3
    Last Post: - 30th May 2006, 23:50
  5. PicBasic Fundamentals
    By Billyc in forum General
    Replies: 9
    Last Post: - 4th May 2004, 11:04

Members who have read this thread : 1

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