Loading...
Pages: [1]   Go Down
Author Topic: I2C help  (Read 186 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there

I am connecting an HMC5883L to I2C and also an MMA7660.
I am a bit confused, I know the Arduino Uno I am using has pull up resistors already but I have read that you need to add them to the bus.
I am using 2 I2C devices so I planned to use the same 2 10K pullup resistors for both devices.
How do I connect this? Diagrams arent my thing and I am slightly confused by the use of VD0 and VCC when I am searching.
I know it is connected
Arduino GND -> HMC5883L GND - MMA7660 GND
Arduino 3.3V -> HMC5883L VCC
Arduino 5V -> MMA7660 VCC
Arduino A4 (SDA) -> HMC5883L SDA - MMA7660 SDA
Arduino A5 (SCL) -> HMC5883L SCL - MMA7660 SCL
And the resistors are added between VCC and SDA and VCC and SCL.
The confusion arrives because I am using one device that connects to 3.3v and 1 that connects to 5v.
Is there a Fritzing diagram somewhere or can someone show me an image of the solution because I have looked at google searches etc and if I do it the way they suggest it seems to me that SDA,SCL,3.3v VCC and 5v VCC will all be connected together. Wont this affect the voltage that goes to each device? ie the HMC5883L may receive 5V instead of the 3.3V in the data sheet

*Edit
So far I am trying just connecting both SDA and SCL lines through pull up resistors to the 3.3v VCC
That seemed to work well

« Last Edit: January 12, 2013, 11:48:41 pm by No1Daemon » Logged

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 825
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sometimes the devices are tolerant, you can check the datasheets. Typically, though, you need a "level shifter" to bridge the 5V and 3.3V. This app note shows a good way to do it, and there are other ways:

http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thankyou for that.
You learn something every day.
Much appreciated.
Logged

Pages: [1]   Go Up
Print
 
Jump to: