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

Strange Data on SDA/SCL


  • Please log in to reply
25 replies to this topic

#1 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 21 February 2011 - 03:07 PM

Good Day to all Ive recently been testing a BMP085 with my Netduino Plus. It was working fine last week but now today when I power up my netduino and try to get data from the unit the numbers are all over the place. Im using the code from forum http://forums.netdui...ch__1#entry4273 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 Any ideas? Could the clock be out to lunch? Ive tried a second BMP085 board I have and the results are the same.

#2 phantomtypist

phantomtypist

    Advanced Member

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

Posted 21 February 2011 - 08:41 PM

What voltage are you supplying the chip? Also, are you using the SparkFun breakout board for the BMP085? EDIT: And a few other questions. Where are you exactly located, what is your elevation above sea level, and are you shinning bright light on the sensor? What happens to the readings if you run the sensor in complete darkness?

#3 phantomtypist

phantomtypist

    Advanced Member

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

Posted 21 February 2011 - 08:48 PM

On a side note, I assume you modified my code because you are taking the readings every one second. My code only updated the temperature and pressure values every 30 seconds via a timer. Something just doesn't seem right with you getting negative celsius temperatures of 135 below zero. I'm kind of leaning towards something wrong in code rather than hardware because you said you tried everything on two different BMP085's and the outcome was the same. If you could please attached your modified code for the BMP085. If possible, please attach your complete solution. Thanks.

#4 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 22 February 2011 - 12:03 PM

I took out all my other code and just left in a loop for updates because if I run the code as is it will just come back with one reading. See attached photos for code and output results. Attached File  BMP085_Code.JPG   110.33KB   27 downloads Attached File  BMP085_Output.JPG   99.37KB   23 downloads My altitude according to my GPS is 114m above sea level so around 350ft. I noticed the notes on the light affecting the unit and I have a pretty dark office with one fluorescent but I have both covered the unit and left it alone and still the same results. I have tried the unit on an arduino and have had no problems, not sure how different the code is. I got the code from sparkfun http://www.sparkfun....xample_Code.pde

#5 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 24 February 2011 - 01:18 PM

Is it possible my SDA/SCL lines are bad? or the analogue lines in general? I have two netduinos and one the code works but gives back the strange data and the other one doesnt give me any data back at all. I am supplying the barometer with 3.3v from the netduino and the netduino is getting its power from the USB. Ive tried the BMP085's on an Arduino I have here and they work fine even though the altitude is showing 200m above where I really am. Thoughts/concerns?

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 February 2011 - 01:59 AM

My first thought is that perhaps the I2C settings are set up wrong...but if it was working fine for phantomtypist on the same hardware that's probably not it. The I2CBus extensions may be skewing results accidentally--but that seems really odd too. nturpin77: any chance you could put together a diagram (perhaps in Fritzing?) showing your circuit? Also, do the BMP085's currently work on an Arduino? Chris

#7 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 25 February 2011 - 12:47 PM

The BMP085's do work with the arduino without any problems. Not sure how different the code is but the results are consistently good with it. Im installing Fritzing as I type this so I should have a schematic out in a little bit.

#8 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 25 February 2011 - 01:45 PM

This is the Fritzing Schematic, I had to build my own BMP085 part for it. I couldnt find one online, please excuse the sizing LOL. Attached File  Netduino_BMP085.jpg   35.25KB   60 downloads

#9 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 25 February 2011 - 02:02 PM

Also I have taken a pic of the units together..... Attached File  Netduino_BMP_Hookup (Medium).jpg   58.71KB   30 downloads

#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 February 2011 - 02:49 PM

nturpin77, Is this the exact part you bought? If you don't have a logic analyzer to see what is going on, perhaps we can pick up one of the sensors. $20 + S&H and it would be a good learning experience for all. http://www.sparkfun.com/products/9694 Chris

#11 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 25 February 2011 - 02:55 PM

