Skip to content

simondlevy/BreezyArduCAM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple Arduino API for ArduCAM Mini

This repository contains an Arduino library and examples for the popular ArduCAM Mini camera. I've taken the code in the original ArduCAM Arduino repository and simplified the API, so you can write new applications with a minimal amount of effort.

As you can see in this example, you just call a constructor method, a begin method, and a capture method. Each example (streaming JPEG images, BMP snapshot) has a corresponding Python script that you can run on your host computer.

I have tested this library with ArduCAM Mini 2MP (OV2640) and ArducamMini 5MP Plus (OV5642).

To run the example programs you will need:

If (like me) you use an ordinary Arduino board without the ArduCAM Shield you can use the ArduCAM tutorial to set up your camera. Pay special attention to the CS pin, which you'll have to change in the Arduino sketch to match the wiring in the tutorial.

As usual with Arduino, you should clone this repository into your Arduino libraries folder. Then launch the Arduino IDE and go to File/Examples/BreezyArduCAM) to upload an example sketch.

Once you've wired up the camera and loaded the sketch onto your Arduino, edit the PORT variable at the top of the Python script to reflect the serial port on which your Arduino is connected.

Note on the streaming JPEG example

This example requires you to be running OpenCV for Python on your computer. The Python program saves the successive JPEG images to a single temporary file for display. If you're a Python (or C++) programmer interested in computer vision, you're going to want to get familiar with OpenCV, and if you're a Python programmer, you're eventually going to have to switch from Python2 to Python3 if you haven't already. Since I use Windows and Ubuntu, I can't help you with doing this on Mac OS X. On Ubuntu 16.04 I was able to get OpenCV installed for Python3 in about ten minutes, using this tutorial. On Windows 10 I followed these directions (which may also help you if you need to install pyserial).

Note on the BMP snapshot example

This example saves a single 320x240 image to a file test.bmp. For the reason explained here, the BMP file may appear upside-down when displayed. This happens with the 2MP camera but not the 5MP, for reasons I don't currently know.

Known bugs

Sometimes the bmpsnap.py script will report a Unicode decoding error when you run it for the first time.

About

A simple Arduino API for the ArduCAM Mini

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published