element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sensors
  • Technologies
  • More
Sensors
Sensor Forum When you need many sensors at once...
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 26 replies
  • Answers 4 answers
  • Subscribers 347 subscribers
  • Views 3881 views
  • Users 0 members are here
Related

When you need many sensors at once...

screamingtiger
screamingtiger over 9 years ago

I have a project where I may need 25+ accelerometers and magnetometers.

 

I see three options for sensors:

-Direct wire, which could be possible with shift registers

-I2c, however many sensors of the same brand only ship with 1 or 2 address options and I dont want to have dozens of different brands with with different protocols

-SPI, same problem as I2c.

 

I found the I2C sensors to be cheap, is there a way to use numerous sensors with the same address within one bus?

  • Sign in to reply
  • Cancel

Top Replies

  • dougw
    dougw over 9 years ago +4 verified
    Linear Technology makes chips to handle this situation - up to 127 devices with the same address can be handled on one bus, but you may need one of these chips at each sensor. They cost about $2 each.…
  • shabaz
    shabaz over 9 years ago in reply to gdstew +2 suggested
    yet here you are again pushing the easily dis-proven idea that I2C is only good for short distances between boards Where did I state with the explicitness that you suggest, that it is only good for short…
  • michaelkellett
    michaelkellett over 9 years ago in reply to screamingtiger +2
    Another method you might consider (it's cheaper for the parts but has other issues) would be to use a single micro with plenty of pins (50 spare IOs needed) and bit bang as many IC2 buses as you need.…
Parents
  • shabaz
    0 shabaz over 9 years ago

    By the way, generally the reason this isn't normally an issue is because not many people need so many of the same device on the same circuit board. I2C isn't intended for long distances, so if you're trying to get these sensors to work across separated devices, then this could be an issue.

    Sometimes I2C is used across multiple boards, but they are still within the same enclosure, i.e. the distance is controlled. There are exceptions, but generally I2C isn't the best choice if you want to connect multiple physical devices like (say) a home alarm system sensors. I don't know your intended use-case however..

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • shabaz
    0 shabaz over 9 years ago

    By the way, generally the reason this isn't normally an issue is because not many people need so many of the same device on the same circuit board. I2C isn't intended for long distances, so if you're trying to get these sensors to work across separated devices, then this could be an issue.

    Sometimes I2C is used across multiple boards, but they are still within the same enclosure, i.e. the distance is controlled. There are exceptions, but generally I2C isn't the best choice if you want to connect multiple physical devices like (say) a home alarm system sensors. I don't know your intended use-case however..

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • gdstew
    0 gdstew over 9 years ago in reply to shabaz

    I2C is not limited to short distances nor was it designed solely as a "board to board" communications interface. All VGA DDC2 cables and all HDMI

    cables use I2C (100 KHz) to read information about the monitor that the video card is connected to. I have a 25 ft. HDMI cable connected between

    a LCD TV and one of my computer's video cards and it has no trouble reading the TV information. It does require proper I2C signal cable position,

    low cable capacitance, and proper signal termination.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 9 years ago in reply to gdstew

    Not that old story again. You discussed this quite a while back:

    https://www.element14.com/community/message/72520/l/i2c-buss#72520

     

    If we take the time to analyze the signal on the wire then sure you can push I2C - but I think it is fairly clear that if the person asking the question doesn't know how to connect multiple same-address sensors then they may not have access to an oscilloscope or even know what to look out for - hence the gentle probing about their use-case.

     

    At a first approximation, I2C is typically used for on-board and board-to-board communication within an enclosure, with some exceptions being the cable you refer to - it's an exception that works because engineers examined the signal on the wires in detail. If you have (possibly) limited hardware and test tools and using whatever cable is at hand, then you wouldn't use it across 25 feet.

    In fact you yourself came to some similar conclusion when you stated on that thread

    so keeping distances as short as possible and routing away from any noise sources is a good idea

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • gdstew
    0 gdstew over 9 years ago in reply to shabaz

    "Not that old story again. You discussed this quite a while back:"

     

    Yes I remember it well and yet here you are again pushing the easily dis-proven idea that I2C is only good for short distances between boards.

     

     

    "If we take the time to analyze the signal on the wire then sure you can push I2C"

     

    Given the number of cable lengths, the number of different devices it is connected to and how they are terminated at both ends of the I2C interface, it appears that

    it is easier to push than you think.

     

     

    " but I think it is fairly clear that if the person asking the question doesn't know how to connect multiple same-address sensors then they may not have access to an oscilloscope or even know what to look out for - hence the gentle probing about their use-case."

     

    So many assumptions.

     

     

    "At a first approximation, I2C is typically used for on-board and board-to-board communication within an enclosure, with some exceptions being the cable you refer to"

     

    Given the vast number of DVI (yes it is used on these cables as well) and HDMI cables in use in computer and video entertainment equipment I don't see how you

    come to the conclusion that these cables are the "exceptions", my first approximation would be that they are the rule. And even if they are the exceptions they still

    prove I2C is used on cable over long distances on a great number of devices.

     

     

    "it's an exception that works because engineers examined the signal on the wires in detail."

     

    Given the number of cable lengths, the number of different devices it is connected to and how they are terminated at both ends of the I2C interface quality engineers

    can not possibly examine the signal on the wires in detail for all those variations and yet it still works.

     

     

    "If you have (possibly) limited hardware and test tools and using whatever cable is at hand, then you wouldn't use it across 25 feet.

    In fact you yourself came to some similar conclusion when you stated on that thread"

     

    Re-checked the thread and as far as I can tell I said no such thing.

     

     

    "so keeping distances as short as possible and routing away from any noise sources is a good idea"

     

    Keeping distances short is always a good idea with any single ended communications interface, it's just not always possible, and you can still get I2C to work over

    long distances when it is not.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 9 years ago in reply to gdstew
    yet here you are again pushing the easily dis-proven idea that I2C is only good for short distances between boards

     

    Where did I state with the explicitness that you suggest, that it is only good for short distances? Engineers try not to speak in absolutes, but they certainly make approximations, to convey ideas.

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

     

    You yourself stated a similar guideline yourself,.. I'm only quoting you from your earlier thread..

     

    "so keeping distances as short as possible and routing away from any noise sources is a good idea"

     

    The video interface (built to a low cost) is still an exception, people don't use I2C for any significant distance generally. ("Generally" does not mean "only" by the way..).

    And I suspect there are plenty of cables from cheap vendors that fail for this reason, leaving the user wondering why their video devices need manual configuration..

    And, in some products ("some" does not mean "all", just to be clear, although I'm beginning to feel only you need this level of clarification since you tend to see things that are not really written) it would be a joke to even consider I2C outside the enclosure. Furthermore it would be a dumb thing to promote the use of I2C over a long distance for people trying to learn by asking advice, and setting them up for a fall if I suspect they may have an undefined cable and undefined level of test equipment. I'd rather make them aware, and learn more about the use-case, and give them some information that they can take and use with confidence. This isn't "pushing" a non-I2C agenda/conspiracy. That would be as daft as it sounds.

     

    Sure, NXP recently created a marketing paper promoting multi-kilometre use (with many repeaters!) - took them 25 years to get around to it, so clearly not a popular scenario - it was published in 2014.

     

    Anyway, reaching out to my latest copy of 'Art of Electronics' - famous for practical real world guidance- the authors, Paul Horowitz and Winfield Hill too suggest (on page 1032) that typically [amongst other serial busses, I2C is] an internal serial protocol, chip-to-chip and within an instrument.

     

    You might well wish to use I2C for long distance use but real engineers tend to ("tend to" != "only") use it conservatively for short distances because there are better long-distance protocols.. (by the way, I am qualified and was a Chartered Electrical Engineer before I moved on to other equally technical jobs, i.e. recognised by my peers and my professional body (IEE, now IET) to have satisfied practical experience in the field of electronic engineering as well as achieving educational qualifications in the same field (electronics).

    In the 4 or 5 years I've been a member here I have never had to state that and put my cards on the table, but it's tiring discussing this mundane I2C topic with you. Sensible readers can decide for themselves if they wish to use I2C over long distances and what precautions they would take. If they ask for such advice, then it can be stated as fact that I'm giving my advice based on experience designing with it in industry, not just from using the controlled design cable that is VGA.. I'm not 'trying to push' an idea as you suggest, for any other reason - if I did, I wouldn't be living up to the standards that I try to always maintain..

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • gdstew
    0 gdstew over 9 years ago in reply to shabaz

    "Where did I state with the explicitness that you suggest, that it is only good for short distances?"

     

    Geeze this is easy. Direct quote from your second response "I2C isn't intended for long distances". Direct quote from the previous response:

    "it would be a joke to even consider I2C outside the enclosure". There is nothing in the NXP I2C specification or real world use that supports either of

    these statements.

     

    "Furthermore it would be a dumb thing to promote the use of I2C over a long distance for people trying to learn by asking advice, and setting them up for a fall if I suspect they may have an undefined cable and undefined level of test equipment. I'd rather make them aware, and learn more about the use-case, and give them some information that they can take and use with confidence."

     

    I'm not promoting anything, I'm objecting to your repeated incorrect assertions about what I2C is and is not capable of. If you want to say you don't think I2C is good in this

    particular case, fine. But that is not what you said (see Geeze above).

     

     

    "This isn't "pushing" a non-I2C agenda/conspiracy. That would be as daft as it sounds."

     

    Do believe in agendas (see previous responses), don't believe in conspiracies. Yes it does indeed sound daft.

     

    "Sure, NXP recently created a marketing paper promoting multi-kilometre use (with many repeaters!) - took them 25 years to get around to it"

     

    No agenda ? OK ?

     

     

    "The video interface (built to a low cost) is still an exception, people don't use I2C for any significant distance generally. ("Generally" does not mean "only" by the way..)."

     

    There are literally hundreds of millions if not billions of video interfaces all over the world  with cable lengths from 6 inches to 30 ft. and more in use. This is not by definition an

    exception and what people "generally" (thanks for being patronizing) use has no relevance as to whether I2C works over long cable distances or not (thanks for the straw man).

    One would think that a low cost build would not get all the engineering scrutiny you say is required to make it work over long distances (much less such a large range of cable

    lengths).

     

     

    "although I'm beginning to feel only you need this level of clarification since you tend to see things that are not really written"

     

    This is just nonsense. All my responses are to direct quotes from your responses (some of which you seem to forget immediately after you write them, see Geeze above).

     

     

    "Anyway, reaching out to my latest copy of 'Art of Electronics' - famous for practical real world guidance- the authors, Paul Horowitz and Winfield Hill too suggest (on page 1032) that typically [amongst other serial busses, I2C is] an internal serial protocol, chip-to-chip and within an instrument."

     

    But that is not what the actual creators/maintainers and real world use says. Personally I'll stick with real world use.

     

     

    "You might well wish to use I2C for long distance use but real engineers tend to ("tend to" != "only") use it conservatively for short distances because there are better long-distance protocols.."

     

    Well except for all those real video interface engineers. It also shows up as the interface in a lot of sensor chips that real engineers use sometimes, and this is no joke, outside of enclosures.

     

     

    "tend to ("tend to" != "only"

     

    Once again, thanks for being patronizing.

     

     

    "In the 4 or 5 years I've been a member here I have never had to state that and put my cards on the table, but it's tiring discussing this mundane I2C topic with you."

     

    Perhaps then you shouldn't make statements (and then deny that you did) that are directly contradicted by facts and real world use and then defend them with straw man arguments, along with

    irrelevant points and patronizing statements.

     

     

    "If they ask for such advice, then it can be stated as fact that I'm giving my advice based on experience designing with it in industry, not just from using the controlled design cable that is VGA..."

     

    Yes we should never, ever use well engineered "controlled design cables", VGA (and the much more modern DVI and HDMI just to remind you) or otherwise (\sarcasm in case you missed it).

    No agenda, right ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 9 years ago in reply to gdstew

    I2C isn't intended for long distances, so if you're trying to get these sensors to work across separated devices, then this could be an issue.

    I thought this was a rather good warning to add into the conversation, given the question was posed by someone that might have limited experience.

    The community has members that are very clever with hardware and others who are clever with software.

    Sometimes the bridge between those two parts is the hardest bit to complete the particular project they are trying to fix/solve/analyse/theorise.

     

     

    If you read the first part

    By the way, generally the reason this isn't normally an issue

    Then the rest is in context with why many devices have limited address.

     

     

    I have a 25 ft. HDMI cable connected betweena LCD TV and one of my computer's video cards

    HDMI cabling tends to be high grade, so I don't think 25 feet could be considered long in this context.

     

     

    The capacitance of ANY cable will be the killer for this application (which we now know is a short distance).

    BUT this post might be viewed by someone else who wants to run one sensor 100 or 200 feet away and have some other closer.

     

     

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 9 years ago in reply to gdstew

    Gary Stewart wrote (several times):

     

    No agenda, right ?

     

     

    Is it a clever ploy where I sometimes pretend to "like" I2C?

    Can I say "some of my best ICs are I2C, so I can't be anti-I2C-ist"?!

    As recently as a few months ago I published a project with the main IC being an NXP I2C part.. but please, do not let the reality get in the way..

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube