Pages: [1]   Go Down
Author Topic: I2C bus shared by 2 prototype shields  (Read 1319 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,


I have been working on a project that requires sampling from multiple sensors on a single Arduino board. Specifically, the Arudino board I am using is the Arduino Ethernet from Adafruit. We have 3 sensors which all use I2C to communicate to the Arduino Ethernet. To hold these 3 sensors, I use 2 prototype boards, with one sensor on one prototype board (denote as Proto-A) and the remaining 2 sensors on the other prototype board (denote as Proto-B). When I connect Proto-A to the Arduino Ethernet without Proto-B, there is no problem at all and I can see the sensor readings from the serial monitor. Same good thing happens when connect Proto-B to the Arduino Ethernet without Proto-A. However, when I put Proto-B on top of Proto-A and plug Proto-A into the Arduino Ethernet, no outputs are shown in the serial monitor. Does anybody know why this happens and how could I solve this problem? Many thanks.

Bests,
Michael

Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 543
Posts: 27348
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What are the sensors?
Links to data sheets.
How are pullup resistors wired?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 3 sensors are:

1. BMP085 Barometric Pressure Sensor from Sparkfun (http://www.sparkfun.com/tutorials/253).
2. K30 CO2 sensor from CO2 meter (http://co2meters.com/Documentation/Datasheets/DS30-01%20-%20K30.pdf).
3. iAQ-engine VOC sensor from AppliedSensor (http://www.appliedsensor.com/pdfs/APS_iAQEngine_0411.pdf).

Since all these 3 sensors share the same I2C bus, I use 10K ohm as pullup resistors. The connection is drawn below:

GND ---------------o-----------------------------------------
VCC (5V)---------o-|--------------------------------o----o---
                 | |                                |    |
              iaq engine                           | |  | |
                 | |                           10k | |  | | 10k
                 | |                                |    |
SCL -------------o-|--------------------------------o    |
SDA ---------------o-------------------------------------o---

Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 543
Posts: 27348
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

2nd unit says pullups to 3.3V for I2C.

Not enough info provided to say if there are address conflicts between the 3, or if the 2nd & 3rd just respond to every request.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi CrossRoads,


I am sure that all these 3 sensors have their unique I2C addresses. So no address conflicts for sure. I am not sure if my pull-up resistor is right. How to determine whether the value of pull-up resistor is correct? I use 10K ohm because it is what people normally use. Please guide me if I am wrong... Thanks.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 543
Posts: 27348
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Use 4.7K.
10K not strong enough. I would also disable Arduino internal pullups and make the pullups to 3.3V so you don't damage the 2nd listed part.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the quick reply!

1. So the smaller the resistor is, the stronger the pullup is?

2. This may be a naive question, but what is the purpose to disable Arduino internal pullups?

Many thanks!
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 543
Posts: 27348
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"disable Arduino internal pullups"
Keeps the 2 lines from getting pulled up to 5V internally, only want 3.3v.
All the devices use open drain or open collector to pull the lines low, and pullup brings the line back high.
The more things connected the slower the lines go from low to high.
Need lower resistor value for snappier pull up to keep data rates high.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: