MPXA4115A picbasic code


Closed Thread
Results 1 to 40 of 104

Hybrid View

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

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

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

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

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


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

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

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

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    Hi, Scalerobotics

    Could you tell us what it shows for some close to another calibrated pressures ( water column i.e.) I'm really curious about this "oversampling method" application ...

    And moreover after having carefully read the relevant AN 1152 from Microchip ...

    Alain

    " Surely overpaid Engineer ... ( lol ) , but Graduate Engineer ... "
    ************************************************** ***********************
    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 " !!!
    *****************************************

  9. #9
    Join Date
    Nov 2007
    Location
    South-West of Australia. A small town called Denmark. 'Where the forest meets the sea.'
    Posts
    136


    Did you find this post helpful? Yes | No

    Default A/D and the number of bits/levels

    I don't see the problem with dividing by 1024?
    The process is quantising a variable. Say our variable voltage lies in the range 0 to 10 Volts and we have one bit to use for the digital result of the quantising (2 to the power of 1 = 2, so we have two levels to play with):

    A. The result 0 means that the voltage was in the range 0 to 5 Volts (not that it was zero).
    B. The result 1 means the voltage was in the range 5 to 10 volts (not that it was 10 volts)

    So each level is 10/2 volts wide. Not 10/1 volt wide.

    The bit of cake after carving it up into portions has a slice 0 - it is not any smaller than any other slice.

    This is not jibberish created by highly paid engineers it is simple maths.

    I wonder how many devices you have launched on the world that are happily 'over' measuring analog quantities by assuming that each slice is bigger than it actualy is?

    Kind regards to you all

    Bill Legge

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