Go to Post Be civil in all things and you will get far. - Wetzel [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 07-02-2010, 19:28
ajd ajd is offline
Registered User
FRC #3238
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Mount Vernon, WA
Posts: 46
ajd will become famous soon enough
Multiple I2C sensors

Researching the selection of additional sensors available for purchase (from various vendors), it seems that many use the I2C protocol for communication with the digital sidecar and cRIO. However, with two digital sidecars, it looks like we only get 2 I2C ports. Is it possible/recommended to use a multiplexer to attach more than two I2C sensors to the robot? Is there another way to access these sensors so we could use more than two I2C sensors?

Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 07-02-2010, 21:00
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Multiple I2C sensors

I2C is a bus. You can connect multiple devices to it. Each device responds to a specific address.
Reply With Quote
  #3   Spotlight this post!  
Unread 07-02-2010, 21:59
ajd ajd is offline
Registered User
FRC #3238
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Mount Vernon, WA
Posts: 46
ajd will become famous soon enough
Re: Multiple I2C sensors

So how do I connect multiple devices when there are only 4 pins? Can I just splice wires together and connect each pin to the corresponding pin on each sensor?
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2010, 22:35
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Multiple I2C sensors

All devices on the I2C bus connect to the same four wires.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2010, 22:50
ajd ajd is offline
Registered User
FRC #3238
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Mount Vernon, WA
Posts: 46
ajd will become famous soon enough
Re: Multiple I2C sensors

Excellent. Thanks for your help!
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2010, 22:13
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Multiple I2C sensors

Just out of curiosity:
Does the cRIO support a multi-master bus?
__________________
-- Marshal Horn
Reply With Quote
  #7   Spotlight this post!  
Unread 19-02-2011, 22:01
David Fort David Fort is offline
Registered User
FRC #1001
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2003
Location: Cleveland, OH
Posts: 26
David Fort is on a distinguished road
Re: Multiple I2C sensors

I haven't tried this myself, but since the topic of multiple I2C sensors has become of interest to our team (after 2 days of extensive failures on other topics, followed by a pretty good FTC day at Erie PA), I looked in the sensor manual for the ADXL345 which can be used via I2C.

It says there is a way to change the Address on I2C by shorting 2 pads on the circuit board with a blob of solder.

The example LabView Open VI for the ADXL345 (which can be found in the sample FRC programs, on the link in the bottom right of the first screen, in the I2C bucket) has the "default" (non-solder-blobbed) ADXL345 I2C address connected to the underlying WPI I2C Open block via a "constant" wired to the pin.

Therefore, I would bet that the CRIO can support multiple I2C peripherals on the bus, and (for example) if you wanted to use 2 ADXL345's, you would add the solder blob to one of them and modify the example ADXL345 Open Vi to pass in the I2C address on one of the function block Terminals (or copy the whole thing and change the constant value in one of the copies).

I use this only as a silly example, since who in their right mind would use 2 3 axis accelerometers on one robot, but since FRC teams are known to not be in their right minds, our team tried to do just that last year, to measure the acceleration at opposite ends of the robot to see if we could figure out (and control) the center of rotation. The answer was, uh. no. (but perhaps with more patience, and filtering, and resolution we could have).

Another angle(weak pun intended) to consider is that some sensors (again, the ADXL345 for example) can be used on both I2C and SPI, so perhaps you can move one of your sensors to SPI and avoid the whole question of multidropped I2C.

Please let us know if you attempt this and whether or not you succeed!

Thanks,
David Fort
Mentor, Team 1001
Reply With Quote
  #8   Spotlight this post!  
Unread 20-02-2011, 00:55
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Multiple I2C sensors

If you require high sample rate, use an analog accelerometer and DMA.
__________________
-- Marshal Horn
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I2C for NXT sensors kamocat Programming 11 25-02-2010 23:02
[FTC]: Multiple Programs or One Program with Multiple Auto Modes kevin51292 FIRST Tech Challenge 4 02-01-2009 20:37
Hosting multiple sites in multiple VMs EHaskins Website Design/Showcase 6 22-12-2007 01:09
I2C tutorials John Gutmann Electrical 3 30-07-2005 10:44
I2C? John Gutmann Electrical 3 19-07-2005 22:52


All times are GMT -5. The time now is 17:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi