Looking for I2C code for ArduCAM OV5642 with ESP32 WROOM

Hi everyone, I’m really stuck here. I have an ArduCAM B0068 (OV5642, 5MP) module that I’m trying to get working with an ESP32 WROOM board using the I2C protocol. The problem is I literally cannot find any example code for ESP32 over I2C. Everything I turn up is either for an Arduino Uno or uses SPI instead. Has anyone managed to run this camera module with an ESP32 over I2C?

Thanks for posting. Before we go further, could you share a bit about your setup? Are you using the Arduino IDE, and which exact ESP32 board do you have? Also, how do you currently have the camera wired up (SDA/SCL pins)?

Yes, I’m using the Arduino IDE with an ESP32 WROOM. The camera is wired on the I2C lines (SDA and SCL). I’ve spent a lot of time searching for I2C example code for the ESP32 but I keep coming up empty, so unfortunately I don’t even have logs or an error message to share. I never got as far as something that would compile and run.

Got it, that makes sense. Have you had a look at the ArduCAM ESP32S UNO GitHub repository? It’s basically the main reference for ArduCAM usage with ESP32 boards, and its README includes I2C-related guidance for these modules.

No, I hadn’t come across that repo at all. I was mostly searching for generic ArduCAM OV5642 examples and nothing pointed me there. Let me check it out.

Take a look at the README here: GitHub - ArduCAM/ArduCAM_ESP32S_UNO: ArduCAM ESP32 Series Development Boards · GitHub - it documents the wiring and example sketches for the ESP32S UNO, and the same I2C approach applies to the B0068 OV5642. The examples in that repo should give you the correct initialization sequence to get the module responding over I2C.

That did it. Yes, very good now. The examples in that repo showed me the right I2C init sequence I was missing. Thanks a lot for the pointer!

Great to hear it’s working now. Just to recap for anyone else hitting the same wall: the ArduCAM_ESP32S_UNO GitHub repository README is the recommended reference for ESP32 + ArduCAM usage, including the I2C interface guidance for the B0068 OV5642 5MP module. If you can’t find ESP32 I2C examples elsewhere, start there.