OpenMV I2C


I am trying to connect my OpenMV Cam M7 to the Raspberry-Pi 3 via I2C. However, it simply does not detect the device. What would you recommend for me to do?

Hi, the OpenMV does poorly as an I2C slave or SPI slave. Please use async serial instead. This works great with the OpenMV Cam M7.

The reason it works poorly as an I2C slave is that you have to literally be in a system call to feed the I2C hardware data for a master device to get anything other than zeros. I.e. you have to have the camera basically waiting for the I2C master to tell it what to do before it can go do something. You can have the camera generating results on the fly. Serial is much easier for the camera to run by itself and look at the serial buffer to check if it needs to send some data to another device after each frame.

Has any progress been made on getting the OpenMV to connect to Arduinos via spi and/or i2c. I’d like to use an Arduino, and I want to reserve my tx and rx pins for another purpose. I tried the sample code, but I wasn’t able to get it to work. As far as I could tell, I had followed all the instructions correctly.

Hi, please see the Pixy Emulation → I2C emulation script.

This example shows off how to get I2C working.

As mentioned above, making the OpenMV Cam an I2C slaves doesn’t work very well since the camera has to be waiting for an I2C request to service it. This means you have to make the camera I2C triggered. The same issue applies for the camera being a SPI slave.

I see that Mindsensors has used the OpenMV design as a jumping off point for their NXTcam5. I know they use i2c. Do they have a workaround, or does their implementation suffer from the same problems you have already mentioned? Also, any idea why I’m not able to get anything to happen with spi? I followed your example, but nothing shows up on the Arduino side. I don’t even know where to start troubleshooting.

Hi, the OpenMV Cam is kinda meant to be a master system and not a slave.

Mmm, okay, what do you need exactly? Maybe I can write some code for you quickly.

You should however, also look at the Pixy CMUcam5 Arduino library for the Arduino code I designed the Pixy emulation code to talk to. On the Arduino side you have to constantly poll the OpenMV Cam until you get a response. It’s not like a normal I2C device.

First off, thanks to all the great hardware, documentation, and posts to this forum!

I’m new to the OpenMV, micropython, arduino, etc. but had to figure out communication between the OpenMV 7 and Teensy 3.2. I cobbled together a simple demo from the various posts here and over at the arduino forums:

Hoping it helps anyone that was having similar difficulties, I haven’t tried setting the OpenMV as the slave but from what I’m reading on this forum it seems like that’s not a great idea if you’re doing any sort of image processing.

Thanks for the video tip!