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

    @Acetronics
    VERY good infos in AN thanks for sharing!

    @ Scalerobotics

    You have done excellent job That was exactly I was thinking to do trying oversampling on 12f pics! so you did the job for me THANKS!

    So the conclusion is that we can use 12f675 ir 12f683 as I want to just measure an alt difference of 200m

    I did some calculation and I have attaches 2 XL one is the previous 10,12,14bit calculation and bolded out the 200m measurements just to see what is going on and the second one is use pic 10bit ADC but with Dual AMP LMC662 (Acetronics suggestion) to give a narrow-window measurements and the resolution improved to about 4m .

    Also attached a fast schematic of my thoughts (not checked , improvements are welcome!)

    Final conclusion I take the amp route or MPX connected directly to pic (with oversampling). I think as I will only want to measure 200m difference. the pcb must/and can be kept simple (low weight) and low part count.

    (dual amp trick: first subtracts 2.5V from MPX vout and the result is multiplied by 3 , so we have a range just from
    0-2300meters but better resolution for 10bit pic adc -see AZAltitude10bit_DUALAMP.xls)

    Scalerobotics about oversampling on 12f do you think you can 'go with' just the internal 8Mhz rc oscilator or it will not do the trick?!
    Attached Files Attached Files
    Last edited by bitmaniac; - 4th June 2009 at 11:03.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    bitmaniac, Check your J1 and J2 power wiring....

    Dave Purola,
    N8NTA

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Dave View Post
    bitmaniac, Check your J1 and J2 power wiring....

    Dave Purola,
    N8NTA
    Oh! you have a sharp eye!
    I told you it was a fast schematic he!he!

    corrected.

  4. #4
    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 about oversampling on 12f do you think you can 'go with' just the internal 8Mhz rc oscilator or it will not do the trick?!
    You can go with the internal, but at least on the 12F675 you have 4mhz internal, so your conversions are a little slower. See the TAD vs device operating frequencies part of your schematic. 1.6 us if fastest. Looks like 4mhz would be 2.0 us. So as long as you are not using 16 bit, you probably won't notice the difference in speed, and you will save one more part in your part count.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    @scalerobotics

    I have import your code to Proteus Sim and playing around with your code.

    It seems to work ok (I have to use meters instead of feets here ).

    My MPX4115A arrived yesterday (4pieces) so it is time to make the real thing and figure out how it works. I am going to use my schematic ommiting the opamp and hope oversampling method works (12f683,internal 8Mhz,MPX,3caps -> total part count 5!)

    For the moment I put everythimg in SIM (i used 12f683 with internal 8Mhz) and here what I found:
    According to simulation at 50.400kPa I read 17646 feet ALT (lower limit) and
    at 99.900kPa I read 5 feet ALT (upper limit) that is with this code we measure aprox. 49,500Kpa difference. (two screenshots attached)

    Note: We must also use calibration data and/or Level0 default presure

    (Please note that in the sim I can only vary sensor kPa in .100 increaments)
    Attached Files Attached Files
    Last edited by bitmaniac; - 5th June 2009 at 08:22.

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


    Did you find this post helpful? Yes | No

    Default

    Sounds good. If you beat me to it, try it with and without C3. I am guessing it may work better without it. If not without, it may work best with a much smaller capacitor. That defies most filtering logic, but I think oversampling likes a little bit of noise. I can't find my 470pf, but I know they are around here somewhere.....
    Last edited by ScaleRobotics; - 5th June 2009 at 08:36.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    .....I can see your 470pf.... over there... yes there.....next to your Pickit2 he!he!

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


    Did you find this post helpful? Yes | No

    Default

    3d visualization of a test pcb attached...

    As you notice I didn't care much about the placement of sensor caps.
    Just wanted to see the size of the board and best placement of connectors

    (pcb measured... 45mm X 30 mm)

    PLEASE NOTE all connectors will be male (not as seen) except for the sensor that it will be soldered on board
    The sensor will be layed above C3 C2 and C1 (low profile cap)
    Attached Images Attached Images  
    Last edited by bitmaniac; - 5th June 2009 at 11:47.

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


    Did you find this post helpful? Yes | No

    Talking 1st try :SUCCESS

    SUCCESS!

    Scalerobotics your code worked ok.

    I put together a 12f675 , two caps on MPX supply pins , one 100n on pic supply pin one resistor to PC serial RX port and guess....

    I get 54-55m ALT here from our MPX4115 project on the desk.

    I also turned on my other project with a gps module next to it and I get 54-58m ALT!

    PERFECT right on the SPOT!!! I am very please with the result.

    May be we must also include a calibration initial setup.

    pic settings 4Mhz internal , Clk source Fosc/8 , Define ADC clock 2 (I will try 1 later) and ADC_SAMPLEUS 5.

    The only thing left to verify is the accuracy in meters.

    I am very happy now!

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