element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Arduino
  • Products
  • More
Arduino
Arduino Forum I2C connection problems
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Arduino requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 7 replies
  • Subscribers 105 subscribers
  • Views 424 views
  • Users 0 members are here
  • i2c
  • help
  • gyroscope
  • arduino
Related

I2C connection problems

Former Member
Former Member over 8 years ago

I am having difficulties getting a connection between my arduino onu and a MPU6050.

i have set the I2C  connection like this.

     arduino 3.3v to MPU6050 VDD

     arduino ground to MPU6050 ground

     arduino analog pin4 to MPU6050 SDA

     arduino analog pin5 to MPU6050 SCL

here is pictures

i read on the MPU datasheet ( http://invensense.com/mems/gyro/documents/RM-MPU-6000A.pdf) that it have pull op resistors so that should not be the problem.

i use a I2C scanner to try and find a connection between the two(Arduino Playground - I2cScanner)

this is the result

 

 

 

i however, i 3 times i got a correct signal for a  brief less then 5 second period. it was after i had i t run in the background for 2 hours and i looked through the historic of the connection. i have no idea if anything changed at those 3 moment, but the arduino pretty much just lay on the table, so i highly doubt it. i am out of ideas to get it to work is there anyone who have, advise, help or experienced similar situation.

 

Update:

Sorry for the late update school vacation and other bad excuses.

 

The problem posted have been solved, many thanks to Peter Oakes.

Connecting the VIO to the v3.3 seems to work perfectly i there is no more connection problems however i have also worked on  minimizing the noise that the wires probably made.

I am now using the code from Arduino Playground - MPU-6050 website which will get the base values out perfectly, however i am struggling with converting the raw 16 bit data to a more readable numbers.

i am trying to use the help from here Gyroscopes, Accelerometers and the Complementary Filter | Bayesian Adventures however i cant seem to get the code for the arduino talker, and i don't understand the reasoning for dividing with the number 131. Doing so seems to works great and the data seems correct at first, but the reasoning for the number i can't find. but that will probably show op as i try ti calculate the values the gyroscope and accelerator should give.

 

 

here is a picture of the new setup the INT is on because when i was soldering i was still unsure if it would be necessary, and just get it just in chase.

  • Reply
  • Cancel
  • Cancel
  • peteroakes
    0 peteroakes over 8 years ago

    Well the most obvious thing I can see is that the VIO pin is not connected to VDD. The VIO pin is the VLOGIC pin of the chip and controls the I2C IO voltage levels, if open like this it is possible it could drift around and occasionally allow the board to work

     

    On the spark-fun website it indicates this should be connected to VDD (+3.3V) and this would defiantly cause issues your showing

     

    there is a web site showing this clearly with a Processing script for test as well  http://noro24.de/index.php?article_id=42&clang=0

     

    the image is from their site

    • Cancel
    • Up 0 Down
    • Reply
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 8 years ago

    Breadboarding I2C devices is notoriously finicky.  You're likely going to need pull-ups on SDA and SCL - the stray capacitance of your long wires and breadboard will cause all kinds of issues.  If you were to look at the SDA and SCL lines on a scope the signal would likely look like little rounded bumps instead of nice square waves.  Add a 4.7K resistor between SDA and Vcc, and another between SCL and Vcc.  Some I2C devices are *really* picky about rise times, and this will help to ensure sharp(er) signals.

     

    SparkFun sometimes includes pads on their breakout boards for pull-up resistors, though they typically don't populate them.

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 8 years ago

    The comment from the sparkfun site says

    https://www.sparkfun.com/products/11028

     

    Hi! The problem is most likely a missing VIO connection.

     

    This is not obvious if you don’t know it’s required.

    Here are the typical connections for the SparkFun breakout, including the interrupt pin to work with the DMP example sketch:

     

    VDD - Arduino 3.3v

    GND - Arduino GND

    INT - Arduino digital pin 2

    FSYNC - leave unconnected

    SCL - Arduino SCL (dedicated pin or Analog 5)

    SDA - Arduino SDA (dedicated pin or Analog 4)

    VIO - Arduino 3.3v

    CLK - leave unconnected

    ASCL - leave unconnected

    ASDA - leave unconnected

     

     

    Mark

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 8 years ago in reply to peteroakes

    thx alot it helped completely

    i have worked on getting better soldering the MPU on and the school work day's are limitet so sry for the late replay

    meny meny thx for the help

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
  • peteroakes
    0 peteroakes over 8 years ago in reply to Former Member

    Your more than welcome, glad we could help

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 8 years ago in reply to Former Member

    When you get the chance.

    You can update us with if it worked or not.

     

    I found that some of those wires didn't make good contact on the Arduino end.

    They really do need the square pins so I soldered wires onto a header plug.

    (These also work  Breadboard Jumpers Male-Male Approx. 65 pieces   )

     

    The breadboard uses a different type of connection, hence is suited to wires or pins.

     

    Mark

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
  • ipv1
    0 ipv1 over 8 years ago

    I know that you have marked this question answered so I have a question to your current work.

    Did connecting the mpu which is a 3.3v device, directly to the 5v uno work right?

    It is suggested that you use a level converter but you are not doing that.

     

    I would have suggested using the 2 MOSFET converter but...

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube