Pages: [1]   Go Down
Author Topic: Using resistors with I2C  (Read 459 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I recently posted this by mistake in another forum - I have since realised that this is most probably the more correct forum to ask this question.
I'm very new to electronics, specifically physical computing.
my first real project I'm trying to take on is to build a weather station.
I want to hook up my humidity sensor (HH10D), and through the reading that I've done it seems that is communicates via  I2C. my question is should i be using a resistor(s) when connecting it to the Arduino pins?
and if so where in the circuit should the resistors be?
my set up is as follows;
Vss - Gnd
Vdd - +3.3V
SDA - A4
SCL - A5
Some guidance and help would be greatly appreciated.
Thanks.
 
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need two resistor's one from A4 to +3.3V and the other from A5 to +3.3V
Use 2K7 for each. That is 2.7K ohms.
« Last Edit: March 23, 2013, 04:30:04 am by Grumpy_Mike » Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 72
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If this is a 3.3v device (which it appears to be) you should read this.

http://playground.arduino.cc//Main/I2CBi-directionalLevelShifter

Basically, if you are not going to use a level shifter then you are trading off getting a high enough voltage for the Arduino to recognize it (by using pullups to 3.3v) against using too high a voltage and damaging the device (by using them to 5v).  Note that I'm talking about the pullups here, not Vdd, which should only go to 3.3v

Good news is that it appears (from what I have read) that most I2C devices are pretty tolerant of 5v so if putting the pullups to 3.3v gives you flaky results you can try 5v.

I would be interested in Grumpy_Mike's perspective on this since he has way more experience than I do.


Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry I missed it was a 3V3 device but I have edited it now.

If the arduino is 5V but the device is 3V3 what you need is an I2C driver on the arduino that does not enable the internal pull up resistors like the I2C master library.
http://dsscircuits.com/articles/arduino-i2c-master-library.html


Quote
that most I2C devices are pretty tolerant of 5v
Unless it says so in the data sheet don't assume it.
Logged

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am curious why you would suggest pulling up the clock line to one voltage   and the data line to a different voltage ?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am curious why you would suggest pulling up the clock line to one voltage   and the data line to a different voltage ?
Because I forgot to edit that as well, sorry all correct now.
Logged

Pages: [1]   Go Up
Jump to: