element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum I2C connection problems
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 7 replies
  • Subscribers 419 subscribers
  • Views 2127 views
  • Users 0 members are here
  • i2c
  • help
  • gyroscope
  • arduino
Related

I2C connection problems

e14 Contributor
e14 Contributor over 12 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

imageimage

Fullscreen contentimage_76509.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>

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.

Fullscreen contentimage_76510.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>

 

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.

  • Sign in to reply
  • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 12 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

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • e14 Contributor
    0 e14 Contributor over 12 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
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 12 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
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • e14 Contributor
    0 e14 Contributor over 12 years ago in reply to Robert Peter Oakes

    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 image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 12 years ago in reply to e14 Contributor

    Your more than welcome, glad we could help

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 12 years ago in reply to e14 Contributor

    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
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ipv1
    0 ipv1 over 12 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
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube