You are currently viewing Arduino ArduCAM SD Card Image Capture

Arduino ArduCAM SD Card Image Capture

Using an Arduino Nano controller, here’s how to connect an Arduino compatible ArduCam, and an SD Card to capture an correctly formatted jpeg image that can be displayed on a personal computer.

Arduino Advice to Practical Cats

Welcome! I hope this page is helpful to you in your Arduino endeavors. I hope these instructions and downloads help you get a working camera setup. Get your ELEGOO starter kit and follow the instructions therein to download the Arduino IDE and examples. Make sure to make a copy of the download so you can start again if something goes wrong.

Pay attention to where Arduino wants to place the libraries that Arduino code references in its top lines. Sometimes there’s a bit of configuration to do so that Arduino code can find the libraries that it needs to use. Use ChatGPT a lot to resolve any reference issues. Practice the examples! And then give the Nano/ArduCAM/SD Build a try. You can use the Mega or Uno Controller Board to prototype as well.

Please contact me at [email protected] with comments or questions. Especially if you would like to share a sample of working Arduino Camera Code. And don’t forget to provide any required libraries.

Thanks for visiting! 

Component Hardware and Sources

Here’s links to the needed hardware for Arduino Image Capture Setup

Arduino Code

Here’s the link camera_sd_5223b to a PDF which contains of the working Arduino Code for this setup.

Note: Place the text from the PDF into a file named camera_sd_5223b.ino  inside of a folder named: camera_sd_5223b. Arduino requires its code .ino files inside of a folder of the same name.

Arduino Libraries

One if the reason the code won’t work is that it can’t find the libraries listed at the top of the code.

For the camera_sd_5223b you will need the following Arduino libraries:

  • #include <Wire.h>
    #include <ArduCAM.h>
    #include <SPI.h>
    #include <SD.h>
    #include “memorysaver.h”
And this is where you might need to do some work if you are new to Arduino. 
Ask ChatGPT how to load these libraries and that will help.
You should find a number of them at Arducam/Arduino and you can download them by pulling down the green <> Code button.
Installing the Arduino IDE will create a folder on our home directory Arduino/libraries and that’s where you should place the libraries.
Initial installation of the libraries takes some work since it’s hard for anyone to describe how they got it to work. When you new to a software environment you try things and then it works. But you tried many thing an not all of them are necessary.
Once you have working code it means that you’ve installed the proper libraries in the right place but there’s almost never time to figure out exactly how you did it.

Again keep conversing with ChatGPT to get your environment working.

Arduino IDE – Integrated Development Environment 

To start out building Arduino circuits you’ll need a starter kit to learn basic Arduino wiring and coding. Arduino controllers are all compatible so if you develop in the kit you can load the code into the Nano for a smaller size device. The kits have links to the code and detailed instructions on concepts and working examples. 

Arduino Library Files Tree and the Arduino IDE Library Manager

The terminal listing on the left shows where Arduino expects the library files. The right image shows where the library references are shown in the Arduino IDE.

Good luck and stamina! It’s tedious to get the references right the first time you use new libraries.

ArduCam/SD Card/Arduino Nano Wiring

Yikes! Don’t worry it’s not as bad as it looks!

Simplified Pinout Table

Look at the pinout table in the lower center. Notice that all but 1 pin from the camera and the SD card socket go to the same pins. This 1 pin on each card that differs is the Chip Select(CS) pin. The Arduino .ino code uses the CS pin to let the chip know that it is receiving instructions.

Note, the other acronyms are explained in the table:

  • MOSI – Main Out Secondary In  
  • MISO – Main In Secondary Out

Camera Build

You can start the build with just the camera.

Add the SD Socket to the Camera Setup

Take a look at the picture below. Check the color of the wires that you used for the camera setup, then use the same color wires to connect the SD socket.

On the SD Card Module

  • GND – Red
  • VCC 5V – Orange
  • CS – White
  • MOSI – Green
  • SCK – Blue
  • MISO – Yellow

Leave a Reply