Pages: [1]   Go Down
Author Topic: Misc. I2C Questions  (Read 416 times)
0 Members and 1 Guest are viewing this topic.
Salt Lake City
Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

For a project I'm currently building, I have a ds1307 RTC and a BMP085 pressure sensor on the same I2C line.  To account for the different voltage levels, I've implemented Sparkun's Logic Level Converter (http://www.sparkfun.com/products/8745).  However, I am now designing my own Arduino shield for this project and so I won't be using Sparkfun's logic level converter anymore.  Following the advice on page 10 of this article (http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf), I'm going to build my own level shifting circuit using n-channel mosfets.  My question is this: as long as they are n-channel, does it matter what mosfets I use?  Are there any other design considerations I'm missing?  The ones I was planning on buying were these: http://search.digikey.com/us/en/products/2N7000_D26Z/2N7000_D26ZCT-ND/2094402.

My second question has to do with pullup resistors.  I currently have 2x 2.2k resistors for the ds1307 because the shield it's mounted on has them, and 2x 4.7k resistors for the BMP085 because its breakout board has them.  If I were to add more devices to either the 3.3 volt or 5 volt "side" of the i2c bus, would I need to add more pullup resistors for each device or would the existing ones work?  I guess I don't completely understand what the pullup resistors are for, I just know you need them.

Finally, I've also read that the Arduino wire library runs I2C communication at 3.3V anyways, meaning I wouldn't have to build the mosfet circuit at all.  Is this true?

Thank you in advance for any help!
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just wrote this: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter
Logged

Salt Lake City
Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This looks awesome, thank you very much!
Logged

Pages: [1]   Go Up
Jump to: