View Full Version : I2C for NXT sensors
I've been told that the I2C on the Digital Sidecar is compatible with the NXT sensors (or at least the connector is).
Today I tried it with the Ultrasonic Sensor. I made a For loop to try every one of the 256 device addresses, and none of them worked.
I realize that the NXT I2C is slightly different from standard I2C, but I can't even open a reference?
How is the NXT I2C meant to work?
EHaskins
18-01-2010, 03:13
I don't have any experiance using the I2C on the robot, but you may want to start by reading the code for the HiTechnic Compass.
whytheheckme
18-01-2010, 09:35
Last year, (team 809) got a HiTechnic Compass working over I2C using the built-in code (if I remember, we had to modify it a bit, but the general connection premise is there.)
Jacob
Edit: W00T post 1234!!!
I looked at a bunch of the hitechnic code, and the all seem to use the same template.
I still haven't managed to get a single reply from it.
When I'm reading data from a device, I write to it and read from it, but this is all done in the "I2C read" VI, correct?
What is the "Data sent high"?
The ultrasonic sensor that Lego sells is not actually I2C compatible. It will not work with the Digital Sidecar. All HiTechnic sensors that have been tested have worked with the Digital Sidecar.
Ziaholic
24-02-2010, 09:29
The ultrasonic sensor that Lego sells is not actually I2C compatible. It will not work with the Digital Sidecar. All HiTechnic sensors that have been tested have worked with the Digital Sidecar.
... ok, the Lego ultrasonic may not be I2C compatible ... what about the other ones? Are any of the Lego NXT sensors I2C compatible? I'm primarily curious about the Light/Color sensor.
The light sensor, sound sensor, and touch sensor are all analog.
(however, the touch sensor has only two states: on (4.3v) and off (0v))
If you would like I2C compatible sensors, hitechnic.com has a wide selection. (They even have LabVIEW code that you could convert to work with the cRIO)
Ziaholic
24-02-2010, 10:51
I've looked at the Hitechnic website ... nice stuff in there. I just thought I'd ask since I'm in possession of an NXT kit, and would have to order one from Hitechnic.
Are the Analog specs available for the NXT sensors?
When I've used the color sensor on my Lego kit, the sensor was always within an inch of the ground. I wonder how it'd perform if it was more like 4-5" high ...
Vikesrock
24-02-2010, 11:48
When I've used the color sensor on my Lego kit, the sensor was always within an inch of the ground. I wonder how it'd perform if it was more like 4-5" high ...
I have had much more experience with the RCX light sensors and their weaker LED, but my guess is that it will become much more sensitive to changes in ambient lighting conditions as you move it off the ground.
Try looking in the NXT hardware developer kit. (it's a PDF)
I was going to give you a link, but I couldn't find it. I thought it was somewhere on the LEGO site.
Here's a pdf-javascript version hosted on another site:
http://www.docstoc.com/docs/20929335/LEGO-MINDSTORMS-NXT-Hardware-Developer-Kit
The light sensor, sound sensor, and touch sensor are all analog.
(however, the touch sensor has only two states: on (4.3v) and off (0v))
If you would like I2C compatible sensors, hitechnic.com has a wide selection. (They even have LabVIEW code that you could convert to work with the cRIO)
If you have the LabVIEW toolkit for NXT, it shouldn't be hard to make a data logging application.
I think the voltage out from the light sensor is directly proportional to the intensity of light in, but I wouldn't count on it. (I don't even know whether that's on a logarithmic scale or not) I do know that the value back from the "light sensor" VI is directly proportional to the voltage in.
Your best option really would be to make a jig and do repeatable tests.
(If you want to do some advanced stuff, you could even use the Direct Control VIs)
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.