If you have been following along here for a while you’ll know that I have had constant failures trying to get an Arducam Mega 3MP working with my IoT projects. The last attempt was:
https://blog.ciaopslabs.com/2025/07/13/arducam-mega-3mp-failed-attempt/
After getting my robot car working with a PS3 controller I was working towards getting the PS3 controller also working with my robot arm. At the moment the robot arm is connected to a Keyestudio KS0172 with a Keyestudio Sensor Shield/Expansion Board V5 for Arduino Leonardo attached. Unfortunately, the Keyestudio KS0172 lacks both Bluetooth and Wifi but I noticed the Keyestudio Sensor Shield/Expansion Board V5 for Arduino Leonardo actually has a dedicated SPI port like so:
Ah ha. I wonder if I can get that working with the Arducam? Spoiler alert, yes I can.
I have now come to realise probably the two biggest mistakes I have made with the Arducam Mega 3MP:
1. I thought it was a ‘streaming’ style camera. No it’s designed really just to take pictures
2. I need something to ‘read/download’ the images from the camera to actually see those images
With the camera connected to the Keyestudio Sensor Shield/Expansion Board V5 for Arduino Leonardo SPI port. As a reminder the camera connections are:
I used this piece of code on the Keyestudio KS0172:
https://github.com/directorcia/Azure/blob/master/Iot/Arducam/3MP/capture-image.cpp
to connect to the camera and allow a photo to be taken and stream it down the serial port on request. The documentation for this code is here:
https://github.com/directorcia/Azure/blob/master/Iot/Arducam/3MP/capture-image.md
I then had to write some Python code to actually initiate a photo being taken and extract the image from the camera over the USB/serial port and put it into a subdirectory on my machine. That code is here:
https://github.com/directorcia/Azure/blob/master/Iot/Arducam/3MP/capture-image.py
and the documentation for that is here:
https://github.com/directorcia/Azure/blob/master/Iot/Arducam/3MP/capture-image-py.md
and to execute this Python script I also needed to install Python on my machine, which is pretty easy in Visual Studio code by just adding the Python extension.
With all that in place and after a bit of back and forth to get the image to download correctly via the serial port I was indeed able to confirm that my Arducam Mega 3MP is working properly and I can now use it to take photos.
Phew. That took a long time and a lot of effort. I think my major oversights, listed above, really held me back here along with the usual physical connection challenges. Now, I have a much better understanding of what the camera can and can’t do and what I need to actually see an image and most importantly the Arducam Mega 3MP is finally actually working!
