Creative Commons images are CC BY-NC-SA 3.0

14.95

added to your
shopping cart

quantity
In stock 227 in stock
14.95 1+ units
13.46 10+ units
11.96 100+ units

Description: Life has its ups and downs, so why not measure them? The MPL3115A2 is a MEMS pressure sensor that provides Altitude data to within 30cm (with oversampling enabled). The sensor outputs are digitized by a high resolution 24-bit ADC and transmitted over I2C, meaning it's easy to interface with most controllers. Pressure output can be resolved with output in fractions of a Pascal, and Altitude can be resolved in fractions of a meter. The device also provides 12-bit temperature measurements in degrees Celsius.

This breakout board makes it easy to prototype using this tiny device by breaking out the necessary pins to a standard 0.1" spaced header. The board also has all of the passive components needed to get the device functioning, so you can simply connect it to something that talks I2C and get to work!

Features:

  • 1.95V to 3.6V Supply Voltage, internally regulated by LDO
  • 1.6V to 3.6V Digital Interface Supply Voltage
  • Fully Compensated internally
  • Direct Reading, Compensated
    • Pressure: 20-bit measurement (Pascals)
    • Altitude: 20-bit measurement (meters)
    • Temperature: 12-bit measurement (degrees Celsius)
  • Programmable Events
  • Autonomous Data Acquisition
  • Resolution down to 1 ft. / 30 cm
  • 32 Sample FIFO
  • Ability to log data up to 12 days using the FIFO
  • 1 second to 9 hour data acquisition rate
  • I2C digital output interface (operates up to 400 kHz)

Documents:

