Shop OBEX P1 Docs P2 Docs Learn Events
Parallax's New Altimeter/Barometer Module - Page 4 — Parallax Forums

Parallax's New Altimeter/Barometer Module

124»

Comments

  • RosevilleRobRosevilleRob Posts: 4
    edited 2013-07-27 20:54
    Thanks so much. I haven't had a chance to work on this today but at least I know it's likely a setup issue and not the code. I will let you know how it turns out, thanks again!
  • graymelongraymelon Posts: 6
    edited 2013-07-30 14:43
    I'm trying to use the MS5607 sensor as an altimeter for an autonomous flying robot. I've connected the sensor to a BS2px chip after reading about the memory issues encountered with the regular BS2 chips. I tried running the demo I2C program that one of the mods posted using the same wiring setup as the attached picture. While the temperature reading is correct (~20C), the barometer reading is way off. Using my cell phone barometer, I determined that the pressure should be about 1009 mbar, which is consistent with the altitude chart that was linked above. The program is saying 0.08 mbar along with an "overpressure error." Debugging a little, the error comes from the temperature_correction_slope subroutine, but I'm not exactly sure what my problem is.

    I noted the light-sensitivity affecting other users' data, but even covering the sensor with some black foam did not alleviate the issue. In fact, covered or not from the light, the pressure reading is the same at 0.08 mbar and the error message is the same.

    I'd like to try to use the sensor as an altimeter, but first I need help diagnosing my barometric pressure problem. Have any of you had similar problems?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-07-31 21:09
    graymelon,

    Welcome to the forums!

    Maybe the parameters are not being read correctly from the barometer at initialization? Add a debug line to show you the value of the variable x0 just after the I2CIN command in the ms_read_params: subroutine. If those are all zeros or all 65535, then there is probably something wrong with the wiring. Do you have the pullup resistors installed?
    I2CIN 8,msadrs,[x0.BYTE1,x0.BYTE0]
    DEBUG CR,DEC idx, TAB, DEC x0
  • graymelongraymelon Posts: 6
    edited 2013-08-01 11:33
    I just tried what you suggested and x0 was 65535. I don't have any pullup resistors installed. I thought those were only necessary in SPA mode based off the other comments in this thread. Where/how do you suggest I install pullup resistors?

    Edit: Tracy, post #16
    For I2C mode, the pullup resistors on sda and scl are built into the module.

    I also should have mentioned that I am using a parallax 29124 altimeter module, not just the MS5607.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-08-01 13:25
    The #29124 does have internal pullups, so the problem must lie elsewhere. I don't think I ever tried my code with a BS2px, but it should work fine. You mentioned an attached picture--Was that something you had intended to upload? Also please upload the exact program you are using for test.

    The pin labeled "CS" selects the i2c address. It should be high (or input, or left open) to set the 8-bit slave address.
  • graymelongraymelon Posts: 6
    edited 2013-08-01 14:56
    Ah, I must have forgotten to attach the photos. Here you go. One overview and two close-ups.

    The program I'm using is the demo program you uploaded, Tracy, from post #30. I'll upload it again just to make sure I didn't make any accidental changes.

    Altimeter.bpx

    IMG_20130801_173449.jpg
    IMG_20130801_173511.jpg
    IMG_20130801_173517.jpg


    The 9V battery is connected to VIN and to the ground line on the lower edge of the board. VSS is also connected to the ground line.
    VDD is connected to the power line on the top edge of the board.
    I draw the 5V for VIN on the module from the VDD pin via this top edge.
    SCL is connected to PIN4.
    SDA is connected to PIN5.
    PIN8 is connected high to select IC2 according to the comments in the program.

    Thanks for your help!
    1024 x 768 - 113K
    1024 x 1365 - 173K
    1024 x 1365 - 194K
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-08-01 16:50
    You have sda and scl hooked to Stamp pins p5 and p4 respectively. Oops! I see that the program from post#30 is not at all clear, but the pin numbers for sda and scl have to be p8 and p9. Give that a try.

    The p series stamps have the native I2CIN and I2COUT commands, but they can only be used with the specific combinations for sda/scl:
    p0/p1, p8/p9, x0/x1 and x8/x9. The x pins are only available on the stamps with 32 i/o pins. In the program you have, the i2c interface is hard coded to p8/p9 for sda/scl.

    I apologize for the confusion, which is due to llegacy code from the SDI version of the program. I have a version "c" that ihas better comments and makes clear which pins to use. I'll find that and upload it later.
  • graymelongraymelon Posts: 6
    edited 2013-08-01 16:55
    Gotcha, I'll try that tomorrow and let you know how it goes!
  • graymelongraymelon Posts: 6
    edited 2013-08-02 16:18
    Alright, SDA is connected to pin8, SCL to pin9, and pin10 to high to set the msmode variable correctly. Yet, I'm still getting the same "overpressure error" and x0 is still reading out 65535 at the initialization step.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-08-06 13:05
    Hi Graymelon, Try this. It is my more recent program. It mentions the MS5803, but that is the same firmware-wise as the MS5607 that is on the Parallax #29124 module. This one defaults to using pins p0/p1 for sda/scl, and for the BS2pe.
  • RosevilleRobRosevilleRob Posts: 4
    edited 2013-08-07 18:17
    Tracy just wanted to let you know I got a new module and everything is working as expected. Temp and Pressure readings look accurate with your program, using SPI. Thanks again
  • graymelongraymelon Posts: 6
    edited 2013-08-08 16:36
    Hey Tracy, thanks for your help! I am now able to get correct temperature and pressure readings. How would you go about converting these values to altimeter data given that you can't simply mimic the equation for altitude in terms of pressure and temperature?
  • Hi,

    I have the Altimeter Module MS5607 and I'm using Spin code from the supplied Zip file. However, my results are showing negative pressure and altitude. Please see the attached screenshot. Does anyone have any idea what could be causing this?

    Thank you.

  • Christof Eb.Christof Eb. Posts: 1,213
    edited 2024-09-21 06:33

    Hi, perhaps if you post the datasheet, code and your circuit, somebody might be able to help.

  • GenetixGenetix Posts: 1,754

    amalfiCoast,

    It looks like you are running 29124_altimeter_demo.spin, so did you change the START method for your board and sensor?

    The code starts with a 5611 on a Quickstart.

      alt.start(alt#QUICKSTART | alt#MS5611, alt#BACKGROUND)
    

    The 29124 uses a 5607, so you would change that line to this:

    alt.start(alt#QUICKSTART | alt#MS5607, alt#BACKGROUND)
    
    P8X32A QuickStart Board:
    -----------------------
    The module is assumed to be plugged directly into the inside row of the header connector strip
     at the very left-hand end (top in the illustration below).
     The P10 pin provides power; P12, a ground return.
    
     ┌───┐
     ┤   ├──────────────────┐
     │   │ ← USB Connector  │
     └───┘                  │
                            │
       ┌────────────────┬─┐ │
       │  #29124    CS •│=│ │  P0:P1
       │           SDO •│=│ │  P2:P3
       │   ┌─┐     SDA •│=│ │  P4:P5
       │   │ │     SCL •│=│ │  P6:P7
       │   └─┘      PS •│=│ │  P8:P9
       │ Altimeter VIN •│=│ │ P10:P11
       │  Module   GND •│=│ │ P12:P13
       └──────────────┬─┘=│ │
                      │= =│ │
                      │= =│ │
                      │= =│ │
                      │= =│ │
    
    

    https://www.parallax.com/product/altimeter-module-ms5607/

  • Hi Christof Eb. & Genetix,

    Thank you very much for your replies. I believe I did change the applicable line to the: alt.start(alt#QUICKSTART | alt#MS5607, alt#BACKGROUND), but I am on travel this week and will confirm when I return this weekend.

    Also, I am using the Propeller Activity Board WX, not the P8X32A QuickStart Board. I'm assuming this does not matter, as long as I correctly wired up the module. I will also confirm this and post a picture of my circuit when I return.

    Thank you again.

    David

  • GenetixGenetix Posts: 1,754

    amalfiCoast,

    Unfortunately the Demo does not have a PAB (Propeller Activity Board) configuration but you can easily wire it up for a QuickStart.
    P10 ---> VIN
    P12 ---> GND
    P6 ---> SCL
    P4 ---> SDA

Sign In or Register to comment.