Author |
Message |
JMS
Rookie
Joined: Fri Mar 30, 2012 10:39 am Posts: 3
|
 Change the I2C address of the HiTecnic IRSeeker V2
Hi
My kids have been using 2 IRSeeker V2 on their robocup junior soccer bot with the NXT brick. Due to weight limitations they started using the Arduino Uno R3. The issue is it only has 1 I2C line and they need to use 2 IRSeekers. Is there any way of changing the I2C address of one of the sensors. I've been looking everywhere and was unable to find a solution. Can anyone give us some help? Thank you
JMS
|
Mon Jun 11, 2012 10:45 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
No, I'm afraid it's not possible.
- Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Mon Jun 11, 2012 10:52 am |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
Why exactly do you need to change the address? Can't you just use Xander's bit-banged Arduino SW I2C library? RobotC doesn't support HW I2C yet, do they?
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Mon Jun 11, 2012 11:00 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
It does not support I2C yet and it will not have a bit banged I2C implementation either, afaik.
- Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Mon Jun 11, 2012 11:06 am |
|
 |
JMS
Rookie
Joined: Fri Mar 30, 2012 10:39 am Posts: 3
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
Thank you for your answers.
I saw you using the NXTshield with the arduino. Could this be a solution for using both sensors one in each bank. I also looked at your I2C library and will try to use with all the other sensors we need (compass and ultrasound).
JMS
|
Mon Jun 11, 2012 11:44 am |
|
 |
Dennis Mabrey
Rookie
Joined: Mon May 14, 2012 3:24 pm Posts: 43
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
Couldn't he just create two separate bit banged I2C libraries to use two separate buses? The current one you made that uses the pins of 2 & 3 and another that uses two other pins? For example digital pins 4 & 5. You would have to change the pragmas at the top: Of course he will be eating up two extra digital pins. PS: Just curious will this be for the RoboCup Jr in Mexico City?
|
Mon Jun 11, 2012 1:43 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
That's what I was talking about.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Mon Jun 11, 2012 9:57 pm |
|
 |
Dennis Mabrey
Rookie
Joined: Mon May 14, 2012 3:24 pm Posts: 43
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
Oh I wasn't sure if that was what you meant.
Anyway if he is doing this for the Robocup Jr competition I doubt he would want to use this beta version of RobotC. The competition starts next Monday in Mexico City. Sort of short notice to make all the changes now and test.
Also his idea of using the NXTShield I guess would work. The only thing is he switched to the Arduino for weight reasons because of the NXT. The NXTShield (at least the one I have for the mega) has some mass to it. His robot might end up being over the weight limit again.
|
Mon Jun 11, 2012 10:52 pm |
|
 |
starwarslegokid
Moderator
Joined: Wed Jan 31, 2007 3:39 am Posts: 299 Location: San Diego, California. USA
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
I have an idea for future reference, better late than never.
If you have a breadboard handy and need two of the same addressed sensor hooked to one i2C buss, try hooking a logic level mosfet in between each sensor and the i2c buss (on the sensor power line or the return signal line). In the software you can then turn on one mosfet at a time and only allow one sensor to report back on the buss, essentially making your own multiplexer.
I haven't tried it, it should work. I do not know what a mosfet would do on the data lines tho. It should work well if the mosfet just cuts the power to the sensor and only supplies power to one sensor at a time.
Scott B-)
_________________Mmmm Legos B-) My Robot Projects: http://www.freewebs.com/robotprojects/
|
Wed Jul 11, 2012 12:46 am |
|
 |
mattallen37
Expert
Joined: Thu Sep 29, 2011 11:09 pm Posts: 184 Location: Michigan USA
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
That might work, but it would be better to use an I2C multiplexer that is intended for that purpose.
_________________ Matt
|
Sat Jul 14, 2012 10:23 am |
|
 |
starwarslegokid
Moderator
Joined: Wed Jan 31, 2007 3:39 am Posts: 299 Location: San Diego, California. USA
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
I agree, sometimes its a good learning experience since your using an arduino and can wire those things up fairly easy B-) If you need a multiplexer, this one would work great: You would send the multiplexer i2c commands and switch it between the different sensor ports. http://www.hitechnic.com/cgi-bin/commer ... ey=NSX2020Scott B-)
_________________Mmmm Legos B-) My Robot Projects: http://www.freewebs.com/robotprojects/
|
Sat Jul 14, 2012 2:39 pm |
|
 |
Dennis Mabrey
Rookie
Joined: Mon May 14, 2012 3:24 pm Posts: 43
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
For NXT projects this works fine but for Arduino one would have to strip an NXT wire and hook the 5 and 6 wire (blue and yellow) to the SDA and SCL. Instead I would experiment with something like the Texas Instruments PCA9543A chip. It is an I2C MUX chip that is used for resolving I2C address conflicts. It is $2.83 from Mouser and I think I might order one just to see if I can get it to work.
|
Sat Jul 14, 2012 4:14 pm |
|
 |
mattallen37
Expert
Joined: Thu Sep 29, 2011 11:09 pm Posts: 184 Location: Michigan USA
|
 Re: Change the I2C address of the HiTecnic IRSeeker V2
@Dennis Mabrey, that is exactly what I meant. There are other versions I have seen as well, which would support different numbers of buses.
_________________ Matt
|
Sat Jul 14, 2012 9:13 pm |
|
|