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
- Controller – ELEGOO Presoldered Nano Boards with USB Cable Compatible with Arduino IDE Microcontroller Mini Board ATmega+328P CH340 Chip
- Camera – Arducam Mini Module Camera Shield with OV2640 2 Megapixels Lens
- Breadboards – BOJACK 1Pcs 803 Tie points and 1 Pcs 400 Tie Points Solderless Breadboard and 65 Pcs Flexible Breadboard Jumper Wires and 6PCS 170 Points Mini Solderless Breadboard
- SD Card Socket – 5pcs SD Card Module Slot Socket Reader for Arduino ARM Mcu SD Card Module Slot Socket Reader and Write
- 4GB SD Card – GIGASTONE 4GB SD Card 5 Pack SDHC Class 4 Memory Card for Photo Video Music Voice File DSLR Camera DSC Camcorder Recorder Playback PC Mac POS 5pcs in Pack (Pack of 5), with 5 mini Cases
- SD Card Reader for Mac (not shown) – USB C SD Card Reader, Oyuiasle USB C to SD Card for iPhone 15 16/iPad/Mac/Laptop, USB-C/Type C Memory Card Adapter for iMac, iPad Pro Air Mini, MacBook Pro Air,Galaxy,MicroSD/SD
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”
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.
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