Comments 74 comments

  • If you plan to use this with a Raspberry Pi, be warned that this chip doesn’t play nice with Raspberry Pi’s I2C bus. This is due to it’s use of “repeated start” in the I2C protocol (which Raspberry Pi can’t handle without bit-banging).

  • i have this module connected up to an arduino uno. 3.3VDC and using pins 4-5 and the example altimeter code. but i get incorrect readings for the pressure and altitude the temperature seems about right though.

    this is the output Altitude(m):-25.25 Pressure(Pa):262043.00 Temp©:23.75

    my current altitude is approximately +40m is there are value i need to change or is my sensor faulty?

  • I am looking for a altitude sensor to use in a model rocket that will experience 90g of acceleration. Will this sensor function in high acceleration applications? If not is there a specific type of altimeter I should look for?

    • I plan on using this sensor for the same purpose. I don’t think the readings would be affected much by the force of acceleration. You’ll just need to make sure that your sensor has access to the pressure outside by making a small hole in body tube someplace.

      I just uploaded a library to use this sensor with an mbed device. I’ll probably be using it with an LPC11U24 since the chip is only 7x7 in the 48-pin package. I was using a PIC32, but the smallest package I can solder for this chip is 10x10, which takes up a lot of board space. Plus I like the fact that the mbed compiler is online and you can switch to a desktop toolchain rather easily.

  • I just uploaded a library for this sensor for use with http://www.mbed.org devices. It was inspired by the Arduino example on this page. You can find it on the mBed website here.

  • I’m currently thinking about buying this sensor for a project. Does anyone know if this device needs any sort of calibration? If not, how does it manage to get such an accurate reading as stated in the product description?

  • Hi, my temperature is coming out right, but the altitude say -30 feet. Could I have a bad sensor?

  • Hi, I’m interested in using this sensor in a tracker device. I have a big doubt, this device would be used outdoors so it is going to be closed in a nylon case (waterproof). Would this sensor give accurate reading inside a case? I’m not sure if atmospheric pressure could be measured in this way. Thanks in advance

  • Is there anybody who hooked up this sensors together:

    • MPL3115A2 Breakout (this one)
    • HTU21D Breakout
    • TSL2561 Breakout

    All of them are 3.3V I2C, HTU21D and TSL2561 have an option to disable pull-up resistors, but looks like MPL3115A2 hasn’t got this option. Can I use MPL3115A2 pull-up resistors and disable them on HTU21D and TSL2561? Will I fry something with this setup?

  • Pressure(Pa):-999.00 Temp(f):-1766.20 Pressure(Pa):-999.00 Temp(f):-1766.20 I keep getting this. I have Triple Checked every connection. I don’t know how to fix this?

    • I also faced this problem. And solution was quite simple, I removed recommended 10k resistors and connect SDA and SCL directly to A4 and A5. Look what they suggest in hookup guide

      On an Arduino board connect the SDA pin on the breakout board to A4 and SCL to A5. If you’re using a 5V Arduino Uno we recommend putting 10k resistors in line to limit the 5V signal going into the sensor and prevent damage to the sensor. You can instead just use the built-in resistors if you are getting weird readings on the sensor.

  • Has anyone tried using this sensor with a Digispark or another microcontroller that uses the ATtiny85 processor? I am struggling to get the source code to compile, I have tried changing the Wire.h references to TinyWireM.h but I have had no luck.

    Is anyone able to help me out?

    Thanks in advance!

  • The 1kohm pull-ups installed on this breakout are quite strong. I’m running this through the PCA9306 level translator which already has 1kohm pull-ups for the 3.3V lines and given there is an MPU-6050 on the same I2C bus the combined pull-up (1kohm + 1kohm + 10kohm parallel) seems to be too high for the MPU-6050 which refuses to work when this breakout is attached to the bus..

    I’m guessing I could just go ahead and unsolder the pull-up resistors on this one to reduce the overall pull-up of the SDA/SCL lines?

    Interestingly the HMC5883L has no resistors installed at all, instead relying on external pull-ups often provided by the master. The pull-up policy seems to be a bit chaotic when it comes to these breakouts. :)

  • Hi, I’m currently trying to run the the example codes on my Arduino Mega 2560 but the output in the Serial Monitor is constantly giving me the maximum negative value: “Pressure(Pa):-999.00 Temp(f):-1766.20”, “Pressure(Pa):-999.00 Temp(f):-1766.20 Altimeter setting InHg:nan”, or “Altitude(ft):-3277.56 Temp(f):-1766.20” when I am running the library codes, and “æžfx†žx†x˜˜à˜x怘€ê&¿õËPäeËj1”… when I am using the Example Code. I have made sure to connect Vcc to 3.3V, Ground to Ground and SDA directly to A4 and SCL directly to A5. Any help would be much appreciated! Thank you.

    • -999 indicates that the I2C communication has timed out. The max timeout is 600ms when waiting for an initial I2C response and 100ms when reading the data from the sensor. If you’re seeing -999 it’s probably because something is not wired correctly. Double check your connections.

      I just updated the tutorial with this info. Sorry it wasn’t in there before.

      • I have check my connections multiple times, first running wires just through the holes, then wrapped wires around the holes and finally soldered the breakout board to headers and then used a breadboard to make my connections. I have made sure that each wire I am using was conducting my doing a simple analog read from 5V and 3.3V into an analog port (4) and I have changed them up. When looking at just the 3.3V output I’m reading about 3.18V (653 / 1023). I can try another ardunio but I’m not convinced that that will help at this point. When doing a straight analogRead(A4) when everything else is connected I am just seeing the supply voltage. I will go double check now but after soldering I had checked to make sure that solder wasn’t connecting to pins together and it didn’t seem to be the case.

        • Hmm. You’ll need to solder wires or headers to the board. Inserting or wrapping wires around the holes won’t provide a sufficient connection. Be sure that SDA->A4 and SCL->A5 go to the correct pins. Be sure you have 3.3V and GND connected.

          Please drop techsupport@sparkfun.com an email as well. They are super helpful and can troubleshoot things in much more detail.

          • Looks like the problem was that for the Mega, SDA is on pin 20 and SCL is on pin 21. (Facepalm)

            • Hi, could you please tell me how you were able to adjust the code to work with the Mega??? I’m working on a project that uses the Mega board to communicate with this sensor. I’ve connected it to pins 20 and 21 but still get weird readings…….

    • -999 indicates a timeout error. In several places, there is a counting loop containing a 1ms delay. The timeout is too quick. When the count reaches the limit, -999 is issued. Increase the count by several hundred. Look at the Weather Shield example’s MPL3115A2.cpp.

      • Unfortunately when I went into the MPL3115A2.cpp and changed the delays to 100 and then 300 after a few seconds I would still get the timeout error (-999.00 pressure).

        • My comment refers to the example code for the Breakout Board (above) which does not use the cpp, but has similar code. In the cpp for the Weather Shield, some of the limits are up to 600, I believe. I put a Serial.println (“E1”), etc. on each loop to figure out which ones were timing out and experimented with the values.

  • Hi, From the datasheet: The Altitude data is arranged as 20-bit 2’s complement value in meters. The data is stored as meters with the 16 bits of OUT_P_MSB and OUT_P_CSB and with fractions of a meter stored in bits 7-4 of OUT_P_LSB. Be aware that the fractional bits are not signed, therefore, they are not represented in 2’s complement. Does somebody know how this is to be understood? Should I take the fractional part (LSB/256 units) and add it to the signed integral part? Or should I take the fractional part (LSB/256 units), multiply it by the sign of the integral part, then add the two? I don’t have the part here so I cannot just try.. Thank you Regards Soren

    • Have you had a chance to look at our example code? Here’s the line you should look at. Aaron does a pretty good job of explaining how everything gets converted back to pascals.

      • Thank you. But 2 lines further down he “gets rid of the decimal portion”. If a sign conversion of the decimal part is necessary, of course he will not bother to do it, but I want to keep the decimal part and am still unsure if I need to do a sign conversion or not. But okay, looking again, float tempcsb = (lsb>>4)/16.0; float altitude = (float)( (msb << 8) | csb) + tempcsb; tells me not to sign convert the altitude decimals, but just scale them and add them to the signed integral part.

  • Unlike other I2C devices, this device requires that the write operation before read will not be terminated with a stop command. Otherwise you will read only address 0….

  • I can’t get the Arduino example to compile. It gets stuck at Wire.endTransmission(false);

     // Read pressure registers
     Wire.beginTransmission(MPL3115A2_ADDRESS);
     Wire.write(OUT_P_MSB);  // Address of data to get
     Wire.endTransmission(false); // Send data to I2C dev with option for a repeated start. THIS IS NECESSARY and not   supported before Arduino V1.0.1!
     Wire.requestFrom(MPL3115A2_ADDRESS, 3); // Request three bytes
    

    The error messages are

    MPL3115A2.ino: In function 'float readAltitude()':
    MPL3115A2:140: error: no matching function for call to 'TwoWire::endTransmission(int)'
    C:\Program Files (x86)\Arduino\libraries\Wire/Wire.h:52: note: candidates are: uint8_t TwoWire::endTransmission()
    MPL3115A2.ino: In function 'float readPressure()':
    MPL3115A2:192: error: no matching function for call to 'TwoWire::endTransmission(int)'
    C:\Program Files (x86)\Arduino\libraries\Wire/Wire.h:52: note: candidates are: uint8_t TwoWire::endTransmission()
    MPL3115A2.ino: In function 'float readTemp()':
    MPL3115A2:238: error: no matching function for call to 'TwoWire::endTransmission(int)'
    

    I’m using V1.0.5. Where am I going wrong?

  • Please advise what is the best male header pin that I should use to solder for breadboard use. Thanks

  • Does anyone know how much this product weighs? (preferably in grams)

  • Is it possible to assign a new i2c address to this device? I would like to have a few of these connected to the same arduino and didn’t see these when I bought the BMP085.

    • Unfortunately it is not possible to alter the I2C address on the MPL3115A2. As an alternative, these devices are very low power; you might be able to power down different units on the same bus.

  • What’s Git all about? I work at home OFF LINE. NO BROADBAND. I have to PAY for wifi usage. Who needs that just to download an example.

    • We are simply putting our files on to GitHub to make version tracking easier. It shouldn’t take you any longer to download them from that site instead of ours. FWIW, git doesn’t need to be connected online to do version tracking on your personal machine, so it shouldn’t affect your wifi usage at all if you do decide to use it to track your own changes and updates. You certainly don’t need to though to access and use our examples.

  • Is it possible to read out both pressure and altitude? I need both values

    • Note that there is only one sensor on this chip, which measure absolute pressure. The chip does some math on that number to estimate the altitude. You can get both numbers, but because they’re both based on the same number (and either will change if the other changes), you may not get exactly what you were thinking of.

  • Hi! I was wondering, is there a way to get data out of this sensor faster than 1Hz? I’ve programmed the example from page 12 of the datasheet (I chose interrupt driven acquisition). My sample rate seems to be limited by the ST bits in register CTRL_REG2 (0x27) because I can increase it by setting those differently, but I can’t get it below 1 second. What do I need to change if I want to sample at the rate given by the over-sampling bits in CTRL_REG1 (0x26)? I can post my code here if you like. Your help is much appreciated :)

    • Never mind, I got it :) When switching the part to ‘active mode’ it starts acquiring samples at the rate specified by the ST-bits in ctrl_reg2, which has a 1 second minimum. To issue an immediate acquisition, leave the device in ‘standby’ and issue a ‘one shot measurement’ by setting the OST-bit in crtl_reg1. It then samples as fast as the over sampling setting allows. Set the bit again each time you need a sample. If using the interrupt line, it’s set-and-forget, which is nice :)

  • Hi! When establishing a handshake and reading from 0x0C I’m getting return in value 0, not 196. I would expect -1 or FF in case I2C is not established. I can not get any other data from the device. Only 0. Any suggestions?

  • For those out there using this device, I just learned from Freescale that the sensor die is sensitive to light. If you are having issues with accuracy or drifting measurements that don’t correlate with the weather, light may be affecting the readings. The datasheet for this part does not say anything about this but the one for the MPL115A does mention it: “The sensor die is sensitive to light exposure. Direct light exposure through the port hole can lead to varied accuracy of pressure measurement. Avoid such exposure to the port during normal operation.” I was very frustrated trying to use this sensor before I learned about this because the measurements seemed to be all over the place at times. Now I put a small piece of foam over the port to block out light but still allow the air to reach the sensor. I am now reliably getting +/- 1 foot accuracies which is totally amazing. Once you know how to use this part properly it is really awesome.

  • i am using Arduino DUE Board and the sketch available for due is not working.help me out….

    • So it looks like this is a problem with the beta version of the Arduino IDE supporting the Due, not the breakout board. There is some talk in the Arduino forums about i2c not being fully implemented on the Due. I can successfully test the MPL breakout on other platforms, but the Due fails. Bottom-line, the Arduino software you are using for the Due is in beta, so you can’t assume everything will work.

      EDIT: There might be a way to get it working by modifying the sketch (although I am not sure exactly what the problem is). Also, since the sketch works with all of the other Arduino boards, I assume this bug for the Due will be fixed in Due time.

      • my project deadline is coming ahead.kindly find some solution for this devil and help me out.

        • I would love to help you out and want you to succeed, but I as well have deadlines for other projects that probably take precedent over a problem like this (considering this is a bug with a beta version of the Arduino IDE and has nothing to do with the MPL BOB).

          I would suggest either waiting for the IDE to come out of beta, attempt to fix the issue yourself and submit your results to Arduino, or move to another platform. Bottom-line, don’t use beta programs for mission/time critical projects.

          • and how much this “waiting” will be?i cant replace my arduino DUE board with other ,i think i m failed.

            • waiting

              I have no idea.

              Don’t give up too quick. You might want to review some of the forum posts and do some debug work to see if you can figure it out. The fix might just be a few lines of code. I’ll try to take a look at it if I get a chance early next week.

  • Hi guys, this is my first post here so go easy on me!

    I am building this circuit from scratch since my college didnt allow me to buy the breakout board so these are my problems:

    1) I tried to design the circuit as in the schematic above and I was able to build it all even the MPL311 library (I had zero experience with Eagle before this lol)but I couldnt comprehend the arrow pointing at VCC so I made a circuit with all the physical connections. Now I keep getting inconsistency errors no matter how much I trouble shoot it. So is it the arrow? and if yes where can I find it?

    2) I am using a DSPic30F for this project and unfortunately I cant find C example codes and I cant use C++, so is there by any chance a C-version of the Arduino example above?

    Again, sorry for the inconvenience lads this is my first post.

    • 1) Yea, make sure the orientation of the sensor is correct. Pin1 looks like the hole in the IC, but it’s on the opposite side. Just be sure to double check the datasheet. The first few boards we built had this mistake.

      2) We tend to now write only Arduino code/AVR. I’m don’t know of any I2C libraries with PICs, but I am sure there are some examples out there; there are plenty for AVR.

      EDIT: FYI, a logic analyzer is a great tool to help debug I2C, I use it all the time.

  • Just got mine and wired it all up with an Arduino uno R3 and a 16x2 display, worked great with the example code above. One question I have is every time I have turned it on it is 10-20 meters higher than it was the last time, so I checked the local weather and the barometer has been steady, I kept testing but now I am getting my local altitude 400 higher than it actually is, not a big deal as I am using it in a zero’d out configuration but even then if I let it sit on the desk it slowly counts up, anyone have any ideas why this might be or how to re calibrate it? Thanks.

  • How does an altimeter based on pressure ever accurately report the altitude? Since pressure is changing minute to minute in the real world it seems like it would be constantly incorrect. Even if you went down to the beach at noon and calibrated it at sea level for 0ft of elevation, an hour later the weather changes a bit and your measurements are incorrect.

    Unless I’m missing something, isn’t the only way to accurately measure altitude via GPS (assuming at least 4 satellites)?

    • Local weather stations provide an adjustment you can apply to pressure altitude to get actual altitude. This is generally referred to as the “altimeter setting” and is given in inches of mercury relative to standard sea level pressure (29.92"). Each inch is 1000 feet difference between the two. Minute-to-minute barometric pressure change is generally very small. You can look at the history of hourly altimeter settings to get an idea; it’s rare that a SPECI would be issued due to fast pressure change.

    • You need to set the barometric offset to your local pressure to get accurate altitude. The local pressure does change, but shouldn’t amount to more than an order of 10m or so over a passing pressure front (maybe more if you are in a hurricane). So with the default barometric setting, you should be kinda close to your altitude (within an order of 10m) without calibration. The nice thing about this sensor is the precision. Given a properly calibrated sensor, you can realize resolutions of 1.5Pa or 0.3m. If you are needing to measure altitude on time scales much less than passing weather systems and you calibrate for local pressure, then the sensor can be very accurate.

      • In converse, if you want to use this sensor as a barometric pressure sensor and have its reading correspond to those of local weather reports, the sensor readings must be scaled based on your local elevation. I found the equation here to be useful. In software I defined the local ELEVATION (in feet) and then used the following formula:

        elevation_offset = 101325-101325*pow((1-0.0000225577*ELEVATION*0.3048), 5.25588);
        

        When you read out the pressure value from the sensor, add the elevation_offset and divide by 100 (mBar) or 3386 (inHg) - you should arrive at about the same value as local weather stations.

  • Atmospheric calculator at http://www.newbyte.co.il/

  • Is it possible to connect the I2C signal connections on the breakout board directly to the Arduino 5V logic pins? Or, is a logic level translation required?

    • You can connect this to a 5V Arduino as long as you’re sure to power it with the 3.3V supply. Because the pullup resistors on this board go to 3.3V, the I2C lines will never see 5V, so no level-translation is necessary.

      • isn’t this still asking for trouble? This seems it might be ok if this is the ONLY thing on the i2c bus or power EVERYTHING on the i2c bus from 3v3, but as soon as one device powered via 5v, and another powered via 3v3 end up on the same bus I smell magic smoke!

        • You’re correct; you don’t want to mix 3.3V and 5V parts on the same bus. I don’t think Sparkfun carries any 5V I2C parts at this point, so it’s not a problem we’ve seen here.

  • Looks like its good to about 17,000 ft. based on the table at this site: http://www.engineeringtoolbox.com/air-altitude-pressure-d_462.html

    • The calibrated range is 50 to 110kPa but the specs say it is operational down to 20 kPa. That would mean it would work to about 35,000 feet or so. However, I imagine the accuracy is not as good at the extent of the measurement range. For those who might be interested, I am using this part with good success on a miniature rocket altimeter which I call AltStick.

  • How low can this measure? Or what is the maximum altitude that can be accurately measured?

    • In the data sheet it says it’s reads pressure ranging from 50 - 110kPa. Using the formula provided on page 14 in the datasheet for pressure to altitude conversion you can use the 50kPa to find what the maximum is.


Related Products