Loading...
Pages: [1]   Go Down
Author Topic: Resistors with I2C usage in arduino  (Read 203 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
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

Valencia, Spain
Online Online
Edison Member
*
Karma: 65
Posts: 2244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
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?

Only if you're having problems because of long wires, etc. Normally the devices have built-in resistors which are sufficient.
Logged

UK
Offline Offline
Edison Member
*
Karma: 42
Posts: 2181
What a host of balls she had seen: gaity, the brass buttons...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I²C uses open-drain IO pins, so pull-up resistors on the SCA and SCL lines are required.  Typically these are around 4.7KΩ and go from the SCA pin to VCC, and the SCL pin to VCC.
Logged


Cumming, Ga
Offline Offline
Edison Member
*
Karma: 12
Posts: 1388
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When longer wire lengths are used... the pull-ups may need to be slightly stronger to overcome the impact of copper length.  With 4.7K being the starting point, you might see improvement using 3.3K  or 2.2K instead.  Going to a lower is pull-up value is not ideal and should have you maybe re-thinking the solution... IE; maybe time to add a I2C repeater IC in the path.
« Last Edit: March 22, 2013, 06:47:39 am by pwillard » Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5166
CMiYC
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Wire library, which does the I2C communication, enables the internal pull-up by default.  However, they are very weak (30-60kOhm).  So for relatively short runs, they'll work fine.

Even so I generally still put a 4k7 resistor on the lines, regardless if it is a "short" length.
Logged

www.cmiyc.com - A guide to being an Enginerd

Valencia, Spain
Online Online
Edison Member
*
Karma: 65
Posts: 2244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Wire library, which does the I2C communication, enables the internal pull-up by default.  However, they are very weak (30-60kOhm).  So for relatively short runs, they'll work fine.

The I2C gadget on the other end usually has pullups, too...
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5166
CMiYC
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The I2C gadget on the other end usually has pullups, too...
True.

However, in this case, it doesn't appear the board has pull-ups:
https://www.sparkfun.com/datasheets/Sensors/Temperature/HH10D.pdf
Logged

www.cmiyc.com - A guide to being an Enginerd

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 218
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Some oscilloscope screen-shots here showing what the pull-up resistors do:

http://gammon.com.au/i2c
Logged


Pages: [1]   Go Up
Print
 
Jump to: