#Test: 2MP Motion Detection Camera with Motion Detection based on Orange Pi Lite and Motion

camera orange pi 2MP csi

Orange Pi markets a small 2MP color camera with wide-angle optics that can be used to create a small additional surveillance camera. In this tutorial, we will install the gc2035 and vfe_v4l2 drivers that support the camera. The software part will be entrusted to Motion capable of detecting movements in front of the camera. With the exception of the Orange Pi Zero, all Orange Pi card computers have a camera port in CSI (Camera Serial Interface) format as well as Raspberry Pi (from the second generation).

Configuration used

This camera uses the gc2035 driver. It is compatible with all Orange Pi mini-PCs. Since the gc2035 driver is part of the default Debian distribution, it is very easy to activate it. For this tutorial, you will need the following hardware.

orange pi lite h3 computer board Orange Pi Lite

€12 (shipping cost, about €3.50 )

orange pi alimentation 5v 3a jack Power 5V – 3A

Or USB cable, about €2.50

carte sd Armbian on 8Go SD Card classe 10

From €6.90

camera orange pi 2MP csi Orange Pi 2MP camera module

About €7 (free shipping)

On the system side, I opted for Armbian (presented in this article). It is a lightweight system (a version without desktop is available) whose origins are known. So there is a very low risk of turning your 100% DIY surveillance camera into botnet and finding yourself involved in a new DDoS attack case!

Unpacking the Orange Pi Camera

The camera of Orange Pi is delivered in a simple transparent plastic bag. Low cost complies. The module includes the camera, an adapter (required) and a 15 cm long tape.

camera 2mp orange pi csi

Compatible with the Raspberry Pi connector ?

The Raspberry Pi uses a CSI-2 connector that supports cameras up to 5 MPixels. The Orange Pi also has a CSI connector but the similarity stops there. Indeed, it is indeed a CSI connector but it is not the CSI-2 15 pin that equips the Raspberry Pi (2, 3 or Zero).

It is a 24-pin connector with a width of 12mm, while that of the Raspberry Pi measures 16mm. Difficult to know which version it is because nothing is clearly documented, including the technical documents available here.

orange pi raspberry pi camera csi ribbon comparison

Camera ribbon Orange Pi left (12mm, 24 tracks). Ribbon of a Raspberry Pi camera on the right (16 mm, 15 tracks).

If you want a better camera, for example a camera with a setting optics, no IR filter for better night vision, or a higher resolution, you will have to fall back to a standard USB webcam. The most classic is the Logitech C270.

logitech c270 webcam usb orange pi lite


Open the connector. Insert the ribbon until you feel the bottom of the connector. There is no indicator of direction, simply turn the ribbon so that the tracks are opposite the pins of the connector. Close the connector.

Note. It is not possible to connect the camera directly to the Orange Pi.

camera 2mp orange pi csi

Do the same with Orange Pi.

 orange pi lite camera connectee connecteur cote carte

The result after assembly

orange pi lite camera

System Preparation

Before you start, it is best to update the system

After the upgrade, you will probably have to change your video configuration if the Orange Pi is connected to a DVI monitor (and therefore restart on a TV in HDMI).

Now we add the drivers for the camera

To get the drivers loaded at boot time, open the /etc/modules  file and uncomment the gc2035 and vfe_v4l2 drivers, for example

Installing and configuring Motion

Let’s start by creating a destination directory for images and assigning all permissions. For example /home/pi/motion/

Now we can install Motion

When the installation is complete, open the configuration file

Modify the following keys:

  • target_dir: Specify the destination path of the images. For example / home / pi / motion (previously created)
  • stream_localhost: set the parameter to off so that Motion can be accessed from another computer on the local network

Save with CTRL+X then Y

If Motion does not seem to work, it points to the / etc directory to load the configuration file. In this case, copy the configuration file with the cp command, for example.

Allow the Motion daemon to start at startup

To have Motion start at system startup, you need to modify a last configuration file.

Change the start_motion_daemon = yes parameter and save.

Start manually Motion

Now we can start Motion via its service

orange pi camera csi motion test

After a modification of the configuration file, it will be necessary to restart Motion to take account of the new parameters:

Motion crash after a few seconds

During the development of this article, I encountered some difficulties, and in particular the crash of Motion after a few seconds of operation. Regardless of the problem encountered, it is best to first activate the Motion event log. Open the configuration file

Then look for the line that starts with logfile and removed the semicolon.

Restart the Motion service

Now you have a log just open to see what causes Motion to crash

In my case, Motion crashed when an event was detected, especially when the image was saved in the destination folder.

So we just need to assign permissions to the directory to allow Motion to write into. But it is not a very good idea to touch this folder.

In fact, I simply forgot to change the destination directory of the images in the configuration file.

In the next tutorial, we will see how to make our own IP surveillance camera.


Now you have an IP Motion Detection camera that you simply include in your DIY home automation server.

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

DIY Projects