2

The only detail I've found so far is that the pull-up resistor should be 82k ohm. I'm wondering If I could just get something like this Adafruit Gyro/Accelerometer and just hook it up to the SDA and SCL pins of the EV3 and use it like the Lego brand sensor with minimal modification.

1

Yes, Mindstorms is incredibly hackable. You can use whatever 3rd-party analog, I2C, or UART devices you want with the EV3 brick. According to the hardware developer kit documentation:

The EV3 platform supports the same level of I2C communication as MINDSTORMS NXT. This means that system support a maximum of 9600 bit/s and maximum 32 bytes communication buffers. All I2C communication is running within software drivers. External devices are required to include pull-up resistors on both pin 5 and 6 on 82K ohm. If multiple sensors are used on the same bus the total impedance needs to be adjusted accordingly.

Obviously, the standard Lego programming software will not be able to utilize custom devices, but pretty much any 3rd-party firmware will allow sending custom I2C read/writes.

1

As MindS1 mentioned, I2C on the EV3 is a bit limited, so it really depends on what device you are connecting. There isn't really a way to tell if a device will work or not besides just trying it out. Even if it "meets the specs", there can still be timing issues that cause problems.

Dexter Industries has a nice blog post about connecting EV3 to an Arduino via I2C. This includes a block they created for the official EV3 programming software that does generic I2C communications. One limitation is that although you can read up to 32 bits at a time, you can only write at most one byte at a time (this is a limitation of the EV3 firmware, not the Dexter Industries block). So if a device requires longer write messages it definitely won't work. Otherwise, as already mentioned, you will just have to try it and see what happens.

The ev3dev 3rd-party OS for EV3 has more robust I2C handling since is uses the standard Linux I2C interface. For example, you can write a program in Python like this.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.