Hi Chris, Yeah thats the piece of kit I picked up. Ive seen a lot of people use them so I guessed there was a large knowledge base out there for using it. I almost wish I had something else here that communicated on the SDA/SCL pins so I could confirm their functionality.

#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 February 2011 - 07:27 PM

I almost wish I had something else here that communicated on the SDA/SCL pins so I could confirm their functionality.


If you plug an LED into pins A4 or A5 (and GND) and use an OutputPort, you should be able to turn the LED on and off. If that works, there's a ~99.9999% chance that your hardware is good to go.

It's almost definitely a circuit or code issue.

We'll pick up one of these devices from SparkFun. Should be here in about a week.

Chris

#13 Luke Cummings

Luke Cummings

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationCalgary, AB

Posted 27 February 2011 - 05:02 PM

I have a BMP085, when I was messing around with it a while ago I mistakenly applied reverse voltage to it, and now it generates very similar data to yours... :mellow:
Cheap, Fast, Good... Pick two

#14 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 27 February 2011 - 09:25 PM

I would tend to agree that reverse voltage would cause poor results but I can take the same bmp085 and plug it into my arduino and the output is normal,

#15 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 28 February 2011 - 12:28 PM

Gday So Ive tested both Netduinos with LEDs on A4/A5 and I can light an LED with them. Does this confirm the functionality of SDA/SCL? or just the Analogue pins? I ask because I immediately plugged my BMP085 into both netduinos, well one at a time obviously, and still getting no data on one netduino and the all over the place data on the other. Ive tried all three BMP's and all with the same results. Any ideas on where to go next?

#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2011 - 12:32 PM

Gday

So Ive tested both Netduinos with LEDs on A4/A5 and I can light an LED with them. Does this confirm the functionality of SDA/SCL? or just the Analogue pins? I ask because I immediately plugged my BMP085 into both netduinos, well one at a time obviously, and still getting no data on one netduino and the all over the place data on the other. Ive tried all three BMP's and all with the same results. Any ideas on where to go next?

Hi nturpin,

That confirms that the digital pins (the I2C pins) are working.

If you can, borrow a logic analyzer, take a look at what's actually happening on your digital lines.

Otherwise, in about a week we should have one here...and we can test out your code and the component with a logic analyzer and oscilloscope here. I just got an e-mail from SparkFun saying that they shipped us the one we ordered.

Chris

#17 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 11 March 2011 - 12:56 PM

I couldnt find a Logic Analyzer in our dept anywhere so Ive gone ahead and ordered one from SFE. Hopefully will be here next week and I can do some diagnosing.

#18 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 22 March 2011 - 06:04 PM

Have you guys recieved your BMP085 and gotten a chance to play with it? Im still waiting on my logic analyzer. In my hastiness I ordered one from the manufacturer but apparently they were having manufacturing issues and now I have to wait to get mine but if I had ordered from SFE Id have one by now. Oh Murphys Law thank you for existing.....

#19 nturpin77

nturpin77

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationNewfoundland, Canada

Posted 01 April 2011 - 12:04 PM

Hello again

I have my logic analyzer and Im in the process of trying to get used to it. When I run this code I get an error for unhandled exception.

while (true)
{
new OutputPort(Pins.GPIO_PIN_A4, true);
new OutputPort(Pins.GPIO_PIN_A5, true);
}

Thats the only code I have in the program and is what I used to light up the LEDs to test the pins originally.

#20 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 01 April 2011 - 12:18 PM

I have my logic analyzer and Im in the process of trying to get used to it. When I run this code I get an error for unhandled exception.

You cannot create multiple instances of OutputPort for the same pin (without disposing it first). You'd probably need something like

var port1 = new OutputPort(Pins.GPIO_PIN_A4, true);
var port2 = new OutputPort(Pins.GPIO_PIN_A5, true);
while(true)
{
  port1.Write(false);
  port2.Write(false);
  port1.Write(true);
  port2.Write(true);
}





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.