Comparison of Various Camera Modules

26 Mar.,2024

 

Introduction

The Raspberry Pi Camera Module comes with software designed to capture still images and videos, each of which has a variety of options that can control the final output. 

All Raspberry Pi cameras are capable of taking high-resolution photographs, along with full HD 1080p video, and can be fully controlled programmatically. This documentation describes the comparison of different types of camera modules for raspberry pi and it’s compatibility with other boards.

Pictures taken from different camera modules from the same position and angle will be shown under each section for comparison purposes.

So after reading this, hopefully you will get an idea of what type of camera module you should get for yourself :D !

 

Connect Camera Module to CSI Port

  1. The camera connector is on the right of the Raspberry Pi board. 

  2. Connect the cable with the camera, insert the cable with the

    shiny contacts facing the camera front. 
  3. On the Raspberry Pi board, insert the cable with the

    shiny contacts facing the flat side of the board

    i.e., the bottom side. On other Raspberry Pi Models

    .

Note: While attaching the camera please ensure that the power supply is cut off

Raspberry Pi Camera Commands with Bullseye OS installed in micro SD Card

With the latest Raspberry Pi OS, Debian Version 11 also known as Bullseye there have been some changes to the terminal commands which control the camera module. Throughout this tutorial we will be using the Bullseye OS Full as shown in the figure below.

From a user’s perspectives, this means the | raspistill | and | raspivid | camera commands that you have probably seen on older tutorial pages have been replaced with different commands under the new Libcamera Stack and Framework. If you try to use the old commands you will be responded with the error code | bash: raspistill: command not found | and | bash: raspivid: command not found |. 


This doesn't mean that the command is irrelevant from now on. The | raspistill | and | raspivid | camera commands can still be used by the users under Raspberry Pi Legacy OS also known as Debian Buster.

With that said all camera control commands have basically had their first prefix replaced with | libcamera-still | and | libcamera-vid | with some changes to additional settings as well. The camera commands explained on this page will work with any Camera Module for any Raspberry Pi computer with the newest Raspberry Pi Bullseye OS release.

Please visit this link if you would like to know more detailed information about Raspberry Pi Bullseye OS

Camera Modules Used

 

Hardware USED

Any Raspberry Pi Single Board Computer with a CSI port can be used. In this tutorial, we are using the Raspberry Pi 4 Model B 2GB board and also the Raspberry Pi Zero 2 W to observe the differences in terms of hardware and software.

3W Infrared LED for RPi NoIR Camera Module is tested to see the difference between with and without IR LED

Testing The Camera Modules

Note: The camera module used under this section is the Camera Module for Raspberry Pi

Raspberry Pi 4 Model B

For the model Raspberry Pi 4 Model B, after booting up the raspberry pi, open a Terminal session by clicking on the Terminal icon on the top menu bar. 

At the command prompt type the following:


 
lib-camera -o cammodule.jpg

Each picture taken is named with different files. For example, cammodule1.jpg, cammodule2.jpg and so on. 

To view the picture you have taken, open the File manager from the Accessories category of the raspberry menu. By default, the image will be saved to the home/pi folder.

For example a picture taken with Raspberry Pi 4

Raspberry Pi Zero 2 W

Hardware changes

Now, we are going to interface the Pi camera with Raspberry Pi zero 2 W but before interfacing, a Raspberry Pi Zero Camera Cable is required. In the image given below, you can see a 50 cm 15 pin Pi camera cable. This cable has the same number of pins at both the ends and it is used to connect Raspberry Pi 3 & 4 with Pi camera. There are 2 different length alternatives for this type of cable which are 1 meter and 2 meter for a longer connections.

The image below shows the camera cable for Pi zero family. This cable does not have the same width at both ends and has lower width at Pi zero board side. To use this cable just attach the CSI camera connector at the side of the Raspberry Pi Zero.

 

The same method as mentioned in the section, by connecting the camera modules to the CSI port. The final connection would look like this :

 

Software changes

In some cases you will receive an error message telling you that the image failed to import even if you’ve done all configuration enabling the camera as shown:


 
terminate called after throwing an instance of 'std::runtime_error' what(): failed to import fd 21

The main reason for this is probably because of the preview window, where the raspberry pi zero doesn’t have enough memory to run that. To close it, use the following command:


 
libcamera-jpeg -n -o (your file name).jpg

Where you’ll receive the image you just take after 5 seconds by default without previewing it.

The picture above is captured by using Raspberry Pi Zero 2 W without displaying the preview. If you want to find an angle to preview the image on raspberry pi zero, you may try the following command:


 
libcamera-jpeg --qt-preview -o (yourfilename).jpg

The display will become smaller but it still gets the work done!

TYPES OF CAMERA MODULES

Camera Module for Raspberry Pi

Let's get started with the Raspberry Pi camera module. For your information, all available stock in the market for this version of the 5MP camera now is End-Of-Life product from Raspberry Pi and is being produced as the 3rd party board which is being used throughout this section. However the 8MP camera module  is still being produced officially by the Raspberry Pi Foundation. Nonetheless it’s still the most easiest to interface and it is :

  • Fully compatible with :

    • All models of Raspberry Pi 1, 2, 3, and 4

    • Raspberry pi zero series

      (just change the FFC cable)

    • Nvidia Jetson Nano Development Kit

The board itself is tiny, at around 20mm x 25mm x 9mm and weighing in at just over 3g, making it perfect for mobile or other applications where size and weight are important. 

It supports 1080p at 30fps, 720p at 60fps and 640x480p 60/90 recording and has an optical size of 1/4". 1.4 µm X 1.4 µm pixel with OmniBSI technology for high performance (high sensitivity). This model of camera does not include night vision.

The Pi Camera Module has a focal length of about 50 cm and a depth of field of 50 cm to infinity. This means that objects will only appear in focus if they’re at least 50 cm away from the lens of the camera.

The picture above shows one of the attempts of focusing and adjusting the camera module on the 3d-printed dragon and book. 

To adjust focus, pinch the indentations with the pliers or tweezers gently, then give a small amount of torque just enough to break the thin glue that sets factory focus. Turn back and forth in small increments while taking pictures to confirm the correct focus. Also it is quite hard to turn the focus lens with just your hands. 

Note: Do this at your own risk, it is not cover under warranty.

Quick Tip (with tools): Turn anti-clockwise to focus on a nearby object. Conversely, clockwise to focus on a distant object

 

3d printed dragon figures, taken with camera board for raspberry pi

The picture above shows the final result after a few adjustments. The camera was able to focus on the 3d-printed dragon figure and the book. To simplify, the adjustment made is to balance the image distance (between sensor and lens) and the object distance (between lens and object) which is around 45 cm in this case.

Video captured using Raspberry Camera Module :

   

When the camera module should be used :

The compact size and the lightweight features of the Raspberry Pi camera board make it compatible and feasible to use as a hidden camera or camera for Pi phones.

Besides, this camera module can be used to create a 3D print time-lapse together with Raspberry Pi 4, this is the tutorial link for the octo-lapse.

This camera module is cheaper than other camera modules. So to shoot videos and pictures for a budget option this camera module is highly recommended, especially for raspberry pi camera-related projects such as face recognition and smart door, etc.

 

8MP IMX219 Camera Module For Jetson Dev Kits

This is an 8-megapixel camera that comes in with 2 FOV (field-of-view) options which are 77 and 160 degrees. It is suitable to use with the NVIDIA Jetson Nano and NVIDIA Jetson Xavier NX Development Kits,  and also compatible with Raspberry Pi Board.

You can use it with the transparent acrylic bracket for the camera and can be mounted on the acrylic case of the Jetson Nano or Jetson Xavier NX.

It’s resolution is at 1080p and has a CMOS size of 1/4"

3d printed dragon figures, taken with 8MP IMX219 Camera Module 77° 3d printed dragon figures, taken with 8MP IMX219 Camera Module 160°

As we can see from both the figures taken with IMX219 above, the 77-degree module has a higher resolution compared to the 160-degree module. But in exchange, the 160-degree module has a wider field of view that shows some other equipment even when they’re both taken from the same range and angle.

Video captured using IMX219 Camera Module 77 ° :

 

Video captured using IMX219 Camera Module 160 ° :

 

The camera module’s range of applications :

  • For neural networks
  • AI vision
  • Real-time image recognition
  • AI smart robot cars

 

Fish Eye Lens Raspberry Pi 5MP IR Camera

From the name 'fisheye' itself, you can probably tell that it’s speciality is it’s field of view (diagonal) which is 130° (wide angle) and is wider than most of the camera modules that are around 70 degree. The sensor itself has a native resolution of 5 megapixels and has an adjustable focus lens onboard. Though the camera isn't an official Raspberry Pi Camera Module, it supports the latest version of Raspbian, Bullseyes as well as the Legacy version. It is :

The 4 screw holes (Ø2.3mm) on the camera module is :

  • With 3.3V output (can be used as external light source power supply) 

  • For the module static attaching (Caution: Don't attach it to electric conductible material like metal)

3d printed dragon figures, taken with the fisheye lens camera module

From the camera module above as we see, some other objects are included from the same distance and angle. We can observe a wider field of view.

Video captured using the Fisheye Lens Camera Module:

 

When the camera module should be used :

Although fisheye lens camera modules are often considered a ‘big no’ among landscape and cityscape photographers. Using a fisheye is a creative choice, rather than a practical one. The extreme curvature of the scene being recorded is highly stylized.

You will find so many interesting shapes and compositions that you would normally completely miss. It just offers so much creativity. For example, fisheye lens camera modules are great for behind-the-scenes shots.

 

3.6mm Lens Raspberry Pi 5MP IR Camera (Night-vision)

This Camera Module is a custom designed add-on for Raspberry Pi. The interface uses the dedicated CSI interface, which was designed especially for interfacing with cameras. The CSI bus is capable of extremely high data rates, and it exclusively carries pixel data. This bus travels along the ribbon cable that attaches the camera board to the Pi. 

The sensor itself has a native resolution of 5 megapixels and has an adjustable focus lens onboard. Like the fisheye lens camera module, the camera is supported in the latest version of Raspbian, Bullseye as well as the Legacy version.

The field of view (diagonal) of the camera is 60° compared to the other camera modules on the list it is slightly narrower. It has an adjustable focal length of 3.6mm.

The camera module is fully compatible with raspberry pi board and it supports access to the infrared light or fill light.

Due to this module using the night vision lens, the captured image will be a little bit reddish, black and green during the daytime.

3d printed dragon figures, taken with 3.6mm lens camera module

The image presented is narrower compared to the previous camera modules. To cover that flaw of the camera, the focal length of this camera is easily adjustable by the users to shoot from various distances.

Video captured using the Fisheye Lens Camera Module:

 

From the video above we can observe the significant difference of this camera module compared to the others. Since the camera does not employ an infrared filter on, the video and picture appears to be more reddish, on the bright side it provides the ability to see in dark with infrared lighting that is not visible to human eyes. 

When the camera module should be used :

This camera module is suitable for both daytime and night recording. It can be used to improve users’ perception and see distance in darkness or poor weather. With its' adjustable focal length it is convenient for focusing the image without any other tools, unlike the official Raspberry Pi camera module.

 

Infrared LED for RPi NoIR Camera Module

This is a 3W high-power 850 infrared light, adjustable resistance. Comes with an onboard adjustable resistor, for controlling the ambient light threshold of toggling the infrared LED. It allows adding night vision function to RPi cameras. Like infrared cameras both detect and emit infrared light according to the ambient light available.

  • So it's fully compatible with :

    • Fish Eye Lens Raspberry Pi 5MP IR Camera

    • 3.6mm Lens Raspberry Pi 5MP IR Camera (Nightvision)

How to use: 

  1. Connect the Infrared LED Board to the camera PCB with screws. 

  2. The screw holes are used for both attachment and power supply. 

  3. Adjust the adjustable resistor to set a proper ambient light threshold, which toggles the infrared LED automatically. 

  4. When ambient light is lower than the threshold value, the infrared LED is on, vice versa.

When to use:

  1. For security cameras, to allow cameras to capture both day and nighttime images.
  2. It can be used to light up complete darkness for the camera with no infrared filter.

 

If you'd like to see similar comparison for different camera lens for HQ Camera, you can refer to this article.