Go Down

Topic: Resistors with I2C usage in arduino (Read 945 times) previous topic - next topic

jasonvanwyk

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.
 

fungus


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.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

majenko

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.

pwillard

#3
Mar 22, 2013, 12:44 pm Last Edit: Mar 22, 2013, 12:47 pm by pwillard Reason: 1
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.

James C4S

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.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

fungus


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...
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

James C4S


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
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Nick Gammon

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

http://gammon.com.au/i2c
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up