Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Bosch BMP085 Digital Pressure and Temperature Sensor


  • Please log in to reply
34 replies to this topic

#21 phantomtypist

phantomtypist

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationNew York, NY

Posted 06 December 2010 - 01:32 AM

Are you using my driver for the BMP085? If so, did you try using the "UltraHighResolution" device mode? The BMP085 sensor has four different levels of accuracy. To learn more about this, please read the datasheet for the BMP085.

#22 mluckham

mluckham

    New Member

  • Members
  • Pip
  • 6 posts

Posted 15 December 2010 - 04:32 PM

... my sensor is reading too low -about 5.4 hPa.


I have received information from a Bosch engineer, who points out that:

- a pressure vessel would be needed to determine the accuracy of the sensor ... local weather stations may be too far away, or their reports to old, to use as a reference
- the calibration of the altimeter I was using is unknown
- the sensor is very accurate but not an "ideal" sensor
- the specification document mentions a possible offset ("up to 1 hPa") as a result of soldering techniques, which would not be included in the on-chip calibration data stored in EEPROM

#23 phantomtypist

phantomtypist

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationNew York, NY

Posted 15 December 2010 - 10:29 PM

I have received information from a Bosch engineer, who points out that:

- a pressure vessel would be needed to determine the accuracy of the sensor ... local weather stations may be too far away, or their reports to old, to use as a reference
- the calibration of the altimeter I was using is unknown
- the sensor is very accurate but not an "ideal" sensor
- the specification document mentions a possible offset ("up to 1 hPa") as a result of soldering techniques, which would not be included in the on-chip calibration data stored in EEPROM


You mentioned on the BMP085 SparkFun product page that this sensor is light sensitive. Can you confirm that this is also true in addition to the other information the engineer provided you?

#24 jbw

jbw

    Member

  • Members
  • PipPip
  • 10 posts

Posted 20 December 2010 - 09:34 PM

I connected the wires as mentioned (I am using the sparkfun board, which has pull-up resistors included). I downloaded all of the necessary files, but it was unable to read from the barometer. Does anyone have any suggestions as to what I could do?

#25 phantomtypist

phantomtypist

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationNew York, NY

Posted 21 December 2010 - 03:34 AM

I connected the wires as mentioned (I am using the sparkfun board, which has pull-up resistors included). I downloaded all of the necessary files, but it was unable to read from the barometer.

Does anyone have any suggestions as to what I could do?


Zip up your visual studio project and send it to me or post it here. Also take a picture or fritzing schematic of how your hooked up the wires.

#26 jbw

jbw

    Member

  • Members
  • PipPip
  • 10 posts

Posted 21 December 2010 - 07:19 PM

Zip up your visual studio project and send it to me or post it here. Also take a picture or fritzing schematic of how your hooked up the wires.


In case it is not clear in the pictures.

Blue is connected between SDA and Analog 4
Green is connected between SCL and Analog 5
Red is connected between VCC and 3V3
Black is connected between GND and GND

Thank you

John

Attached Files



#27 phantomtypist

phantomtypist

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationNew York, NY

Posted 22 December 2010 - 06:11 AM

John, Your wires look like they are hooked up correctly. I tried your solution tonight on two different BMP085 sensors from SparkFun and everything worked fine. I attached a screenshot to boot. There is a possibility that you have a bad breakout board. I did have a third BMP085 that was working for some time, but then suddenly *malfunctioned*. If I had the malfunctioning BMP085 connected with other devices on the I2C bus, it would bring down the entire I2C bus and not allow communication with the other devices. I contacted SparkFun and they promptly sent me a new BMP085 breakout board. You might want to try using an oscilloscope on the I2C to confirm if your breakout board is malfunctioning or dead before contacting SparkFun.

Attached Files



#28 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 18 February 2011 - 02:46 PM

Good Day

I tried using this library and I come up with an error in Class2.cs. Maybe not an error but the exception is thrown on line 83, Could not read from device. I have the code in some existing code that loops once a second in order to get real time results as a vessel is moving. What happens is that it will do the loop 2 or 3 times then throw this exception. Any ideas on why after a couple runs it stops responding?

Thanks

Here is the code

using System;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.IO;
using System.IO.Ports;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;

namespace BMP085
{
    public class Program
    {
        public static void Main()
        {
            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
            SerialPort serialPort1 = new SerialPort("COM1", 57600, Parity.None, 8, StopBits.One);
            serialPort1.Open();
            SerialPort serialPort2 = new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One);
            serialPort2.Open();
            FileStream fs = new FileStream("\\SD\\CTAP.txt", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None, 512);
            StreamWriter sw = new StreamWriter(fs);
            
            while (true)
            {
                BMP085 pressureSensor = new BMP085(0x77, BMP085.DeviceMode.UltraLowPower);
                Debug.Print("BMP085 Pascal: " + pressureSensor.Pascal);
                Debug.Print("BMP085 InchesMercury: " + pressureSensor.InchesMercury.ToString("F2"));
                Debug.Print("BMP085 Temp*C: " + pressureSensor.Celsius.ToString("F2"));
       
                int GPStoRead = serialPort1.BytesToRead;
                int CHRtoRead = serialPort2.BytesToRead;                          

                if (GPStoRead > 0)
                {
                    //blink the LED to show we got data
                    led.Write(true);
                    //Thread.Sleep(100);
                    led.Write(false);
                    // get the waiting data
                    byte[] GPSbuffer = new byte[GPStoRead];
                    serialPort1.Flush();
                    serialPort1.Read(GPSbuffer, 0, GPSbuffer.Length);                                       
                    serialPort1.Write(GPSbuffer, 0, GPSbuffer.Length);
                    if (GPSbuffer[0] != 36)
                        continue;

                    String GPSMessage = new String(System.Text.Encoding.UTF8.GetChars(GPSbuffer));
                    Debug.Print(GPSMessage);
                    sw.Write(GPSMessage);
                }
            
                if (CHRtoRead > 12)
                {
                    int i = 0;
                    //blink the LED to show we got data
                    led.Write(true);
                    //Thread.Sleep(100);
                    led.Write(false);
                    // get the waiting data
                    byte[] CHRbuffer = new byte[CHRtoRead];
                    serialPort2.Flush();
                    serialPort2.Read(CHRbuffer, 0, CHRbuffer.Length);
                    serialPort1.Write(CHRbuffer, 0, CHRbuffer.Length);

                    if (CHRbuffer[i] == 's')
                    {
                        //Print final result
                        i = i + 7;
                        
                        int YawVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                        String ShowYaw = YawVal.ToString();                        
                        double YawCalc = YawVal * 0.0109863;
                        String ShowCalc = YawCalc.ToString("F");
                        //Debug.Print("Yaw");
                        //Debug.Print(ShowCalc);
                        
                        int PitchVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                        String ShowPitch = PitchVal.ToString();                        
                        double PitchCalc = PitchVal * 0.0109863;
                        String ShowPCalc = PitchCalc.ToString("F");
                        //Debug.Print("Pitch");
                        //Debug.Print(ShowPCalc);
                        
                        int RollVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                        String ShowRoll = RollVal.ToString();                        
                        double RollCalc = RollVal * 0.0109863;
                        String ShowRCalc = RollCalc.ToString("F");
                        //Debug.Print("Roll");
                        //Debug.Print(ShowRCalc);
                        
                        string CTAP = "$CTAP,Y," + ShowCalc + ",P," + ShowPCalc + ",R," + ShowRCalc + "\r\n";
                        Debug.Print(CTAP);
                        sw.Write(CTAP);
                        
                    }
                    else
                    {
                        i++;
                    }
                }



                Thread.Sleep(1000);                        
            }
            sw.Close();
            fs.Close();

        }

    }


#29 phantomtypist

phantomtypist

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationNew York, NY

Posted 21 February 2011 - 02:42 AM

Can you please copy and paste the entire error message you got in the debugger window. Cant really help much without that.

#30 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 21 February 2011 - 06:02 PM

I got it working after some playing around but now Im getting eratic data. See debug data below..... BMP085 Pascal: 99087 BMP085 InchesMercury: 29.26 BMP085 Temp*C: 32.20 BMP085 Pascal: 133558 BMP085 InchesMercury: 39.44 BMP085 Temp*C: -135.40 BMP085 Pascal: 207803 BMP085 InchesMercury: 61.36 BMP085 Temp*C: -58.30 BMP085 Pascal: 97794 BMP085 InchesMercury: 28.88 BMP085 Temp*C: 26.20 BMP085 Pascal: 96959 BMP085 InchesMercury: 28.63 BMP085 Temp*C: 23.60 BMP085 Pascal: 133554 BMP085 InchesMercury: 39.44 BMP085 Temp*C: -135.40

#31 Lebeda

Lebeda

    New Member

  • Members
  • Pip
  • 5 posts

Posted 19 January 2013 - 09:39 PM

Thank you for nice implementation! For anyone using Netduino Plus 2 - there are special pins SD/SC, so A4/A5 is not used anymore. Took me few hours to find out :-)



#32 Skippy

Skippy

    New Member

  • Members
  • Pip
  • 9 posts

Posted 21 January 2013 - 06:09 PM

I found i2C only worked properly on the Plus 2 with the latest (4.2.2) firmware.

#33 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 21 January 2013 - 07:26 PM

Thank you for nice implementation! For anyone using Netduino Plus 2 - there are special pins SD/SC, so A4/A5 is not used anymore. Took me few hours to find out :-)

Yes, this is documented in the original posts about the release of the ND+2.

 

I found i2C only worked properly on the Plus 2 with the latest (4.2.2) firmware.

Yes, there are several discussions on the forums about the I2C issues with the initial firmware releases for ND+2.  As of 4.2.1.0 these issues should be resolved.



#34 cgoss

cgoss

    New Member

  • Members
  • Pip
  • 2 posts

Posted 03 May 2013 - 12:12 AM

I am trying to run your code on a Netduino 2 

 

When the Ic2Bus tries to write to the device it throws a "Could not write to device."

 

I pulled your code from this post and your code from your IC2 Bus post.

 

I have triple checked the wiring

 

I bought the sensor from Adafruit.

 

any help would be greatly appriciated.



#35 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 06 May 2013 - 06:16 PM

I am trying to run your code on a Netduino 2 

 

When the Ic2Bus tries to write to the device it throws a "Could not write to device."

 

I pulled your code from this post and your code from your IC2 Bus post.

 

I have triple checked the wiring

 

I bought the sensor from Adafruit.

 

any help would be greatly appriciated.

Can you post up all of your code if possible so I can take a look.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.