Hi everyone, I’m stuck with an Arducam Mini 5MP PLUS SPI camera connected to a Raspberry Pi Pico. The image I get is basically broken - it’s made of random black and gray-black blocks, maybe around 40 of them. The whole picture is super faint, like black against an almost identical shade of black. Weird thing is it worked briefly at one point, but after I unplugged and replugged it, it went right back to the broken behavior.
That does sound like an exposure or data issue rather than a dead camera, since you saw it work briefly. Can you tell me a bit more about your setup - which platform you’re on, the exact camera model, and how the cable is connected?
Sure. Platform is a Pi Pico, and the camera is the Arducam Mini SPI camera, 5MP PLUS model. I’m using the included cable and connected it exactly as described in the guide. I’m following the GitHub example from the PICO_SPI_CAM repo - the Arducam_MINI_5MP_Plus_Videostreaming example. Also there’s no error in the log at all, nothing shows up as an error.
Thanks, that helps narrow it down. Before I suggest anything - what have you already tried so far?
A lot. I used the host app exactly as described and it didn’t work. I followed an online tutorial for taking pictures and that didn’t work either. I tried other SPI pins, didn’t work. I moved the wires around and tried two different breadboards, none of that worked. I’m starting to think about swapping the wires in case the ones that came with it are bad.
Before you blame the wires, one thing stands out. The camera’s exposure mode is set to auto, so it takes time to form a stable exposure effect. Because auto exposure needs time to stabilize, the early frames might not have correct exposure. That can produce exactly what you’re describing - random black and gray-black blocks that look really faint.
So it’s an exposure thing and not the hardware? What should I actually do about it?
Right - the root cause is likely that auto exposure mode needs a stabilization period. If you grab an image from the very first frames, the exposure hasn’t settled yet and the output looks degraded. Try capturing only after discarding the first few beginning frames. Throw away or skip those initial frames, let the auto exposure settle, and then capture the image. The key point is that the camera is in auto exposure mode, so skipping the initial frames gives it time to stabilize and the image quality should improve.
Okay, I’ve been digging into this more and I actually think the real problem is with the library. The code in the RPi Pico repo has something wrong in it.
Interesting - can you share more about what you found wrong in the library? And which core/environment are you using now?
I’m using the Arduino-Pico core with the Arduino Library. I ended up modifying the Arduino Library to work with the Arduino-Pico core. I also submitted a pull request to reformat the code for readability, since it was pretty hard to follow: reformat the entire project by nextdayy · Pull Request #570 · ArduCAM/Arduino · GitHub
Nice work on the PR. And after those modifications, did the camera actually start working?
Yes - after modifying the Arduino Library to work with the Arduino-Pico core, I managed to get the camera working.
Glad to hear it’s working. To summarize for anyone else hitting this: the broken, faint blocky image was likely the auto exposure not having enough time to stabilize, so discarding the first few frames before capturing helps. On the Arduino-Pico core side, the library needed modifications to work properly, and the submitted PR should help with readability too.